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_config.5,v 1.161 2013/01/08 18:49:04 markus Exp $ 37.\" $FreeBSD$ 38.Dd January 8, 2013 39.Dt SSH_CONFIG 5 40.Os 41.Sh NAME 42.Nm ssh_config 43.Nd OpenSSH SSH client configuration files 44.Sh SYNOPSIS 45.Nm ~/.ssh/config 46.Nm /etc/ssh/ssh_config 47.Sh DESCRIPTION 48.Xr ssh 1 49obtains configuration data from the following sources in 50the following order: 51.Pp 52.Bl -enum -offset indent -compact 53.It 54command-line options 55.It 56user's configuration file 57.Pq Pa ~/.ssh/config 58.It 59system-wide configuration file 60.Pq Pa /etc/ssh/ssh_config 61.El 62.Pp 63For each parameter, the first obtained value 64will be used. 65The configuration files contain sections separated by 66.Dq Host 67specifications, and that section is only applied for hosts that 68match one of the patterns given in the specification. 69The matched host name is the one given on the command line. 70.Pp 71Since the first obtained value for each parameter is used, more 72host-specific declarations should be given near the beginning of the 73file, and general defaults at the end. 74.Pp 75The configuration file has the following format: 76.Pp 77Empty lines and lines starting with 78.Ql # 79are comments. 80Otherwise a line is of the format 81.Dq keyword arguments . 82Configuration options may be separated by whitespace or 83optional whitespace and exactly one 84.Ql = ; 85the latter format is useful to avoid the need to quote whitespace 86when specifying configuration options using the 87.Nm ssh , 88.Nm scp , 89and 90.Nm sftp 91.Fl o 92option. 93Arguments may optionally be enclosed in double quotes 94.Pq \&" 95in order to represent arguments containing spaces. 96.Pp 97The possible 98keywords and their meanings are as follows (note that 99keywords are case-insensitive and arguments are case-sensitive): 100.Bl -tag -width Ds 101.It Cm Host 102Restricts the following declarations (up to the next 103.Cm Host 104keyword) to be only for those hosts that match one of the patterns 105given after the keyword. 106If more than one pattern is provided, they should be separated by whitespace. 107A single 108.Ql * 109as a pattern can be used to provide global 110defaults for all hosts. 111The host is the 112.Ar hostname 113argument given on the command line (i.e. the name is not converted to 114a canonicalized host name before matching). 115.Pp 116A pattern entry may be negated by prefixing it with an exclamation mark 117.Pq Sq !\& . 118If a negated entry is matched, then the 119.Cm Host 120entry is ignored, regardless of whether any other patterns on the line 121match. 122Negated matches are therefore useful to provide exceptions for wildcard 123matches. 124.Pp 125See 126.Sx PATTERNS 127for more information on patterns. 128.It Cm AddressFamily 129Specifies which address family to use when connecting. 130Valid arguments are 131.Dq any , 132.Dq inet 133(use IPv4 only), or 134.Dq inet6 135(use IPv6 only). 136.It Cm BatchMode 137If set to 138.Dq yes , 139passphrase/password querying will be disabled. 140This option is useful in scripts and other batch jobs where no user 141is present to supply the password. 142The argument must be 143.Dq yes 144or 145.Dq no . 146The default is 147.Dq no . 148.It Cm BindAddress 149Use the specified address on the local machine as the source address of 150the connection. 151Only useful on systems with more than one address. 152Note that this option does not work if 153.Cm UsePrivilegedPort 154is set to 155.Dq yes . 156.It Cm ChallengeResponseAuthentication 157Specifies whether to use challenge-response authentication. 158The argument to this keyword must be 159.Dq yes 160or 161.Dq no . 162The default is 163.Dq yes . 164.It Cm CheckHostIP 165If this flag is set to 166.Dq yes , 167.Xr ssh 1 168will additionally check the host IP address in the 169.Pa known_hosts 170file. 171This allows ssh to detect if a host key changed due to DNS spoofing. 172If the option is set to 173.Dq no , 174the check will not be executed. 175The default is 176.Dq no . 177.It Cm Cipher 178Specifies the cipher to use for encrypting the session 179in protocol version 1. 180Currently, 181.Dq blowfish , 182.Dq 3des , 183and 184.Dq des 185are supported. 186.Ar des 187is only supported in the 188.Xr ssh 1 189client for interoperability with legacy protocol 1 implementations 190that do not support the 191.Ar 3des 192cipher. 193Its use is strongly discouraged due to cryptographic weaknesses. 194The default is 195.Dq 3des . 196.It Cm Ciphers 197Specifies the ciphers allowed for protocol version 2 198in order of preference. 199Multiple ciphers must be comma-separated. 200The supported ciphers are 201.Dq 3des-cbc , 202.Dq aes128-cbc , 203.Dq aes192-cbc , 204.Dq aes256-cbc , 205.Dq aes128-ctr , 206.Dq aes192-ctr , 207.Dq aes256-ctr , 208.Dq aes128-gcm@openssh.com , 209.Dq aes256-gcm@openssh.com , 210.Dq arcfour128 , 211.Dq arcfour256 , 212.Dq arcfour , 213.Dq blowfish-cbc , 214and 215.Dq cast128-cbc . 216The default is: 217.Bd -literal -offset 3n 218aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128, 219aes128-gcm@openssh.com,aes256-gcm@openssh.com, 220aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc, 221aes256-cbc,arcfour 222.Ed 223.It Cm ClearAllForwardings 224Specifies that all local, remote, and dynamic port forwardings 225specified in the configuration files or on the command line be 226cleared. 227This option is primarily useful when used from the 228.Xr ssh 1 229command line to clear port forwardings set in 230configuration files, and is automatically set by 231.Xr scp 1 232and 233.Xr sftp 1 . 234The argument must be 235.Dq yes 236or 237.Dq no . 238The default is 239.Dq no . 240.It Cm Compression 241Specifies whether to use compression. 242The argument must be 243.Dq yes 244or 245.Dq no . 246The default is 247.Dq no . 248.It Cm CompressionLevel 249Specifies the compression level to use if compression is enabled. 250The argument must be an integer from 1 (fast) to 9 (slow, best). 251The default level is 6, which is good for most applications. 252The meaning of the values is the same as in 253.Xr gzip 1 . 254Note that this option applies to protocol version 1 only. 255.It Cm ConnectionAttempts 256Specifies the number of tries (one per second) to make before exiting. 257The argument must be an integer. 258This may be useful in scripts if the connection sometimes fails. 259The default is 1. 260.It Cm ConnectTimeout 261Specifies the timeout (in seconds) used when connecting to the 262SSH server, instead of using the default system TCP timeout. 263This value is used only when the target is down or really unreachable, 264not when it refuses the connection. 265.It Cm ControlMaster 266Enables the sharing of multiple sessions over a single network connection. 267When set to 268.Dq yes , 269.Xr ssh 1 270will listen for connections on a control socket specified using the 271.Cm ControlPath 272argument. 273Additional sessions can connect to this socket using the same 274.Cm ControlPath 275with 276.Cm ControlMaster 277set to 278.Dq no 279(the default). 280These sessions will try to reuse the master instance's network connection 281rather than initiating new ones, but will fall back to connecting normally 282if the control socket does not exist, or is not listening. 283.Pp 284Setting this to 285.Dq ask 286will cause ssh 287to listen for control connections, but require confirmation using the 288.Ev SSH_ASKPASS 289program before they are accepted (see 290.Xr ssh-add 1 291for details). 292If the 293.Cm ControlPath 294cannot be opened, 295ssh will continue without connecting to a master instance. 296.Pp 297X11 and 298.Xr ssh-agent 1 299forwarding is supported over these multiplexed connections, however the 300display and agent forwarded will be the one belonging to the master 301connection i.e. it is not possible to forward multiple displays or agents. 302.Pp 303Two additional options allow for opportunistic multiplexing: try to use a 304master connection but fall back to creating a new one if one does not already 305exist. 306These options are: 307.Dq auto 308and 309.Dq autoask . 310The latter requires confirmation like the 311.Dq ask 312option. 313.It Cm ControlPath 314Specify the path to the control socket used for connection sharing as described 315in the 316.Cm ControlMaster 317section above or the string 318.Dq none 319to disable connection sharing. 320In the path, 321.Ql %L 322will be substituted by the first component of the local host name, 323.Ql %l 324will be substituted by the local host name (including any domain name), 325.Ql %h 326will be substituted by the target host name, 327.Ql %n 328will be substituted by the original target host name 329specified on the command line, 330.Ql %p 331the port, 332.Ql %r 333by the remote login username, and 334.Ql %u 335by the username of the user running 336.Xr ssh 1 . 337It is recommended that any 338.Cm ControlPath 339used for opportunistic connection sharing include 340at least %h, %p, and %r. 341This ensures that shared connections are uniquely identified. 342.It Cm ControlPersist 343When used in conjunction with 344.Cm ControlMaster , 345specifies that the master connection should remain open 346in the background (waiting for future client connections) 347after the initial client connection has been closed. 348If set to 349.Dq no , 350then the master connection will not be placed into the background, 351and will close as soon as the initial client connection is closed. 352If set to 353.Dq yes , 354then the master connection will remain in the background indefinitely 355(until killed or closed via a mechanism such as the 356.Xr ssh 1 357.Dq Fl O No exit 358option). 359If set to a time in seconds, or a time in any of the formats documented in 360.Xr sshd_config 5 , 361then the backgrounded master connection will automatically terminate 362after it has remained idle (with no client connections) for the 363specified time. 364.It Cm DynamicForward 365Specifies that a TCP port on the local machine be forwarded 366over the secure channel, and the application 367protocol is then used to determine where to connect to from the 368remote machine. 369.Pp 370The argument must be 371.Sm off 372.Oo Ar bind_address : Oc Ar port . 373.Sm on 374IPv6 addresses can be specified by enclosing addresses in square brackets. 375By default, the local port is bound in accordance with the 376.Cm GatewayPorts 377setting. 378However, an explicit 379.Ar bind_address 380may be used to bind the connection to a specific address. 381The 382.Ar bind_address 383of 384.Dq localhost 385indicates that the listening port be bound for local use only, while an 386empty address or 387.Sq * 388indicates that the port should be available from all interfaces. 389.Pp 390Currently the SOCKS4 and SOCKS5 protocols are supported, and 391.Xr ssh 1 392will act as a SOCKS server. 393Multiple forwardings may be specified, and 394additional forwardings can be given on the command line. 395Only the superuser can forward privileged ports. 396.It Cm EnableSSHKeysign 397Setting this option to 398.Dq yes 399in the global client configuration file 400.Pa /etc/ssh/ssh_config 401enables the use of the helper program 402.Xr ssh-keysign 8 403during 404.Cm HostbasedAuthentication . 405The argument must be 406.Dq yes 407or 408.Dq no . 409The default is 410.Dq no . 411This option should be placed in the non-hostspecific section. 412See 413.Xr ssh-keysign 8 414for more information. 415.It Cm EscapeChar 416Sets the escape character (default: 417.Ql ~ ) . 418The escape character can also 419be set on the command line. 420The argument should be a single character, 421.Ql ^ 422followed by a letter, or 423.Dq none 424to disable the escape 425character entirely (making the connection transparent for binary 426data). 427.It Cm ExitOnForwardFailure 428Specifies whether 429.Xr ssh 1 430should terminate the connection if it cannot set up all requested 431dynamic, tunnel, local, and remote port forwardings. 432The argument must be 433.Dq yes 434or 435.Dq no . 436The default is 437.Dq no . 438.It Cm ForwardAgent 439Specifies whether the connection to the authentication agent (if any) 440will be forwarded to the remote machine. 441The argument must be 442.Dq yes 443or 444.Dq no . 445The default is 446.Dq no . 447.Pp 448Agent forwarding should be enabled with caution. 449Users with the ability to bypass file permissions on the remote host 450(for the agent's Unix-domain socket) 451can access the local agent through the forwarded connection. 452An attacker cannot obtain key material from the agent, 453however they can perform operations on the keys that enable them to 454authenticate using the identities loaded into the agent. 455.It Cm ForwardX11 456Specifies whether X11 connections will be automatically redirected 457over the secure channel and 458.Ev DISPLAY 459set. 460The argument must be 461.Dq yes 462or 463.Dq no . 464The default is 465.Dq no . 466.Pp 467X11 forwarding should be enabled with caution. 468Users with the ability to bypass file permissions on the remote host 469(for the user's X11 authorization database) 470can access the local X11 display through the forwarded connection. 471An attacker may then be able to perform activities such as keystroke monitoring 472if the 473.Cm ForwardX11Trusted 474option is also enabled. 475.It Cm ForwardX11Timeout 476Specify a timeout for untrusted X11 forwarding 477using the format described in the 478.Sx TIME FORMATS 479section of 480.Xr sshd_config 5 . 481X11 connections received by 482.Xr ssh 1 483after this time will be refused. 484The default is to disable untrusted X11 forwarding after twenty minutes has 485elapsed. 486.It Cm ForwardX11Trusted 487If this option is set to 488.Dq yes , 489remote X11 clients will have full access to the original X11 display. 490.Pp 491If this option is set to 492.Dq no , 493remote X11 clients will be considered untrusted and prevented 494from stealing or tampering with data belonging to trusted X11 495clients. 496Furthermore, the 497.Xr xauth 1 498token used for the session will be set to expire after 20 minutes. 499Remote clients will be refused access after this time. 500.Pp 501The default is 502.Dq no . 503.Pp 504See the X11 SECURITY extension specification for full details on 505the restrictions imposed on untrusted clients. 506.It Cm GatewayPorts 507Specifies whether remote hosts are allowed to connect to local 508forwarded ports. 509By default, 510.Xr ssh 1 511binds local port forwardings to the loopback address. 512This prevents other remote hosts from connecting to forwarded ports. 513.Cm GatewayPorts 514can be used to specify that ssh 515should bind local port forwardings to the wildcard address, 516thus allowing remote hosts to connect to forwarded ports. 517The argument must be 518.Dq yes 519or 520.Dq no . 521The default is 522.Dq no . 523.It Cm GlobalKnownHostsFile 524Specifies one or more files to use for the global 525host key database, separated by whitespace. 526The default is 527.Pa /etc/ssh/ssh_known_hosts , 528.Pa /etc/ssh/ssh_known_hosts2 . 529.It Cm GSSAPIAuthentication 530Specifies whether user authentication based on GSSAPI is allowed. 531The default is 532.Dq no . 533Note that this option applies to protocol version 2 only. 534.It Cm GSSAPIDelegateCredentials 535Forward (delegate) credentials to the server. 536The default is 537.Dq no . 538Note that this option applies to protocol version 2 only. 539.It Cm HashKnownHosts 540Indicates that 541.Xr ssh 1 542should hash host names and addresses when they are added to 543.Pa ~/.ssh/known_hosts . 544These hashed names may be used normally by 545.Xr ssh 1 546and 547.Xr sshd 8 , 548but they do not reveal identifying information should the file's contents 549be disclosed. 550The default is 551.Dq no . 552Note that existing names and addresses in known hosts files 553will not be converted automatically, 554but may be manually hashed using 555.Xr ssh-keygen 1 . 556.It Cm HostbasedAuthentication 557Specifies whether to try rhosts based authentication with public key 558authentication. 559The argument must be 560.Dq yes 561or 562.Dq no . 563The default is 564.Dq no . 565This option applies to protocol version 2 only and 566is similar to 567.Cm RhostsRSAAuthentication . 568.It Cm HostKeyAlgorithms 569Specifies the protocol version 2 host key algorithms 570that the client wants to use in order of preference. 571The default for this option is: 572.Bd -literal -offset 3n 573ecdsa-sha2-nistp256-cert-v01@openssh.com, 574ecdsa-sha2-nistp384-cert-v01@openssh.com, 575ecdsa-sha2-nistp521-cert-v01@openssh.com, 576ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com, 577ssh-rsa-cert-v00@openssh.com,ssh-dss-cert-v00@openssh.com, 578ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, 579ssh-rsa,ssh-dss 580.Ed 581.Pp 582If hostkeys are known for the destination host then this default is modified 583to prefer their algorithms. 584.It Cm HostKeyAlias 585Specifies an alias that should be used instead of the 586real host name when looking up or saving the host key 587in the host key database files. 588This option is useful for tunneling SSH connections 589or for multiple servers running on a single host. 590.It Cm HostName 591Specifies the real host name to log into. 592This can be used to specify nicknames or abbreviations for hosts. 593If the hostname contains the character sequence 594.Ql %h , 595then this will be replaced with the host name specified on the command line 596(this is useful for manipulating unqualified names). 597The default is the name given on the command line. 598Numeric IP addresses are also permitted (both on the command line and in 599.Cm HostName 600specifications). 601.It Cm IdentitiesOnly 602Specifies that 603.Xr ssh 1 604should only use the authentication identity files configured in the 605.Nm 606files, 607even if 608.Xr ssh-agent 1 609or a 610.Cm PKCS11Provider 611offers more identities. 612The argument to this keyword must be 613.Dq yes 614or 615.Dq no . 616This option is intended for situations where ssh-agent 617offers many different identities. 618The default is 619.Dq no . 620.It Cm IdentityFile 621Specifies a file from which the user's DSA, ECDSA or RSA authentication 622identity is read. 623The default is 624.Pa ~/.ssh/identity 625for protocol version 1, and 626.Pa ~/.ssh/id_dsa , 627.Pa ~/.ssh/id_ecdsa 628and 629.Pa ~/.ssh/id_rsa 630for protocol version 2. 631Additionally, any identities represented by the authentication agent 632will be used for authentication. 633.Xr ssh 1 634will try to load certificate information from the filename obtained by 635appending 636.Pa -cert.pub 637to the path of a specified 638.Cm IdentityFile . 639.Pp 640The file name may use the tilde 641syntax to refer to a user's home directory or one of the following 642escape characters: 643.Ql %d 644(local user's home directory), 645.Ql %u 646(local user name), 647.Ql %l 648(local host name), 649.Ql %h 650(remote host name) or 651.Ql %r 652(remote user name). 653.Pp 654It is possible to have 655multiple identity files specified in configuration files; all these 656identities will be tried in sequence. 657Multiple 658.Cm IdentityFile 659directives will add to the list of identities tried (this behaviour 660differs from that of other configuration directives). 661.It Cm IPQoS 662Specifies the IPv4 type-of-service or DSCP class for connections. 663Accepted values are 664.Dq af11 , 665.Dq af12 , 666.Dq af13 , 667.Dq af21 , 668.Dq af22 , 669.Dq af23 , 670.Dq af31 , 671.Dq af32 , 672.Dq af33 , 673.Dq af41 , 674.Dq af42 , 675.Dq af43 , 676.Dq cs0 , 677.Dq cs1 , 678.Dq cs2 , 679.Dq cs3 , 680.Dq cs4 , 681.Dq cs5 , 682.Dq cs6 , 683.Dq cs7 , 684.Dq ef , 685.Dq lowdelay , 686.Dq throughput , 687.Dq reliability , 688or a numeric value. 689This option may take one or two arguments, separated by whitespace. 690If one argument is specified, it is used as the packet class unconditionally. 691If two values are specified, the first is automatically selected for 692interactive sessions and the second for non-interactive sessions. 693The default is 694.Dq lowdelay 695for interactive sessions and 696.Dq throughput 697for non-interactive sessions. 698.It Cm KbdInteractiveAuthentication 699Specifies whether to use keyboard-interactive authentication. 700The argument to this keyword must be 701.Dq yes 702or 703.Dq no . 704The default is 705.Dq yes . 706.It Cm KbdInteractiveDevices 707Specifies the list of methods to use in keyboard-interactive authentication. 708Multiple method names must be comma-separated. 709The default is to use the server specified list. 710The methods available vary depending on what the server supports. 711For an OpenSSH server, 712it may be zero or more of: 713.Dq bsdauth , 714.Dq pam , 715and 716.Dq skey . 717.It Cm KexAlgorithms 718Specifies the available KEX (Key Exchange) algorithms. 719Multiple algorithms must be comma-separated. 720The default is: 721.Bd -literal -offset indent 722ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521, 723diffie-hellman-group-exchange-sha256, 724diffie-hellman-group-exchange-sha1, 725diffie-hellman-group14-sha1, 726diffie-hellman-group1-sha1 727.Ed 728.It Cm LocalCommand 729Specifies a command to execute on the local machine after successfully 730connecting to the server. 731The command string extends to the end of the line, and is executed with 732the user's shell. 733The following escape character substitutions will be performed: 734.Ql %d 735(local user's home directory), 736.Ql %h 737(remote host name), 738.Ql %l 739(local host name), 740.Ql %n 741(host name as provided on the command line), 742.Ql %p 743(remote port), 744.Ql %r 745(remote user name) or 746.Ql %u 747(local user name). 748.Pp 749The command is run synchronously and does not have access to the 750session of the 751.Xr ssh 1 752that spawned it. 753It should not be used for interactive commands. 754.Pp 755This directive is ignored unless 756.Cm PermitLocalCommand 757has been enabled. 758.It Cm LocalForward 759Specifies that a TCP port on the local machine be forwarded over 760the secure channel to the specified host and port from the remote machine. 761The first argument must be 762.Sm off 763.Oo Ar bind_address : Oc Ar port 764.Sm on 765and the second argument must be 766.Ar host : Ns Ar hostport . 767IPv6 addresses can be specified by enclosing addresses in square brackets. 768Multiple forwardings may be specified, and additional forwardings can be 769given on the command line. 770Only the superuser can forward privileged ports. 771By default, the local port is bound in accordance with the 772.Cm GatewayPorts 773setting. 774However, an explicit 775.Ar bind_address 776may be used to bind the connection to a specific address. 777The 778.Ar bind_address 779of 780.Dq localhost 781indicates that the listening port be bound for local use only, while an 782empty address or 783.Sq * 784indicates that the port should be available from all interfaces. 785.It Cm LogLevel 786Gives the verbosity level that is used when logging messages from 787.Xr ssh 1 . 788The possible values are: 789QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. 790The default is INFO. 791DEBUG and DEBUG1 are equivalent. 792DEBUG2 and DEBUG3 each specify higher levels of verbose output. 793.It Cm MACs 794Specifies the MAC (message authentication code) algorithms 795in order of preference. 796The MAC algorithm is used in protocol version 2 797for data integrity protection. 798Multiple algorithms must be comma-separated. 799The algorithms that contain 800.Dq -etm 801calculate the MAC after encryption (encrypt-then-mac). 802These are considered safer and their use recommended. 803The default is: 804.Bd -literal -offset indent 805hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com, 806umac-64-etm@openssh.com,umac-128-etm@openssh.com, 807hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com, 808hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com, 809hmac-md5-96-etm@openssh.com, 810hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com, 811hmac-sha2-256,hmac-sha2-512,hmac-ripemd160, 812hmac-sha1-96,hmac-md5-96 813.Ed 814.It Cm NoHostAuthenticationForLocalhost 815This option can be used if the home directory is shared across machines. 816In this case localhost will refer to a different machine on each of 817the machines and the user will get many warnings about changed host keys. 818However, this option disables host authentication for localhost. 819The argument to this keyword must be 820.Dq yes 821or 822.Dq no . 823The default is to check the host key for localhost. 824.It Cm NumberOfPasswordPrompts 825Specifies the number of password prompts before giving up. 826The argument to this keyword must be an integer. 827The default is 3. 828.It Cm PasswordAuthentication 829Specifies whether to use password authentication. 830The argument to this keyword must be 831.Dq yes 832or 833.Dq no . 834The default is 835.Dq yes . 836.It Cm PermitLocalCommand 837Allow local command execution via the 838.Ic LocalCommand 839option or using the 840.Ic !\& Ns Ar command 841escape sequence in 842.Xr ssh 1 . 843The argument must be 844.Dq yes 845or 846.Dq no . 847The default is 848.Dq no . 849.It Cm PKCS11Provider 850Specifies which PKCS#11 provider to use. 851The argument to this keyword is the PKCS#11 shared library 852.Xr ssh 1 853should use to communicate with a PKCS#11 token providing the user's 854private RSA key. 855.It Cm Port 856Specifies the port number to connect on the remote host. 857The default is 22. 858.It Cm PreferredAuthentications 859Specifies the order in which the client should try protocol 2 860authentication methods. 861This allows a client to prefer one method (e.g.\& 862.Cm keyboard-interactive ) 863over another method (e.g.\& 864.Cm password ) . 865The default is: 866.Bd -literal -offset indent 867gssapi-with-mic,hostbased,publickey, 868keyboard-interactive,password 869.Ed 870.It Cm Protocol 871Specifies the protocol versions 872.Xr ssh 1 873should support in order of preference. 874The possible values are 875.Sq 1 876and 877.Sq 2 . 878Multiple versions must be comma-separated. 879When this option is set to 880.Dq 2,1 881.Nm ssh 882will try version 2 and fall back to version 1 883if version 2 is not available. 884The default is 885.Sq 2 . 886.It Cm ProxyCommand 887Specifies the command to use to connect to the server. 888The command 889string extends to the end of the line, and is executed with 890the user's shell. 891In the command string, any occurrence of 892.Ql %h 893will be substituted by the host name to 894connect, 895.Ql %p 896by the port, and 897.Ql %r 898by the remote user name. 899The command can be basically anything, 900and should read from its standard input and write to its standard output. 901It should eventually connect an 902.Xr sshd 8 903server running on some machine, or execute 904.Ic sshd -i 905somewhere. 906Host key management will be done using the 907HostName of the host being connected (defaulting to the name typed by 908the user). 909Setting the command to 910.Dq none 911disables this option entirely. 912Note that 913.Cm CheckHostIP 914is not available for connects with a proxy command. 915.Pp 916This directive is useful in conjunction with 917.Xr nc 1 918and its proxy support. 919For example, the following directive would connect via an HTTP proxy at 920192.0.2.0: 921.Bd -literal -offset 3n 922ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p 923.Ed 924.It Cm PubkeyAuthentication 925Specifies whether to try public key authentication. 926The argument to this keyword must be 927.Dq yes 928or 929.Dq no . 930The default is 931.Dq yes . 932This option applies to protocol version 2 only. 933.It Cm RekeyLimit 934Specifies the maximum amount of data that may be transmitted before the 935session key is renegotiated. 936The argument is the number of bytes, with an optional suffix of 937.Sq K , 938.Sq M , 939or 940.Sq G 941to indicate Kilobytes, Megabytes, or Gigabytes, respectively. 942The default is between 943.Sq 1G 944and 945.Sq 4G , 946depending on the cipher. 947This option applies to protocol version 2 only. 948.It Cm RemoteForward 949Specifies that a TCP port on the remote machine be forwarded over 950the secure channel to the specified host and port from the local machine. 951The first argument must be 952.Sm off 953.Oo Ar bind_address : Oc Ar port 954.Sm on 955and the second argument must be 956.Ar host : Ns Ar hostport . 957IPv6 addresses can be specified by enclosing addresses in square brackets. 958Multiple forwardings may be specified, and additional 959forwardings can be given on the command line. 960Privileged ports can be forwarded only when 961logging in as root on the remote machine. 962.Pp 963If the 964.Ar port 965argument is 966.Ql 0 , 967the listen port will be dynamically allocated on the server and reported 968to the client at run time. 969.Pp 970If the 971.Ar bind_address 972is not specified, the default is to only bind to loopback addresses. 973If the 974.Ar bind_address 975is 976.Ql * 977or an empty string, then the forwarding is requested to listen on all 978interfaces. 979Specifying a remote 980.Ar bind_address 981will only succeed if the server's 982.Cm GatewayPorts 983option is enabled (see 984.Xr sshd_config 5 ) . 985.It Cm RequestTTY 986Specifies whether to request a pseudo-tty for the session. 987The argument may be one of: 988.Dq no 989(never request a TTY), 990.Dq yes 991(always request a TTY when standard input is a TTY), 992.Dq force 993(always request a TTY) or 994.Dq auto 995(request a TTY when opening a login session). 996This option mirrors the 997.Fl t 998and 999.Fl T 1000flags for 1001.Xr ssh 1 . 1002.It Cm RhostsRSAAuthentication 1003Specifies whether to try rhosts based authentication with RSA host 1004authentication. 1005The argument must be 1006.Dq yes 1007or 1008.Dq no . 1009The default is 1010.Dq no . 1011This option applies to protocol version 1 only and requires 1012.Xr ssh 1 1013to be setuid root. 1014.It Cm RSAAuthentication 1015Specifies whether to try RSA authentication. 1016The argument to this keyword must be 1017.Dq yes 1018or 1019.Dq no . 1020RSA authentication will only be 1021attempted if the identity file exists, or an authentication agent is 1022running. 1023The default is 1024.Dq yes . 1025Note that this option applies to protocol version 1 only. 1026.It Cm SendEnv 1027Specifies what variables from the local 1028.Xr environ 7 1029should be sent to the server. 1030Note that environment passing is only supported for protocol 2. 1031The server must also support it, and the server must be configured to 1032accept these environment variables. 1033Refer to 1034.Cm AcceptEnv 1035in 1036.Xr sshd_config 5 1037for how to configure the server. 1038Variables are specified by name, which may contain wildcard characters. 1039Multiple environment variables may be separated by whitespace or spread 1040across multiple 1041.Cm SendEnv 1042directives. 1043The default is not to send any environment variables. 1044.Pp 1045See 1046.Sx PATTERNS 1047for more information on patterns. 1048.It Cm ServerAliveCountMax 1049Sets the number of server alive messages (see below) which may be 1050sent without 1051.Xr ssh 1 1052receiving any messages back from the server. 1053If this threshold is reached while server alive messages are being sent, 1054ssh will disconnect from the server, terminating the session. 1055It is important to note that the use of server alive messages is very 1056different from 1057.Cm TCPKeepAlive 1058(below). 1059The server alive messages are sent through the encrypted channel 1060and therefore will not be spoofable. 1061The TCP keepalive option enabled by 1062.Cm TCPKeepAlive 1063is spoofable. 1064The server alive mechanism is valuable when the client or 1065server depend on knowing when a connection has become inactive. 1066.Pp 1067The default value is 3. 1068If, for example, 1069.Cm ServerAliveInterval 1070(see below) is set to 15 and 1071.Cm ServerAliveCountMax 1072is left at the default, if the server becomes unresponsive, 1073ssh will disconnect after approximately 45 seconds. 1074This option applies to protocol version 2 only. 1075.It Cm ServerAliveInterval 1076Sets a timeout interval in seconds after which if no data has been received 1077from the server, 1078.Xr ssh 1 1079will send a message through the encrypted 1080channel to request a response from the server. 1081The default 1082is 0, indicating that these messages will not be sent to the server. 1083This option applies to protocol version 2 only. 1084.It Cm StrictHostKeyChecking 1085If this flag is set to 1086.Dq yes , 1087.Xr ssh 1 1088will never automatically add host keys to the 1089.Pa ~/.ssh/known_hosts 1090file, and refuses to connect to hosts whose host key has changed. 1091This provides maximum protection against trojan horse attacks, 1092though it can be annoying when the 1093.Pa /etc/ssh/ssh_known_hosts 1094file is poorly maintained or when connections to new hosts are 1095frequently made. 1096This option forces the user to manually 1097add all new hosts. 1098If this flag is set to 1099.Dq no , 1100ssh will automatically add new host keys to the 1101user known hosts files. 1102If this flag is set to 1103.Dq ask , 1104new host keys 1105will be added to the user known host files only after the user 1106has confirmed that is what they really want to do, and 1107ssh will refuse to connect to hosts whose host key has changed. 1108The host keys of 1109known hosts will be verified automatically in all cases. 1110The argument must be 1111.Dq yes , 1112.Dq no , 1113or 1114.Dq ask . 1115The default is 1116.Dq ask . 1117.It Cm TCPKeepAlive 1118Specifies whether the system should send TCP keepalive messages to the 1119other side. 1120If they are sent, death of the connection or crash of one 1121of the machines will be properly noticed. 1122However, this means that 1123connections will die if the route is down temporarily, and some people 1124find it annoying. 1125.Pp 1126The default is 1127.Dq yes 1128(to send TCP keepalive messages), and the client will notice 1129if the network goes down or the remote host dies. 1130This is important in scripts, and many users want it too. 1131.Pp 1132To disable TCP keepalive messages, the value should be set to 1133.Dq no . 1134.It Cm Tunnel 1135Request 1136.Xr tun 4 1137device forwarding between the client and the server. 1138The argument must be 1139.Dq yes , 1140.Dq point-to-point 1141(layer 3), 1142.Dq ethernet 1143(layer 2), 1144or 1145.Dq no . 1146Specifying 1147.Dq yes 1148requests the default tunnel mode, which is 1149.Dq point-to-point . 1150The default is 1151.Dq no . 1152.It Cm TunnelDevice 1153Specifies the 1154.Xr tun 4 1155devices to open on the client 1156.Pq Ar local_tun 1157and the server 1158.Pq Ar remote_tun . 1159.Pp 1160The argument must be 1161.Sm off 1162.Ar local_tun Op : Ar remote_tun . 1163.Sm on 1164The devices may be specified by numerical ID or the keyword 1165.Dq any , 1166which uses the next available tunnel device. 1167If 1168.Ar remote_tun 1169is not specified, it defaults to 1170.Dq any . 1171The default is 1172.Dq any:any . 1173.It Cm UsePrivilegedPort 1174Specifies whether to use a privileged port for outgoing connections. 1175The argument must be 1176.Dq yes 1177or 1178.Dq no . 1179The default is 1180.Dq no . 1181If set to 1182.Dq yes , 1183.Xr ssh 1 1184must be setuid root. 1185Note that this option must be set to 1186.Dq yes 1187for 1188.Cm RhostsRSAAuthentication 1189with older servers. 1190.It Cm User 1191Specifies the user to log in as. 1192This can be useful when a different user name is used on different machines. 1193This saves the trouble of 1194having to remember to give the user name on the command line. 1195.It Cm UserKnownHostsFile 1196Specifies one or more files to use for the user 1197host key database, separated by whitespace. 1198The default is 1199.Pa ~/.ssh/known_hosts , 1200.Pa ~/.ssh/known_hosts2 . 1201.It Cm VerifyHostKeyDNS 1202Specifies whether to verify the remote key using DNS and SSHFP resource 1203records. 1204If this option is set to 1205.Dq yes , 1206the client will implicitly trust keys that match a secure fingerprint 1207from DNS. 1208Insecure fingerprints will be handled as if this option was set to 1209.Dq ask . 1210If this option is set to 1211.Dq ask , 1212information on fingerprint match will be displayed, but the user will still 1213need to confirm new host keys according to the 1214.Cm StrictHostKeyChecking 1215option. 1216The argument must be 1217.Dq yes , 1218.Dq no , 1219or 1220.Dq ask . 1221The default is 1222.Dq no . 1223Note that this option applies to protocol version 2 only. 1224.Pp 1225See also 1226.Sx VERIFYING HOST KEYS 1227in 1228.Xr ssh 1 . 1229.It Cm VersionAddendum 1230Specifies a string to append to the regular version string to identify 1231OS- or site-specific modifications. 1232The default is 1233.Dq FreeBSD-20130515 . 1234.It Cm VisualHostKey 1235If this flag is set to 1236.Dq yes , 1237an ASCII art representation of the remote host key fingerprint is 1238printed in addition to the hex fingerprint string at login and 1239for unknown host keys. 1240If this flag is set to 1241.Dq no , 1242no fingerprint strings are printed at login and 1243only the hex fingerprint string will be printed for unknown host keys. 1244The default is 1245.Dq no . 1246.It Cm XAuthLocation 1247Specifies the full pathname of the 1248.Xr xauth 1 1249program. 1250The default is 1251.Pa /usr/local/bin/xauth . 1252.El 1253.Sh PATTERNS 1254A 1255.Em pattern 1256consists of zero or more non-whitespace characters, 1257.Sq * 1258(a wildcard that matches zero or more characters), 1259or 1260.Sq ?\& 1261(a wildcard that matches exactly one character). 1262For example, to specify a set of declarations for any host in the 1263.Dq .co.uk 1264set of domains, 1265the following pattern could be used: 1266.Pp 1267.Dl Host *.co.uk 1268.Pp 1269The following pattern 1270would match any host in the 192.168.0.[0-9] network range: 1271.Pp 1272.Dl Host 192.168.0.? 1273.Pp 1274A 1275.Em pattern-list 1276is a comma-separated list of patterns. 1277Patterns within pattern-lists may be negated 1278by preceding them with an exclamation mark 1279.Pq Sq !\& . 1280For example, 1281to allow a key to be used from anywhere within an organisation 1282except from the 1283.Dq dialup 1284pool, 1285the following entry (in authorized_keys) could be used: 1286.Pp 1287.Dl from=\&"!*.dialup.example.com,*.example.com\&" 1288.Sh FILES 1289.Bl -tag -width Ds 1290.It Pa ~/.ssh/config 1291This is the per-user configuration file. 1292The format of this file is described above. 1293This file is used by the SSH client. 1294Because of the potential for abuse, this file must have strict permissions: 1295read/write for the user, and not accessible by others. 1296.It Pa /etc/ssh/ssh_config 1297Systemwide configuration file. 1298This file provides defaults for those 1299values that are not specified in the user's configuration file, and 1300for those users who do not have a configuration file. 1301This file must be world-readable. 1302.El 1303.Sh SEE ALSO 1304.Xr ssh 1 1305.Sh AUTHORS 1306OpenSSH is a derivative of the original and free 1307ssh 1.2.12 release by Tatu Ylonen. 1308Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, 1309Theo de Raadt and Dug Song 1310removed many bugs, re-added newer features and 1311created OpenSSH. 1312Markus Friedl contributed the support for SSH 1313protocol versions 1.5 and 2.0. 1314