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