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