1.\" 2.\" Author: Tatu Ylonen <ylo@cs.hut.fi> 3.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4.\" All rights reserved 5.\" 6.\" As far as I am concerned, the code I have written for this software 7.\" can be used freely for any purpose. Any derived versions of this 8.\" software must be clearly marked as such, and if the derived work is 9.\" incompatible with the protocol description in the RFC file, it must be 10.\" called by a name other than "ssh" or "Secure Shell". 11.\" 12.\" Copyright (c) 1999,2000 Markus Friedl. All rights reserved. 13.\" Copyright (c) 1999 Aaron Campbell. All rights reserved. 14.\" Copyright (c) 1999 Theo de Raadt. All rights reserved. 15.\" 16.\" Redistribution and use in source and binary forms, with or without 17.\" modification, are permitted provided that the following conditions 18.\" are met: 19.\" 1. Redistributions of source code must retain the above copyright 20.\" notice, this list of conditions and the following disclaimer. 21.\" 2. Redistributions in binary form must reproduce the above copyright 22.\" notice, this list of conditions and the following disclaimer in the 23.\" documentation and/or other materials provided with the distribution. 24.\" 25.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 26.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 27.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 28.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 29.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 30.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 31.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 32.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 33.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35.\" 36.\" $OpenBSD: ssh.1,v 1.425 2021/07/28 05:57:42 jmc Exp $ 37.\" $FreeBSD$ 38.Dd $Mdocdate: July 28 2021 $ 39.Dt SSH 1 40.Os 41.Sh NAME 42.Nm ssh 43.Nd OpenSSH remote login client 44.Sh SYNOPSIS 45.Nm ssh 46.Op Fl 46AaCfGgKkMNnqsTtVvXxYy 47.Op Fl B Ar bind_interface 48.Op Fl b Ar bind_address 49.Op Fl c Ar cipher_spec 50.Op Fl D Oo Ar bind_address : Oc Ns Ar port 51.Op Fl E Ar log_file 52.Op Fl e Ar escape_char 53.Op Fl F Ar configfile 54.Op Fl I Ar pkcs11 55.Op Fl i Ar identity_file 56.Op Fl J Ar destination 57.Op Fl L Ar address 58.Op Fl l Ar login_name 59.Op Fl m Ar mac_spec 60.Op Fl O Ar ctl_cmd 61.Op Fl o Ar option 62.Op Fl p Ar port 63.Op Fl Q Ar query_option 64.Op Fl R Ar address 65.Op Fl S Ar ctl_path 66.Op Fl W Ar host : Ns Ar port 67.Op Fl w Ar local_tun Ns Op : Ns Ar remote_tun 68.Ar destination 69.Op Ar command 70.Sh DESCRIPTION 71.Nm 72(SSH client) is a program for logging into a remote machine and for 73executing commands on a remote machine. 74It is intended to provide secure encrypted communications between 75two untrusted hosts over an insecure network. 76X11 connections, arbitrary TCP ports and 77.Ux Ns -domain 78sockets can also be forwarded over the secure channel. 79.Pp 80.Nm 81connects and logs into the specified 82.Ar destination , 83which may be specified as either 84.Sm off 85.Oo user @ Oc hostname 86.Sm on 87or a URI of the form 88.Sm off 89.No ssh:// Oo user @ Oc hostname Op : port . 90.Sm on 91The user must prove 92their identity to the remote machine using one of several methods 93(see below). 94.Pp 95If a 96.Ar command 97is specified, 98it is executed on the remote host instead of a login shell. 99.Pp 100The options are as follows: 101.Pp 102.Bl -tag -width Ds -compact 103.It Fl 4 104Forces 105.Nm 106to use IPv4 addresses only. 107.Pp 108.It Fl 6 109Forces 110.Nm 111to use IPv6 addresses only. 112.Pp 113.It Fl A 114Enables forwarding of connections from an authentication agent such as 115.Xr ssh-agent 1 . 116This can also be specified on a per-host basis in a configuration file. 117.Pp 118Agent forwarding should be enabled with caution. 119Users with the ability to bypass file permissions on the remote host 120(for the agent's 121.Ux Ns -domain 122socket) can access the local agent through the forwarded connection. 123An attacker cannot obtain key material from the agent, 124however they can perform operations on the keys that enable them to 125authenticate using the identities loaded into the agent. 126A safer alternative may be to use a jump host 127(see 128.Fl J ) . 129.Pp 130.It Fl a 131Disables forwarding of the authentication agent connection. 132.Pp 133.It Fl B Ar bind_interface 134Bind to the address of 135.Ar bind_interface 136before attempting to connect to the destination host. 137This is only useful on systems with more than one address. 138.Pp 139.It Fl b Ar bind_address 140Use 141.Ar bind_address 142on the local machine as the source address 143of the connection. 144Only useful on systems with more than one address. 145.Pp 146.It Fl C 147Requests compression of all data (including stdin, stdout, stderr, and 148data for forwarded X11, TCP and 149.Ux Ns -domain 150connections). 151The compression algorithm is the same used by 152.Xr gzip 1 . 153Compression is desirable on modem lines and other 154slow connections, but will only slow down things on fast networks. 155The default value can be set on a host-by-host basis in the 156configuration files; see the 157.Cm Compression 158option. 159.Pp 160.It Fl c Ar cipher_spec 161Selects the cipher specification for encrypting the session. 162.Ar cipher_spec 163is a comma-separated list of ciphers 164listed in order of preference. 165See the 166.Cm Ciphers 167keyword in 168.Xr ssh_config 5 169for more information. 170.Pp 171.It Fl D Xo 172.Sm off 173.Oo Ar bind_address : Oc 174.Ar port 175.Sm on 176.Xc 177Specifies a local 178.Dq dynamic 179application-level port forwarding. 180This works by allocating a socket to listen to 181.Ar port 182on the local side, optionally bound to the specified 183.Ar bind_address . 184Whenever a connection is made to this port, the 185connection is forwarded over the secure channel, and the application 186protocol is then used to determine where to connect to from the 187remote machine. 188Currently the SOCKS4 and SOCKS5 protocols are supported, and 189.Nm 190will act as a SOCKS server. 191Only root can forward privileged ports. 192Dynamic port forwardings can also be specified in the configuration file. 193.Pp 194IPv6 addresses can be specified by enclosing the address in square brackets. 195Only the superuser can forward privileged ports. 196By default, the local port is bound in accordance with the 197.Cm GatewayPorts 198setting. 199However, an explicit 200.Ar bind_address 201may be used to bind the connection to a specific address. 202The 203.Ar bind_address 204of 205.Dq localhost 206indicates that the listening port be bound for local use only, while an 207empty address or 208.Sq * 209indicates that the port should be available from all interfaces. 210.Pp 211.It Fl E Ar log_file 212Append debug logs to 213.Ar log_file 214instead of standard error. 215.Pp 216.It Fl e Ar escape_char 217Sets the escape character for sessions with a pty (default: 218.Ql ~ ) . 219The escape character is only recognized at the beginning of a line. 220The escape character followed by a dot 221.Pq Ql \&. 222closes the connection; 223followed by control-Z suspends the connection; 224and followed by itself sends the escape character once. 225Setting the character to 226.Dq none 227disables any escapes and makes the session fully transparent. 228.Pp 229.It Fl F Ar configfile 230Specifies an alternative per-user configuration file. 231If a configuration file is given on the command line, 232the system-wide configuration file 233.Pq Pa /etc/ssh/ssh_config 234will be ignored. 235The default for the per-user configuration file is 236.Pa ~/.ssh/config . 237If set to 238.Dq none , 239no configuration files will be read. 240.Pp 241.It Fl f 242Requests 243.Nm 244to go to background just before command execution. 245This is useful if 246.Nm 247is going to ask for passwords or passphrases, but the user 248wants it in the background. 249This implies 250.Fl n . 251The recommended way to start X11 programs at a remote site is with 252something like 253.Ic ssh -f host xterm . 254.Pp 255If the 256.Cm ExitOnForwardFailure 257configuration option is set to 258.Dq yes , 259then a client started with 260.Fl f 261will wait for all remote port forwards to be successfully established 262before placing itself in the background. 263Refer to the description of 264.Cm ForkAfterAuthentication 265in 266.Xr ssh_config 5 267for details. 268.Pp 269.It Fl G 270Causes 271.Nm 272to print its configuration after evaluating 273.Cm Host 274and 275.Cm Match 276blocks and exit. 277.Pp 278.It Fl g 279Allows remote hosts to connect to local forwarded ports. 280If used on a multiplexed connection, then this option must be specified 281on the master process. 282.Pp 283.It Fl I Ar pkcs11 284Specify the PKCS#11 shared library 285.Nm 286should use to communicate with a PKCS#11 token providing keys for user 287authentication. 288.Pp 289.It Fl i Ar identity_file 290Selects a file from which the identity (private key) for 291public key authentication is read. 292The default is 293.Pa ~/.ssh/id_dsa , 294.Pa ~/.ssh/id_ecdsa , 295.Pa ~/.ssh/id_ecdsa_sk , 296.Pa ~/.ssh/id_ed25519 , 297.Pa ~/.ssh/id_ed25519_sk 298and 299.Pa ~/.ssh/id_rsa . 300Identity files may also be specified on 301a per-host basis in the configuration file. 302It is possible to have multiple 303.Fl i 304options (and multiple identities specified in 305configuration files). 306If no certificates have been explicitly specified by the 307.Cm CertificateFile 308directive, 309.Nm 310will also try to load certificate information from the filename obtained 311by appending 312.Pa -cert.pub 313to identity filenames. 314.Pp 315.It Fl J Ar destination 316Connect to the target host by first making a 317.Nm 318connection to the jump host described by 319.Ar destination 320and then establishing a TCP forwarding to the ultimate destination from 321there. 322Multiple jump hops may be specified separated by comma characters. 323This is a shortcut to specify a 324.Cm ProxyJump 325configuration directive. 326Note that configuration directives supplied on the command-line generally 327apply to the destination host and not any specified jump hosts. 328Use 329.Pa ~/.ssh/config 330to specify configuration for jump hosts. 331.Pp 332.It Fl K 333Enables GSSAPI-based authentication and forwarding (delegation) of GSSAPI 334credentials to the server. 335.Pp 336.It Fl k 337Disables forwarding (delegation) of GSSAPI credentials to the server. 338.Pp 339.It Fl L Xo 340.Sm off 341.Oo Ar bind_address : Oc 342.Ar port : host : hostport 343.Sm on 344.Xc 345.It Fl L Xo 346.Sm off 347.Oo Ar bind_address : Oc 348.Ar port : remote_socket 349.Sm on 350.Xc 351.It Fl L Xo 352.Sm off 353.Ar local_socket : host : hostport 354.Sm on 355.Xc 356.It Fl L Xo 357.Sm off 358.Ar local_socket : remote_socket 359.Sm on 360.Xc 361Specifies that connections to the given TCP port or Unix socket on the local 362(client) host are to be forwarded to the given host and port, or Unix socket, 363on the remote side. 364This works by allocating a socket to listen to either a TCP 365.Ar port 366on the local side, optionally bound to the specified 367.Ar bind_address , 368or to a Unix socket. 369Whenever a connection is made to the local port or socket, the 370connection is forwarded over the secure channel, and a connection is 371made to either 372.Ar host 373port 374.Ar hostport , 375or the Unix socket 376.Ar remote_socket , 377from the remote machine. 378.Pp 379Port forwardings can also be specified in the configuration file. 380Only the superuser can forward privileged ports. 381IPv6 addresses can be specified by enclosing the address in square brackets. 382.Pp 383By default, the local port is bound in accordance with the 384.Cm GatewayPorts 385setting. 386However, an explicit 387.Ar bind_address 388may be used to bind the connection to a specific address. 389The 390.Ar bind_address 391of 392.Dq localhost 393indicates that the listening port be bound for local use only, while an 394empty address or 395.Sq * 396indicates that the port should be available from all interfaces. 397.Pp 398.It Fl l Ar login_name 399Specifies the user to log in as on the remote machine. 400This also may be specified on a per-host basis in the configuration file. 401.Pp 402.It Fl M 403Places the 404.Nm 405client into 406.Dq master 407mode for connection sharing. 408Multiple 409.Fl M 410options places 411.Nm 412into 413.Dq master 414mode but with confirmation required using 415.Xr ssh-askpass 1 416before each operation that changes the multiplexing state 417(e.g. opening a new session). 418Refer to the description of 419.Cm ControlMaster 420in 421.Xr ssh_config 5 422for details. 423.Pp 424.It Fl m Ar mac_spec 425A comma-separated list of MAC (message authentication code) algorithms, 426specified in order of preference. 427See the 428.Cm MACs 429keyword for more information. 430.Pp 431.It Fl N 432Do not execute a remote command. 433This is useful for just forwarding ports. 434Refer to the description of 435.Cm SessionType 436in 437.Xr ssh_config 5 438for details. 439.Pp 440.It Fl n 441Redirects stdin from 442.Pa /dev/null 443(actually, prevents reading from stdin). 444This must be used when 445.Nm 446is run in the background. 447A common trick is to use this to run X11 programs on a remote machine. 448For example, 449.Ic ssh -n shadows.cs.hut.fi emacs & 450will start an emacs on shadows.cs.hut.fi, and the X11 451connection will be automatically forwarded over an encrypted channel. 452The 453.Nm 454program will be put in the background. 455(This does not work if 456.Nm 457needs to ask for a password or passphrase; see also the 458.Fl f 459option.) 460Refer to the description of 461.Cm StdinNull 462in 463.Xr ssh_config 5 464for details. 465.Pp 466.It Fl O Ar ctl_cmd 467Control an active connection multiplexing master process. 468When the 469.Fl O 470option is specified, the 471.Ar ctl_cmd 472argument is interpreted and passed to the master process. 473Valid commands are: 474.Dq check 475(check that the master process is running), 476.Dq forward 477(request forwardings without command execution), 478.Dq cancel 479(cancel forwardings), 480.Dq exit 481(request the master to exit), and 482.Dq stop 483(request the master to stop accepting further multiplexing requests). 484.Pp 485.It Fl o Ar option 486Can be used to give options in the format used in the configuration file. 487This is useful for specifying options for which there is no separate 488command-line flag. 489For full details of the options listed below, and their possible values, see 490.Xr ssh_config 5 . 491.Pp 492.Bl -tag -width Ds -offset indent -compact 493.It AddKeysToAgent 494.It AddressFamily 495.It BatchMode 496.It BindAddress 497.It CanonicalDomains 498.It CanonicalizeFallbackLocal 499.It CanonicalizeHostname 500.It CanonicalizeMaxDots 501.It CanonicalizePermittedCNAMEs 502.It CASignatureAlgorithms 503.It CertificateFile 504.It CheckHostIP 505.It Ciphers 506.It ClearAllForwardings 507.It Compression 508.It ConnectionAttempts 509.It ConnectTimeout 510.It ControlMaster 511.It ControlPath 512.It ControlPersist 513.It DynamicForward 514.It EscapeChar 515.It ExitOnForwardFailure 516.It FingerprintHash 517.It ForkAfterAuthentication 518.It ForwardAgent 519.It ForwardX11 520.It ForwardX11Timeout 521.It ForwardX11Trusted 522.It GatewayPorts 523.It GlobalKnownHostsFile 524.It GSSAPIAuthentication 525.It GSSAPIDelegateCredentials 526.It HashKnownHosts 527.It Host 528.It HostbasedAcceptedAlgorithms 529.It HostbasedAuthentication 530.It HostKeyAlgorithms 531.It HostKeyAlias 532.It Hostname 533.It IdentitiesOnly 534.It IdentityAgent 535.It IdentityFile 536.It IPQoS 537.It KbdInteractiveAuthentication 538.It KbdInteractiveDevices 539.It KexAlgorithms 540.It KnownHostsCommand 541.It LocalCommand 542.It LocalForward 543.It LogLevel 544.It MACs 545.It Match 546.It NoHostAuthenticationForLocalhost 547.It NumberOfPasswordPrompts 548.It PasswordAuthentication 549.It PermitLocalCommand 550.It PermitRemoteOpen 551.It PKCS11Provider 552.It Port 553.It PreferredAuthentications 554.It ProxyCommand 555.It ProxyJump 556.It ProxyUseFdpass 557.It PubkeyAcceptedAlgorithms 558.It PubkeyAuthentication 559.It RekeyLimit 560.It RemoteCommand 561.It RemoteForward 562.It RequestTTY 563.It SendEnv 564.It ServerAliveInterval 565.It ServerAliveCountMax 566.It SessionType 567.It SetEnv 568.It StdinNull 569.It StreamLocalBindMask 570.It StreamLocalBindUnlink 571.It StrictHostKeyChecking 572.It TCPKeepAlive 573.It Tunnel 574.It TunnelDevice 575.It UpdateHostKeys 576.It User 577.It UserKnownHostsFile 578.It VerifyHostKeyDNS 579.It VersionAddendum 580.It VisualHostKey 581.It XAuthLocation 582.El 583.Pp 584.It Fl p Ar port 585Port to connect to on the remote host. 586This can be specified on a 587per-host basis in the configuration file. 588.Pp 589.It Fl Q Ar query_option 590Queries for the algorithms supported by one of the following features: 591.Ar cipher 592(supported symmetric ciphers), 593.Ar cipher-auth 594(supported symmetric ciphers that support authenticated encryption), 595.Ar help 596(supported query terms for use with the 597.Fl Q 598flag), 599.Ar mac 600(supported message integrity codes), 601.Ar kex 602(key exchange algorithms), 603.Ar key 604(key types), 605.Ar key-cert 606(certificate key types), 607.Ar key-plain 608(non-certificate key types), 609.Ar key-sig 610(all key types and signature algorithms), 611.Ar protocol-version 612(supported SSH protocol versions), and 613.Ar sig 614(supported signature algorithms). 615Alternatively, any keyword from 616.Xr ssh_config 5 617or 618.Xr sshd_config 5 619that takes an algorithm list may be used as an alias for the corresponding 620query_option. 621.Pp 622.It Fl q 623Quiet mode. 624Causes most warning and diagnostic messages to be suppressed. 625.Pp 626.It Fl R Xo 627.Sm off 628.Oo Ar bind_address : Oc 629.Ar port : host : hostport 630.Sm on 631.Xc 632.It Fl R Xo 633.Sm off 634.Oo Ar bind_address : Oc 635.Ar port : local_socket 636.Sm on 637.Xc 638.It Fl R Xo 639.Sm off 640.Ar remote_socket : host : hostport 641.Sm on 642.Xc 643.It Fl R Xo 644.Sm off 645.Ar remote_socket : local_socket 646.Sm on 647.Xc 648.It Fl R Xo 649.Sm off 650.Oo Ar bind_address : Oc 651.Ar port 652.Sm on 653.Xc 654Specifies that connections to the given TCP port or Unix socket on the remote 655(server) host are to be forwarded to the local side. 656.Pp 657This works by allocating a socket to listen to either a TCP 658.Ar port 659or to a Unix socket on the remote side. 660Whenever a connection is made to this port or Unix socket, the 661connection is forwarded over the secure channel, and a connection 662is made from the local machine to either an explicit destination specified by 663.Ar host 664port 665.Ar hostport , 666or 667.Ar local_socket , 668or, if no explicit destination was specified, 669.Nm 670will act as a SOCKS 4/5 proxy and forward connections to the destinations 671requested by the remote SOCKS client. 672.Pp 673Port forwardings can also be specified in the configuration file. 674Privileged ports can be forwarded only when 675logging in as root on the remote machine. 676IPv6 addresses can be specified by enclosing the address in square brackets. 677.Pp 678By default, TCP listening sockets on the server will be bound to the loopback 679interface only. 680This may be overridden by specifying a 681.Ar bind_address . 682An empty 683.Ar bind_address , 684or the address 685.Ql * , 686indicates that the remote socket should listen on all interfaces. 687Specifying a remote 688.Ar bind_address 689will only succeed if the server's 690.Cm GatewayPorts 691option is enabled (see 692.Xr sshd_config 5 ) . 693.Pp 694If the 695.Ar port 696argument is 697.Ql 0 , 698the listen port will be dynamically allocated on the server and reported 699to the client at run time. 700When used together with 701.Ic -O forward 702the allocated port will be printed to the standard output. 703.Pp 704.It Fl S Ar ctl_path 705Specifies the location of a control socket for connection sharing, 706or the string 707.Dq none 708to disable connection sharing. 709Refer to the description of 710.Cm ControlPath 711and 712.Cm ControlMaster 713in 714.Xr ssh_config 5 715for details. 716.Pp 717.It Fl s 718May be used to request invocation of a subsystem on the remote system. 719Subsystems facilitate the use of SSH 720as a secure transport for other applications (e.g.\& 721.Xr sftp 1 ) . 722The subsystem is specified as the remote command. 723Refer to the description of 724.Cm SessionType 725in 726.Xr ssh_config 5 727for details. 728.Pp 729.It Fl T 730Disable pseudo-terminal allocation. 731.Pp 732.It Fl t 733Force pseudo-terminal allocation. 734This can be used to execute arbitrary 735screen-based programs on a remote machine, which can be very useful, 736e.g. when implementing menu services. 737Multiple 738.Fl t 739options force tty allocation, even if 740.Nm 741has no local tty. 742.Pp 743.It Fl V 744Display the version number and exit. 745.Pp 746.It Fl v 747Verbose mode. 748Causes 749.Nm 750to print debugging messages about its progress. 751This is helpful in 752debugging connection, authentication, and configuration problems. 753Multiple 754.Fl v 755options increase the verbosity. 756The maximum is 3. 757.Pp 758.It Fl W Ar host : Ns Ar port 759Requests that standard input and output on the client be forwarded to 760.Ar host 761on 762.Ar port 763over the secure channel. 764Implies 765.Fl N , 766.Fl T , 767.Cm ExitOnForwardFailure 768and 769.Cm ClearAllForwardings , 770though these can be overridden in the configuration file or using 771.Fl o 772command line options. 773.Pp 774.It Fl w Xo 775.Ar local_tun Ns Op : Ns Ar remote_tun 776.Xc 777Requests 778tunnel 779device forwarding with the specified 780.Xr tun 4 781devices between the client 782.Pq Ar local_tun 783and the server 784.Pq Ar remote_tun . 785.Pp 786The devices may be specified by numerical ID or the keyword 787.Dq any , 788which uses the next available tunnel device. 789If 790.Ar remote_tun 791is not specified, it defaults to 792.Dq any . 793See also the 794.Cm Tunnel 795and 796.Cm TunnelDevice 797directives in 798.Xr ssh_config 5 . 799.Pp 800If the 801.Cm Tunnel 802directive is unset, it will be set to the default tunnel mode, which is 803.Dq point-to-point . 804If a different 805.Cm Tunnel 806forwarding mode it desired, then it should be specified before 807.Fl w . 808.Pp 809.It Fl X 810Enables X11 forwarding. 811This can also be specified on a per-host basis in a configuration file. 812.Pp 813X11 forwarding should be enabled with caution. 814Users with the ability to bypass file permissions on the remote host 815(for the user's X authorization database) 816can access the local X11 display through the forwarded connection. 817An attacker may then be able to perform activities such as keystroke monitoring. 818.Pp 819For this reason, X11 forwarding is subjected to X11 SECURITY extension 820restrictions by default. 821Please refer to the 822.Nm 823.Fl Y 824option and the 825.Cm ForwardX11Trusted 826directive in 827.Xr ssh_config 5 828for more information. 829.Pp 830.It Fl x 831Disables X11 forwarding. 832.Pp 833.It Fl Y 834Enables trusted X11 forwarding. 835Trusted X11 forwardings are not subjected to the X11 SECURITY extension 836controls. 837.Pp 838.It Fl y 839Send log information using the 840.Xr syslog 3 841system module. 842By default this information is sent to stderr. 843.El 844.Pp 845.Nm 846may additionally obtain configuration data from 847a per-user configuration file and a system-wide configuration file. 848The file format and configuration options are described in 849.Xr ssh_config 5 . 850.Sh AUTHENTICATION 851The OpenSSH SSH client supports SSH protocol 2. 852.Pp 853The methods available for authentication are: 854GSSAPI-based authentication, 855host-based authentication, 856public key authentication, 857keyboard-interactive authentication, 858and password authentication. 859Authentication methods are tried in the order specified above, 860though 861.Cm PreferredAuthentications 862can be used to change the default order. 863.Pp 864Host-based authentication works as follows: 865If the machine the user logs in from is listed in 866.Pa /etc/hosts.equiv 867or 868.Pa /etc/shosts.equiv 869on the remote machine, the user is non-root and the user names are 870the same on both sides, or if the files 871.Pa ~/.rhosts 872or 873.Pa ~/.shosts 874exist in the user's home directory on the 875remote machine and contain a line containing the name of the client 876machine and the name of the user on that machine, the user is 877considered for login. 878Additionally, the server 879.Em must 880be able to verify the client's 881host key (see the description of 882.Pa /etc/ssh/ssh_known_hosts 883and 884.Pa ~/.ssh/known_hosts , 885below) 886for login to be permitted. 887This authentication method closes security holes due to IP 888spoofing, DNS spoofing, and routing spoofing. 889[Note to the administrator: 890.Pa /etc/hosts.equiv , 891.Pa ~/.rhosts , 892and the rlogin/rsh protocol in general, are inherently insecure and should be 893disabled if security is desired.] 894.Pp 895Public key authentication works as follows: 896The scheme is based on public-key cryptography, 897using cryptosystems 898where encryption and decryption are done using separate keys, 899and it is unfeasible to derive the decryption key from the encryption key. 900The idea is that each user creates a public/private 901key pair for authentication purposes. 902The server knows the public key, and only the user knows the private key. 903.Nm 904implements public key authentication protocol automatically, 905using one of the DSA, ECDSA, Ed25519 or RSA algorithms. 906The HISTORY section of 907.Xr ssl 8 908contains a brief discussion of the DSA and RSA algorithms. 909.Pp 910The file 911.Pa ~/.ssh/authorized_keys 912lists the public keys that are permitted for logging in. 913When the user logs in, the 914.Nm 915program tells the server which key pair it would like to use for 916authentication. 917The client proves that it has access to the private key 918and the server checks that the corresponding public key 919is authorized to accept the account. 920.Pp 921The server may inform the client of errors that prevented public key 922authentication from succeeding after authentication completes using a 923different method. 924These may be viewed by increasing the 925.Cm LogLevel 926to 927.Cm DEBUG 928or higher (e.g. by using the 929.Fl v 930flag). 931.Pp 932The user creates their key pair by running 933.Xr ssh-keygen 1 . 934This stores the private key in 935.Pa ~/.ssh/id_dsa 936(DSA), 937.Pa ~/.ssh/id_ecdsa 938(ECDSA), 939.Pa ~/.ssh/id_ecdsa_sk 940(authenticator-hosted ECDSA), 941.Pa ~/.ssh/id_ed25519 942(Ed25519), 943.Pa ~/.ssh/id_ed25519_sk 944(authenticator-hosted Ed25519), 945or 946.Pa ~/.ssh/id_rsa 947(RSA) 948and stores the public key in 949.Pa ~/.ssh/id_dsa.pub 950(DSA), 951.Pa ~/.ssh/id_ecdsa.pub 952(ECDSA), 953.Pa ~/.ssh/id_ecdsa_sk.pub 954(authenticator-hosted ECDSA), 955.Pa ~/.ssh/id_ed25519.pub 956(Ed25519), 957.Pa ~/.ssh/id_ed25519_sk.pub 958(authenticator-hosted Ed25519), 959or 960.Pa ~/.ssh/id_rsa.pub 961(RSA) 962in the user's home directory. 963The user should then copy the public key 964to 965.Pa ~/.ssh/authorized_keys 966in their home directory on the remote machine. 967The 968.Pa authorized_keys 969file corresponds to the conventional 970.Pa ~/.rhosts 971file, and has one key 972per line, though the lines can be very long. 973After this, the user can log in without giving the password. 974.Pp 975A variation on public key authentication 976is available in the form of certificate authentication: 977instead of a set of public/private keys, 978signed certificates are used. 979This has the advantage that a single trusted certification authority 980can be used in place of many public/private keys. 981See the CERTIFICATES section of 982.Xr ssh-keygen 1 983for more information. 984.Pp 985The most convenient way to use public key or certificate authentication 986may be with an authentication agent. 987See 988.Xr ssh-agent 1 989and (optionally) the 990.Cm AddKeysToAgent 991directive in 992.Xr ssh_config 5 993for more information. 994.Pp 995Keyboard-interactive authentication works as follows: 996The server sends an arbitrary 997.Qq challenge 998text and prompts for a response, possibly multiple times. 999Examples of keyboard-interactive authentication include 1000.Bx 1001Authentication (see 1002.Xr login.conf 5 ) 1003and PAM (some 1004.Pf non- Ox 1005systems). 1006.Pp 1007Finally, if other authentication methods fail, 1008.Nm 1009prompts the user for a password. 1010The password is sent to the remote 1011host for checking; however, since all communications are encrypted, 1012the password cannot be seen by someone listening on the network. 1013.Pp 1014.Nm 1015automatically maintains and checks a database containing 1016identification for all hosts it has ever been used with. 1017Host keys are stored in 1018.Pa ~/.ssh/known_hosts 1019in the user's home directory. 1020Additionally, the file 1021.Pa /etc/ssh/ssh_known_hosts 1022is automatically checked for known hosts. 1023Any new hosts are automatically added to the user's file. 1024If a host's identification ever changes, 1025.Nm 1026warns about this and disables password authentication to prevent 1027server spoofing or man-in-the-middle attacks, 1028which could otherwise be used to circumvent the encryption. 1029The 1030.Cm StrictHostKeyChecking 1031option can be used to control logins to machines whose 1032host key is not known or has changed. 1033.Pp 1034When the user's identity has been accepted by the server, the server 1035either executes the given command in a non-interactive session or, 1036if no command has been specified, logs into the machine and gives 1037the user a normal shell as an interactive session. 1038All communication with 1039the remote command or shell will be automatically encrypted. 1040.Pp 1041If an interactive session is requested 1042.Nm 1043by default will only request a pseudo-terminal (pty) for interactive 1044sessions when the client has one. 1045The flags 1046.Fl T 1047and 1048.Fl t 1049can be used to override this behaviour. 1050.Pp 1051If a pseudo-terminal has been allocated the 1052user may use the escape characters noted below. 1053.Pp 1054If no pseudo-terminal has been allocated, 1055the session is transparent and can be used to reliably transfer binary data. 1056On most systems, setting the escape character to 1057.Dq none 1058will also make the session transparent even if a tty is used. 1059.Pp 1060The session terminates when the command or shell on the remote 1061machine exits and all X11 and TCP connections have been closed. 1062.Sh ESCAPE CHARACTERS 1063When a pseudo-terminal has been requested, 1064.Nm 1065supports a number of functions through the use of an escape character. 1066.Pp 1067A single tilde character can be sent as 1068.Ic ~~ 1069or by following the tilde by a character other than those described below. 1070The escape character must always follow a newline to be interpreted as 1071special. 1072The escape character can be changed in configuration files using the 1073.Cm EscapeChar 1074configuration directive or on the command line by the 1075.Fl e 1076option. 1077.Pp 1078The supported escapes (assuming the default 1079.Ql ~ ) 1080are: 1081.Bl -tag -width Ds 1082.It Cm ~. 1083Disconnect. 1084.It Cm ~^Z 1085Background 1086.Nm . 1087.It Cm ~# 1088List forwarded connections. 1089.It Cm ~& 1090Background 1091.Nm 1092at logout when waiting for forwarded connection / X11 sessions to terminate. 1093.It Cm ~? 1094Display a list of escape characters. 1095.It Cm ~B 1096Send a BREAK to the remote system 1097(only useful if the peer supports it). 1098.It Cm ~C 1099Open command line. 1100Currently this allows the addition of port forwardings using the 1101.Fl L , 1102.Fl R 1103and 1104.Fl D 1105options (see above). 1106It also allows the cancellation of existing port-forwardings 1107with 1108.Sm off 1109.Fl KL Oo Ar bind_address : Oc Ar port 1110.Sm on 1111for local, 1112.Sm off 1113.Fl KR Oo Ar bind_address : Oc Ar port 1114.Sm on 1115for remote and 1116.Sm off 1117.Fl KD Oo Ar bind_address : Oc Ar port 1118.Sm on 1119for dynamic port-forwardings. 1120.Ic !\& Ns Ar command 1121allows the user to execute a local command if the 1122.Ic PermitLocalCommand 1123option is enabled in 1124.Xr ssh_config 5 . 1125Basic help is available, using the 1126.Fl h 1127option. 1128.It Cm ~R 1129Request rekeying of the connection 1130(only useful if the peer supports it). 1131.It Cm ~V 1132Decrease the verbosity 1133.Pq Ic LogLevel 1134when errors are being written to stderr. 1135.It Cm ~v 1136Increase the verbosity 1137.Pq Ic LogLevel 1138when errors are being written to stderr. 1139.El 1140.Sh TCP FORWARDING 1141Forwarding of arbitrary TCP connections over a secure channel 1142can be specified either on the command line or in a configuration file. 1143One possible application of TCP forwarding is a secure connection to a 1144mail server; another is going through firewalls. 1145.Pp 1146In the example below, we look at encrypting communication for an IRC client, 1147even though the IRC server it connects to does not directly 1148support encrypted communication. 1149This works as follows: 1150the user connects to the remote host using 1151.Nm , 1152specifying the ports to be used to forward the connection. 1153After that it is possible to start the program locally, 1154and 1155.Nm 1156will encrypt and forward the connection to the remote server. 1157.Pp 1158The following example tunnels an IRC session from the client 1159to an IRC server at 1160.Dq server.example.com , 1161joining channel 1162.Dq #users , 1163nickname 1164.Dq pinky , 1165using the standard IRC port, 6667: 1166.Bd -literal -offset 4n 1167$ ssh -f -L 6667:localhost:6667 server.example.com sleep 10 1168$ irc -c '#users' pinky IRC/127.0.0.1 1169.Ed 1170.Pp 1171The 1172.Fl f 1173option backgrounds 1174.Nm 1175and the remote command 1176.Dq sleep 10 1177is specified to allow an amount of time 1178(10 seconds, in the example) 1179to start the program which is going to use the tunnel. 1180If no connections are made within the time specified, 1181.Nm 1182will exit. 1183.Sh X11 FORWARDING 1184If the 1185.Cm ForwardX11 1186variable is set to 1187.Dq yes 1188(or see the description of the 1189.Fl X , 1190.Fl x , 1191and 1192.Fl Y 1193options above) 1194and the user is using X11 (the 1195.Ev DISPLAY 1196environment variable is set), the connection to the X11 display is 1197automatically forwarded to the remote side in such a way that any X11 1198programs started from the shell (or command) will go through the 1199encrypted channel, and the connection to the real X server will be made 1200from the local machine. 1201The user should not manually set 1202.Ev DISPLAY . 1203Forwarding of X11 connections can be 1204configured on the command line or in configuration files. 1205.Pp 1206The 1207.Ev DISPLAY 1208value set by 1209.Nm 1210will point to the server machine, but with a display number greater than zero. 1211This is normal, and happens because 1212.Nm 1213creates a 1214.Dq proxy 1215X server on the server machine for forwarding the 1216connections over the encrypted channel. 1217.Pp 1218.Nm 1219will also automatically set up Xauthority data on the server machine. 1220For this purpose, it will generate a random authorization cookie, 1221store it in Xauthority on the server, and verify that any forwarded 1222connections carry this cookie and replace it by the real cookie when 1223the connection is opened. 1224The real authentication cookie is never 1225sent to the server machine (and no cookies are sent in the plain). 1226.Pp 1227If the 1228.Cm ForwardAgent 1229variable is set to 1230.Dq yes 1231(or see the description of the 1232.Fl A 1233and 1234.Fl a 1235options above) and 1236the user is using an authentication agent, the connection to the agent 1237is automatically forwarded to the remote side. 1238.Sh VERIFYING HOST KEYS 1239When connecting to a server for the first time, 1240a fingerprint of the server's public key is presented to the user 1241(unless the option 1242.Cm StrictHostKeyChecking 1243has been disabled). 1244Fingerprints can be determined using 1245.Xr ssh-keygen 1 : 1246.Pp 1247.Dl $ ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key 1248.Pp 1249If the fingerprint is already known, it can be matched 1250and the key can be accepted or rejected. 1251If only legacy (MD5) fingerprints for the server are available, the 1252.Xr ssh-keygen 1 1253.Fl E 1254option may be used to downgrade the fingerprint algorithm to match. 1255.Pp 1256Because of the difficulty of comparing host keys 1257just by looking at fingerprint strings, 1258there is also support to compare host keys visually, 1259using 1260.Em random art . 1261By setting the 1262.Cm VisualHostKey 1263option to 1264.Dq yes , 1265a small ASCII graphic gets displayed on every login to a server, no matter 1266if the session itself is interactive or not. 1267By learning the pattern a known server produces, a user can easily 1268find out that the host key has changed when a completely different pattern 1269is displayed. 1270Because these patterns are not unambiguous however, a pattern that looks 1271similar to the pattern remembered only gives a good probability that the 1272host key is the same, not guaranteed proof. 1273.Pp 1274To get a listing of the fingerprints along with their random art for 1275all known hosts, the following command line can be used: 1276.Pp 1277.Dl $ ssh-keygen -lv -f ~/.ssh/known_hosts 1278.Pp 1279If the fingerprint is unknown, 1280an alternative method of verification is available: 1281SSH fingerprints verified by DNS. 1282An additional resource record (RR), 1283SSHFP, 1284is added to a zonefile 1285and the connecting client is able to match the fingerprint 1286with that of the key presented. 1287.Pp 1288In this example, we are connecting a client to a server, 1289.Dq host.example.com . 1290The SSHFP resource records should first be added to the zonefile for 1291host.example.com: 1292.Bd -literal -offset indent 1293$ ssh-keygen -r host.example.com. 1294.Ed 1295.Pp 1296The output lines will have to be added to the zonefile. 1297To check that the zone is answering fingerprint queries: 1298.Pp 1299.Dl $ dig -t SSHFP host.example.com 1300.Pp 1301Finally the client connects: 1302.Bd -literal -offset indent 1303$ ssh -o "VerifyHostKeyDNS ask" host.example.com 1304[...] 1305Matching host key fingerprint found in DNS. 1306Are you sure you want to continue connecting (yes/no)? 1307.Ed 1308.Pp 1309See the 1310.Cm VerifyHostKeyDNS 1311option in 1312.Xr ssh_config 5 1313for more information. 1314.Sh SSH-BASED VIRTUAL PRIVATE NETWORKS 1315.Nm 1316contains support for Virtual Private Network (VPN) tunnelling 1317using the 1318.Xr tun 4 1319network pseudo-device, 1320allowing two networks to be joined securely. 1321The 1322.Xr sshd_config 5 1323configuration option 1324.Cm PermitTunnel 1325controls whether the server supports this, 1326and at what level (layer 2 or 3 traffic). 1327.Pp 1328The following example would connect client network 10.0.50.0/24 1329with remote network 10.0.99.0/24 using a point-to-point connection 1330from 10.1.1.1 to 10.1.1.2, 1331provided that the SSH server running on the gateway to the remote network, 1332at 192.168.1.15, allows it. 1333.Pp 1334On the client: 1335.Bd -literal -offset indent 1336# ssh -f -w 0:1 192.168.1.15 true 1337# ifconfig tun0 10.1.1.1 10.1.1.2 netmask 255.255.255.252 1338# route add 10.0.99.0/24 10.1.1.2 1339.Ed 1340.Pp 1341On the server: 1342.Bd -literal -offset indent 1343# ifconfig tun1 10.1.1.2 10.1.1.1 netmask 255.255.255.252 1344# route add 10.0.50.0/24 10.1.1.1 1345.Ed 1346.Pp 1347Client access may be more finely tuned via the 1348.Pa /root/.ssh/authorized_keys 1349file (see below) and the 1350.Cm PermitRootLogin 1351server option. 1352The following entry would permit connections on 1353.Xr tun 4 1354device 1 from user 1355.Dq jane 1356and on tun device 2 from user 1357.Dq john , 1358if 1359.Cm PermitRootLogin 1360is set to 1361.Dq forced-commands-only : 1362.Bd -literal -offset 2n 1363tunnel="1",command="sh /etc/netstart tun1" ssh-rsa ... jane 1364tunnel="2",command="sh /etc/netstart tun2" ssh-rsa ... john 1365.Ed 1366.Pp 1367Since an SSH-based setup entails a fair amount of overhead, 1368it may be more suited to temporary setups, 1369such as for wireless VPNs. 1370More permanent VPNs are better provided by tools such as 1371.Xr ipsecctl 8 1372and 1373.Xr isakmpd 8 . 1374.Sh ENVIRONMENT 1375.Nm 1376will normally set the following environment variables: 1377.Bl -tag -width "SSH_ORIGINAL_COMMAND" 1378.It Ev DISPLAY 1379The 1380.Ev DISPLAY 1381variable indicates the location of the X11 server. 1382It is automatically set by 1383.Nm 1384to point to a value of the form 1385.Dq hostname:n , 1386where 1387.Dq hostname 1388indicates the host where the shell runs, and 1389.Sq n 1390is an integer \*(Ge 1. 1391.Nm 1392uses this special value to forward X11 connections over the secure 1393channel. 1394The user should normally not set 1395.Ev DISPLAY 1396explicitly, as that 1397will render the X11 connection insecure (and will require the user to 1398manually copy any required authorization cookies). 1399.It Ev HOME 1400Set to the path of the user's home directory. 1401.It Ev LOGNAME 1402Synonym for 1403.Ev USER ; 1404set for compatibility with systems that use this variable. 1405.It Ev MAIL 1406Set to the path of the user's mailbox. 1407.It Ev PATH 1408Set to the default 1409.Ev PATH , 1410as specified when compiling 1411.Nm . 1412.It Ev SSH_ASKPASS 1413If 1414.Nm 1415needs a passphrase, it will read the passphrase from the current 1416terminal if it was run from a terminal. 1417If 1418.Nm 1419does not have a terminal associated with it but 1420.Ev DISPLAY 1421and 1422.Ev SSH_ASKPASS 1423are set, it will execute the program specified by 1424.Ev SSH_ASKPASS 1425and open an X11 window to read the passphrase. 1426This is particularly useful when calling 1427.Nm 1428from a 1429.Pa .xsession 1430or related script. 1431(Note that on some machines it 1432may be necessary to redirect the input from 1433.Pa /dev/null 1434to make this work.) 1435.It Ev SSH_ASKPASS_REQUIRE 1436Allows further control over the use of an askpass program. 1437If this variable is set to 1438.Dq never 1439then 1440.Nm 1441will never attempt to use one. 1442If it is set to 1443.Dq prefer , 1444then 1445.Nm 1446will prefer to use the askpass program instead of the TTY when requesting 1447passwords. 1448Finally, if the variable is set to 1449.Dq force , 1450then the askpass program will be used for all passphrase input regardless 1451of whether 1452.Ev DISPLAY 1453is set. 1454.It Ev SSH_AUTH_SOCK 1455Identifies the path of a 1456.Ux Ns -domain 1457socket used to communicate with the agent. 1458.It Ev SSH_CONNECTION 1459Identifies the client and server ends of the connection. 1460The variable contains 1461four space-separated values: client IP address, client port number, 1462server IP address, and server port number. 1463.It Ev SSH_ORIGINAL_COMMAND 1464This variable contains the original command line if a forced command 1465is executed. 1466It can be used to extract the original arguments. 1467.It Ev SSH_TTY 1468This is set to the name of the tty (path to the device) associated 1469with the current shell or command. 1470If the current session has no tty, 1471this variable is not set. 1472.It Ev SSH_TUNNEL 1473Optionally set by 1474.Xr sshd 8 1475to contain the interface names assigned if tunnel forwarding was 1476requested by the client. 1477.It Ev SSH_USER_AUTH 1478Optionally set by 1479.Xr sshd 8 , 1480this variable may contain a pathname to a file that lists the authentication 1481methods successfully used when the session was established, including any 1482public keys that were used. 1483.It Ev TZ 1484This variable is set to indicate the present time zone if it 1485was set when the daemon was started (i.e. the daemon passes the value 1486on to new connections). 1487.It Ev USER 1488Set to the name of the user logging in. 1489.El 1490.Pp 1491Additionally, 1492.Nm 1493reads 1494.Pa ~/.ssh/environment , 1495and adds lines of the format 1496.Dq VARNAME=value 1497to the environment if the file exists and users are allowed to 1498change their environment. 1499For more information, see the 1500.Cm PermitUserEnvironment 1501option in 1502.Xr sshd_config 5 . 1503.Sh FILES 1504.Bl -tag -width Ds -compact 1505.It Pa ~/.rhosts 1506This file is used for host-based authentication (see above). 1507On some machines this file may need to be 1508world-readable if the user's home directory is on an NFS partition, 1509because 1510.Xr sshd 8 1511reads it as root. 1512Additionally, this file must be owned by the user, 1513and must not have write permissions for anyone else. 1514The recommended 1515permission for most machines is read/write for the user, and not 1516accessible by others. 1517.Pp 1518.It Pa ~/.shosts 1519This file is used in exactly the same way as 1520.Pa .rhosts , 1521but allows host-based authentication without permitting login with 1522rlogin/rsh. 1523.Pp 1524.It Pa ~/.ssh/ 1525This directory is the default location for all user-specific configuration 1526and authentication information. 1527There is no general requirement to keep the entire contents of this directory 1528secret, but the recommended permissions are read/write/execute for the user, 1529and not accessible by others. 1530.Pp 1531.It Pa ~/.ssh/authorized_keys 1532Lists the public keys (DSA, ECDSA, Ed25519, RSA) 1533that can be used for logging in as this user. 1534The format of this file is described in the 1535.Xr sshd 8 1536manual page. 1537This file is not highly sensitive, but the recommended 1538permissions are read/write for the user, and not accessible by others. 1539.Pp 1540.It Pa ~/.ssh/config 1541This is the per-user configuration file. 1542The file format and configuration options are described in 1543.Xr ssh_config 5 . 1544Because of the potential for abuse, this file must have strict permissions: 1545read/write for the user, and not writable by others. 1546.Pp 1547.It Pa ~/.ssh/environment 1548Contains additional definitions for environment variables; see 1549.Sx ENVIRONMENT , 1550above. 1551.Pp 1552.It Pa ~/.ssh/id_dsa 1553.It Pa ~/.ssh/id_ecdsa 1554.It Pa ~/.ssh/id_ecdsa_sk 1555.It Pa ~/.ssh/id_ed25519 1556.It Pa ~/.ssh/id_ed25519_sk 1557.It Pa ~/.ssh/id_rsa 1558Contains the private key for authentication. 1559These files 1560contain sensitive data and should be readable by the user but not 1561accessible by others (read/write/execute). 1562.Nm 1563will simply ignore a private key file if it is accessible by others. 1564It is possible to specify a passphrase when 1565generating the key which will be used to encrypt the 1566sensitive part of this file using AES-128. 1567.Pp 1568.It Pa ~/.ssh/id_dsa.pub 1569.It Pa ~/.ssh/id_ecdsa.pub 1570.It Pa ~/.ssh/id_ecdsa_sk.pub 1571.It Pa ~/.ssh/id_ed25519.pub 1572.It Pa ~/.ssh/id_ed25519_sk.pub 1573.It Pa ~/.ssh/id_rsa.pub 1574Contains the public key for authentication. 1575These files are not 1576sensitive and can (but need not) be readable by anyone. 1577.Pp 1578.It Pa ~/.ssh/known_hosts 1579Contains a list of host keys for all hosts the user has logged into 1580that are not already in the systemwide list of known host keys. 1581See 1582.Xr sshd 8 1583for further details of the format of this file. 1584.Pp 1585.It Pa ~/.ssh/rc 1586Commands in this file are executed by 1587.Nm 1588when the user logs in, just before the user's shell (or command) is 1589started. 1590See the 1591.Xr sshd 8 1592manual page for more information. 1593.Pp 1594.It Pa /etc/hosts.equiv 1595This file is for host-based authentication (see above). 1596It should only be writable by root. 1597.Pp 1598.It Pa /etc/shosts.equiv 1599This file is used in exactly the same way as 1600.Pa hosts.equiv , 1601but allows host-based authentication without permitting login with 1602rlogin/rsh. 1603.Pp 1604.It Pa /etc/ssh/ssh_config 1605Systemwide configuration file. 1606The file format and configuration options are described in 1607.Xr ssh_config 5 . 1608.Pp 1609.It Pa /etc/ssh/ssh_host_key 1610.It Pa /etc/ssh/ssh_host_dsa_key 1611.It Pa /etc/ssh/ssh_host_ecdsa_key 1612.It Pa /etc/ssh/ssh_host_ed25519_key 1613.It Pa /etc/ssh/ssh_host_rsa_key 1614These files contain the private parts of the host keys 1615and are used for host-based authentication. 1616.Pp 1617.It Pa /etc/ssh/ssh_known_hosts 1618Systemwide list of known host keys. 1619This file should be prepared by the 1620system administrator to contain the public host keys of all machines in the 1621organization. 1622It should be world-readable. 1623See 1624.Xr sshd 8 1625for further details of the format of this file. 1626.Pp 1627.It Pa /etc/ssh/sshrc 1628Commands in this file are executed by 1629.Nm 1630when the user logs in, just before the user's shell (or command) is started. 1631See the 1632.Xr sshd 8 1633manual page for more information. 1634.El 1635.Sh EXIT STATUS 1636.Nm 1637exits with the exit status of the remote command or with 255 1638if an error occurred. 1639.Sh SEE ALSO 1640.Xr scp 1 , 1641.Xr sftp 1 , 1642.Xr ssh-add 1 , 1643.Xr ssh-agent 1 , 1644.Xr ssh-keygen 1 , 1645.Xr ssh-keyscan 1 , 1646.Xr tun 4 , 1647.Xr ssh_config 5 , 1648.Xr ssh-keysign 8 , 1649.Xr sshd 8 1650.Sh STANDARDS 1651.Rs 1652.%A S. Lehtinen 1653.%A C. Lonvick 1654.%D January 2006 1655.%R RFC 4250 1656.%T The Secure Shell (SSH) Protocol Assigned Numbers 1657.Re 1658.Pp 1659.Rs 1660.%A T. Ylonen 1661.%A C. Lonvick 1662.%D January 2006 1663.%R RFC 4251 1664.%T The Secure Shell (SSH) Protocol Architecture 1665.Re 1666.Pp 1667.Rs 1668.%A T. Ylonen 1669.%A C. Lonvick 1670.%D January 2006 1671.%R RFC 4252 1672.%T The Secure Shell (SSH) Authentication Protocol 1673.Re 1674.Pp 1675.Rs 1676.%A T. Ylonen 1677.%A C. Lonvick 1678.%D January 2006 1679.%R RFC 4253 1680.%T The Secure Shell (SSH) Transport Layer Protocol 1681.Re 1682.Pp 1683.Rs 1684.%A T. Ylonen 1685.%A C. Lonvick 1686.%D January 2006 1687.%R RFC 4254 1688.%T The Secure Shell (SSH) Connection Protocol 1689.Re 1690.Pp 1691.Rs 1692.%A J. Schlyter 1693.%A W. Griffin 1694.%D January 2006 1695.%R RFC 4255 1696.%T Using DNS to Securely Publish Secure Shell (SSH) Key Fingerprints 1697.Re 1698.Pp 1699.Rs 1700.%A F. Cusack 1701.%A M. Forssen 1702.%D January 2006 1703.%R RFC 4256 1704.%T Generic Message Exchange Authentication for the Secure Shell Protocol (SSH) 1705.Re 1706.Pp 1707.Rs 1708.%A J. Galbraith 1709.%A P. Remaker 1710.%D January 2006 1711.%R RFC 4335 1712.%T The Secure Shell (SSH) Session Channel Break Extension 1713.Re 1714.Pp 1715.Rs 1716.%A M. Bellare 1717.%A T. Kohno 1718.%A C. Namprempre 1719.%D January 2006 1720.%R RFC 4344 1721.%T The Secure Shell (SSH) Transport Layer Encryption Modes 1722.Re 1723.Pp 1724.Rs 1725.%A B. Harris 1726.%D January 2006 1727.%R RFC 4345 1728.%T Improved Arcfour Modes for the Secure Shell (SSH) Transport Layer Protocol 1729.Re 1730.Pp 1731.Rs 1732.%A M. Friedl 1733.%A N. Provos 1734.%A W. Simpson 1735.%D March 2006 1736.%R RFC 4419 1737.%T Diffie-Hellman Group Exchange for the Secure Shell (SSH) Transport Layer Protocol 1738.Re 1739.Pp 1740.Rs 1741.%A J. Galbraith 1742.%A R. Thayer 1743.%D November 2006 1744.%R RFC 4716 1745.%T The Secure Shell (SSH) Public Key File Format 1746.Re 1747.Pp 1748.Rs 1749.%A D. Stebila 1750.%A J. Green 1751.%D December 2009 1752.%R RFC 5656 1753.%T Elliptic Curve Algorithm Integration in the Secure Shell Transport Layer 1754.Re 1755.Pp 1756.Rs 1757.%A A. Perrig 1758.%A D. Song 1759.%D 1999 1760.%O International Workshop on Cryptographic Techniques and E-Commerce (CrypTEC '99) 1761.%T Hash Visualization: a New Technique to improve Real-World Security 1762.Re 1763.Sh AUTHORS 1764OpenSSH is a derivative of the original and free 1765ssh 1.2.12 release by Tatu Ylonen. 1766Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, 1767Theo de Raadt and Dug Song 1768removed many bugs, re-added newer features and 1769created OpenSSH. 1770Markus Friedl contributed the support for SSH 1771protocol versions 1.5 and 2.0. 1772