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.328 2020/05/29 05:48:39 jmc Exp $ 37.Dd $Mdocdate: May 29 2020 $ 38.Dt SSH_CONFIG 5 39.Os 40.Sh NAME 41.Nm ssh_config 42.Nd OpenSSH client configuration file 43.Sh DESCRIPTION 44.Xr ssh 1 45obtains configuration data from the following sources in 46the following order: 47.Pp 48.Bl -enum -offset indent -compact 49.It 50command-line options 51.It 52user's configuration file 53.Pq Pa ~/.ssh/config 54.It 55system-wide configuration file 56.Pq Pa /etc/ssh/ssh_config 57.El 58.Pp 59For each parameter, the first obtained value 60will be used. 61The configuration files contain sections separated by 62.Cm Host 63specifications, and that section is only applied for hosts that 64match one of the patterns given in the specification. 65The matched host name is usually the one given on the command line 66(see the 67.Cm CanonicalizeHostname 68option for exceptions). 69.Pp 70Since the first obtained value for each parameter is used, more 71host-specific declarations should be given near the beginning of the 72file, and general defaults at the end. 73.Pp 74The file contains keyword-argument pairs, one per line. 75Lines starting with 76.Ql # 77and empty lines are interpreted as comments. 78Arguments may optionally be enclosed in double quotes 79.Pq \&" 80in order to represent arguments containing spaces. 81Configuration options may be separated by whitespace or 82optional whitespace and exactly one 83.Ql = ; 84the latter format is useful to avoid the need to quote whitespace 85when specifying configuration options using the 86.Nm ssh , 87.Nm scp , 88and 89.Nm sftp 90.Fl o 91option. 92.Pp 93The possible 94keywords and their meanings are as follows (note that 95keywords are case-insensitive and arguments are case-sensitive): 96.Bl -tag -width Ds 97.It Cm Host 98Restricts the following declarations (up to the next 99.Cm Host 100or 101.Cm Match 102keyword) to be only for those hosts that match one of the patterns 103given after the keyword. 104If more than one pattern is provided, they should be separated by whitespace. 105A single 106.Ql * 107as a pattern can be used to provide global 108defaults for all hosts. 109The host is usually the 110.Ar hostname 111argument given on the command line 112(see the 113.Cm CanonicalizeHostname 114keyword for exceptions). 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 Match 129Restricts the following declarations (up to the next 130.Cm Host 131or 132.Cm Match 133keyword) to be used only when the conditions following the 134.Cm Match 135keyword are satisfied. 136Match conditions are specified using one or more criteria 137or the single token 138.Cm all 139which always matches. 140The available criteria keywords are: 141.Cm canonical , 142.Cm final , 143.Cm exec , 144.Cm host , 145.Cm originalhost , 146.Cm user , 147and 148.Cm localuser . 149The 150.Cm all 151criteria must appear alone or immediately after 152.Cm canonical 153or 154.Cm final . 155Other criteria may be combined arbitrarily. 156All criteria but 157.Cm all , 158.Cm canonical , 159and 160.Cm final 161require an argument. 162Criteria may be negated by prepending an exclamation mark 163.Pq Sq !\& . 164.Pp 165The 166.Cm canonical 167keyword matches only when the configuration file is being re-parsed 168after hostname canonicalization (see the 169.Cm CanonicalizeHostname 170option). 171This may be useful to specify conditions that work with canonical host 172names only. 173.Pp 174The 175.Cm final 176keyword requests that the configuration be re-parsed (regardless of whether 177.Cm CanonicalizeHostname 178is enabled), and matches only during this final pass. 179If 180.Cm CanonicalizeHostname 181is enabled, then 182.Cm canonical 183and 184.Cm final 185match during the same pass. 186.Pp 187The 188.Cm exec 189keyword executes the specified command under the user's shell. 190If the command returns a zero exit status then the condition is considered true. 191Commands containing whitespace characters must be quoted. 192Arguments to 193.Cm exec 194accept the tokens described in the 195.Sx TOKENS 196section. 197.Pp 198The other keywords' criteria must be single entries or comma-separated 199lists and may use the wildcard and negation operators described in the 200.Sx PATTERNS 201section. 202The criteria for the 203.Cm host 204keyword are matched against the target hostname, after any substitution 205by the 206.Cm Hostname 207or 208.Cm CanonicalizeHostname 209options. 210The 211.Cm originalhost 212keyword matches against the hostname as it was specified on the command-line. 213The 214.Cm user 215keyword matches against the target username on the remote host. 216The 217.Cm localuser 218keyword matches against the name of the local user running 219.Xr ssh 1 220(this keyword may be useful in system-wide 221.Nm 222files). 223.It Cm AddKeysToAgent 224Specifies whether keys should be automatically added to a running 225.Xr ssh-agent 1 . 226If this option is set to 227.Cm yes 228and a key is loaded from a file, the key and its passphrase are added to 229the agent with the default lifetime, as if by 230.Xr ssh-add 1 . 231If this option is set to 232.Cm ask , 233.Xr ssh 1 234will require confirmation using the 235.Ev SSH_ASKPASS 236program before adding a key (see 237.Xr ssh-add 1 238for details). 239If this option is set to 240.Cm confirm , 241each use of the key must be confirmed, as if the 242.Fl c 243option was specified to 244.Xr ssh-add 1 . 245If this option is set to 246.Cm no , 247no keys are added to the agent. 248The argument must be 249.Cm yes , 250.Cm confirm , 251.Cm ask , 252or 253.Cm no 254(the default). 255.It Cm AddressFamily 256Specifies which address family to use when connecting. 257Valid arguments are 258.Cm any 259(the default), 260.Cm inet 261(use IPv4 only), or 262.Cm inet6 263(use IPv6 only). 264.It Cm BatchMode 265If set to 266.Cm yes , 267user interaction such as password prompts and host key confirmation requests 268will be disabled. 269This option is useful in scripts and other batch jobs where no user 270is present to interact with 271.Xr ssh 1 . 272The argument must be 273.Cm yes 274or 275.Cm no 276(the default). 277.It Cm BindAddress 278Use the specified address on the local machine as the source address of 279the connection. 280Only useful on systems with more than one address. 281.It Cm BindInterface 282Use the address of the specified interface on the local machine as the 283source address of the connection. 284.It Cm CanonicalDomains 285When 286.Cm CanonicalizeHostname 287is enabled, this option specifies the list of domain suffixes in which to 288search for the specified destination host. 289.It Cm CanonicalizeFallbackLocal 290Specifies whether to fail with an error when hostname canonicalization fails. 291The default, 292.Cm yes , 293will attempt to look up the unqualified hostname using the system resolver's 294search rules. 295A value of 296.Cm no 297will cause 298.Xr ssh 1 299to fail instantly if 300.Cm CanonicalizeHostname 301is enabled and the target hostname cannot be found in any of the domains 302specified by 303.Cm CanonicalDomains . 304.It Cm CanonicalizeHostname 305Controls whether explicit hostname canonicalization is performed. 306The default, 307.Cm no , 308is not to perform any name rewriting and let the system resolver handle all 309hostname lookups. 310If set to 311.Cm yes 312then, for connections that do not use a 313.Cm ProxyCommand 314or 315.Cm ProxyJump , 316.Xr ssh 1 317will attempt to canonicalize the hostname specified on the command line 318using the 319.Cm CanonicalDomains 320suffixes and 321.Cm CanonicalizePermittedCNAMEs 322rules. 323If 324.Cm CanonicalizeHostname 325is set to 326.Cm always , 327then canonicalization is applied to proxied connections too. 328.Pp 329If this option is enabled, then the configuration files are processed 330again using the new target name to pick up any new configuration in matching 331.Cm Host 332and 333.Cm Match 334stanzas. 335.It Cm CanonicalizeMaxDots 336Specifies the maximum number of dot characters in a hostname before 337canonicalization is disabled. 338The default, 1, 339allows a single dot (i.e. hostname.subdomain). 340.It Cm CanonicalizePermittedCNAMEs 341Specifies rules to determine whether CNAMEs should be followed when 342canonicalizing hostnames. 343The rules consist of one or more arguments of 344.Ar source_domain_list : Ns Ar target_domain_list , 345where 346.Ar source_domain_list 347is a pattern-list of domains that may follow CNAMEs in canonicalization, 348and 349.Ar target_domain_list 350is a pattern-list of domains that they may resolve to. 351.Pp 352For example, 353.Qq *.a.example.com:*.b.example.com,*.c.example.com 354will allow hostnames matching 355.Qq *.a.example.com 356to be canonicalized to names in the 357.Qq *.b.example.com 358or 359.Qq *.c.example.com 360domains. 361.It Cm CASignatureAlgorithms 362Specifies which algorithms are allowed for signing of certificates 363by certificate authorities (CAs). 364The default is: 365.Bd -literal -offset indent 366ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, 367ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa 368.Ed 369.Pp 370.Xr ssh 1 371will not accept host certificates signed using algorithms other than those 372specified. 373.It Cm CertificateFile 374Specifies a file from which the user's certificate is read. 375A corresponding private key must be provided separately in order 376to use this certificate either 377from an 378.Cm IdentityFile 379directive or 380.Fl i 381flag to 382.Xr ssh 1 , 383via 384.Xr ssh-agent 1 , 385or via a 386.Cm PKCS11Provider 387or 388.Cm SecurityKeyProvider . 389.Pp 390Arguments to 391.Cm CertificateFile 392may use the tilde syntax to refer to a user's home directory, 393the tokens described in the 394.Sx TOKENS 395section and environment variables as described in the 396.Sx ENVIRONMENT VARIABLES 397section. 398.Pp 399It is possible to have multiple certificate files specified in 400configuration files; these certificates will be tried in sequence. 401Multiple 402.Cm CertificateFile 403directives will add to the list of certificates used for 404authentication. 405.It Cm ChallengeResponseAuthentication 406Specifies whether to use challenge-response authentication. 407The argument to this keyword must be 408.Cm yes 409(the default) 410or 411.Cm no . 412.It Cm CheckHostIP 413If set to 414.Cm yes 415(the default), 416.Xr ssh 1 417will additionally check the host IP address in the 418.Pa known_hosts 419file. 420This allows it to detect if a host key changed due to DNS spoofing 421and will add addresses of destination hosts to 422.Pa ~/.ssh/known_hosts 423in the process, regardless of the setting of 424.Cm StrictHostKeyChecking . 425If the option is set to 426.Cm no , 427the check will not be executed. 428.It Cm Ciphers 429Specifies the ciphers allowed and their order of preference. 430Multiple ciphers must be comma-separated. 431If the specified list begins with a 432.Sq + 433character, then the specified ciphers will be appended to the default set 434instead of replacing them. 435If the specified list begins with a 436.Sq - 437character, then the specified ciphers (including wildcards) will be removed 438from the default set instead of replacing them. 439If the specified list begins with a 440.Sq ^ 441character, then the specified ciphers will be placed at the head of the 442default set. 443.Pp 444The supported ciphers are: 445.Bd -literal -offset indent 4463des-cbc 447aes128-cbc 448aes192-cbc 449aes256-cbc 450aes128-ctr 451aes192-ctr 452aes256-ctr 453aes128-gcm@openssh.com 454aes256-gcm@openssh.com 455chacha20-poly1305@openssh.com 456.Ed 457.Pp 458The default is: 459.Bd -literal -offset indent 460chacha20-poly1305@openssh.com, 461aes128-ctr,aes192-ctr,aes256-ctr, 462aes128-gcm@openssh.com,aes256-gcm@openssh.com 463.Ed 464.Pp 465The list of available ciphers may also be obtained using 466.Qq ssh -Q cipher . 467.It Cm ClearAllForwardings 468Specifies that all local, remote, and dynamic port forwardings 469specified in the configuration files or on the command line be 470cleared. 471This option is primarily useful when used from the 472.Xr ssh 1 473command line to clear port forwardings set in 474configuration files, and is automatically set by 475.Xr scp 1 476and 477.Xr sftp 1 . 478The argument must be 479.Cm yes 480or 481.Cm no 482(the default). 483.It Cm Compression 484Specifies whether to use compression. 485The argument must be 486.Cm yes 487or 488.Cm no 489(the default). 490.It Cm ConnectionAttempts 491Specifies the number of tries (one per second) to make before exiting. 492The argument must be an integer. 493This may be useful in scripts if the connection sometimes fails. 494The default is 1. 495.It Cm ConnectTimeout 496Specifies the timeout (in seconds) used when connecting to the 497SSH server, instead of using the default system TCP timeout. 498This timeout is applied both to establishing the connection and to performing 499the initial SSH protocol handshake and key exchange. 500.It Cm ControlMaster 501Enables the sharing of multiple sessions over a single network connection. 502When set to 503.Cm yes , 504.Xr ssh 1 505will listen for connections on a control socket specified using the 506.Cm ControlPath 507argument. 508Additional sessions can connect to this socket using the same 509.Cm ControlPath 510with 511.Cm ControlMaster 512set to 513.Cm no 514(the default). 515These sessions will try to reuse the master instance's network connection 516rather than initiating new ones, but will fall back to connecting normally 517if the control socket does not exist, or is not listening. 518.Pp 519Setting this to 520.Cm ask 521will cause 522.Xr ssh 1 523to listen for control connections, but require confirmation using 524.Xr ssh-askpass 1 . 525If the 526.Cm ControlPath 527cannot be opened, 528.Xr ssh 1 529will continue without connecting to a master instance. 530.Pp 531X11 and 532.Xr ssh-agent 1 533forwarding is supported over these multiplexed connections, however the 534display and agent forwarded will be the one belonging to the master 535connection i.e. it is not possible to forward multiple displays or agents. 536.Pp 537Two additional options allow for opportunistic multiplexing: try to use a 538master connection but fall back to creating a new one if one does not already 539exist. 540These options are: 541.Cm auto 542and 543.Cm autoask . 544The latter requires confirmation like the 545.Cm ask 546option. 547.It Cm ControlPath 548Specify the path to the control socket used for connection sharing as described 549in the 550.Cm ControlMaster 551section above or the string 552.Cm none 553to disable connection sharing. 554Arguments to 555.Cm ControlPath 556may use the tilde syntax to refer to a user's home directory, 557the tokens described in the 558.Sx TOKENS 559section and environment variables as described in the 560.Sx ENVIRONMENT VARIABLES 561section. 562It is recommended that any 563.Cm ControlPath 564used for opportunistic connection sharing include 565at least %h, %p, and %r (or alternatively %C) and be placed in a directory 566that is not writable by other users. 567This ensures that shared connections are uniquely identified. 568.It Cm ControlPersist 569When used in conjunction with 570.Cm ControlMaster , 571specifies that the master connection should remain open 572in the background (waiting for future client connections) 573after the initial client connection has been closed. 574If set to 575.Cm no 576(the default), 577then the master connection will not be placed into the background, 578and will close as soon as the initial client connection is closed. 579If set to 580.Cm yes 581or 0, 582then the master connection will remain in the background indefinitely 583(until killed or closed via a mechanism such as the 584.Qq ssh -O exit ) . 585If set to a time in seconds, or a time in any of the formats documented in 586.Xr sshd_config 5 , 587then the backgrounded master connection will automatically terminate 588after it has remained idle (with no client connections) for the 589specified time. 590.It Cm DynamicForward 591Specifies that a TCP port on the local machine be forwarded 592over the secure channel, and the application 593protocol is then used to determine where to connect to from the 594remote machine. 595.Pp 596The argument must be 597.Sm off 598.Oo Ar bind_address : Oc Ar port . 599.Sm on 600IPv6 addresses can be specified by enclosing addresses in square brackets. 601By default, the local port is bound in accordance with the 602.Cm GatewayPorts 603setting. 604However, an explicit 605.Ar bind_address 606may be used to bind the connection to a specific address. 607The 608.Ar bind_address 609of 610.Cm localhost 611indicates that the listening port be bound for local use only, while an 612empty address or 613.Sq * 614indicates that the port should be available from all interfaces. 615.Pp 616Currently the SOCKS4 and SOCKS5 protocols are supported, and 617.Xr ssh 1 618will act as a SOCKS server. 619Multiple forwardings may be specified, and 620additional forwardings can be given on the command line. 621Only the superuser can forward privileged ports. 622.It Cm EnableSSHKeysign 623Setting this option to 624.Cm yes 625in the global client configuration file 626.Pa /etc/ssh/ssh_config 627enables the use of the helper program 628.Xr ssh-keysign 8 629during 630.Cm HostbasedAuthentication . 631The argument must be 632.Cm yes 633or 634.Cm no 635(the default). 636This option should be placed in the non-hostspecific section. 637See 638.Xr ssh-keysign 8 639for more information. 640.It Cm EscapeChar 641Sets the escape character (default: 642.Ql ~ ) . 643The escape character can also 644be set on the command line. 645The argument should be a single character, 646.Ql ^ 647followed by a letter, or 648.Cm none 649to disable the escape 650character entirely (making the connection transparent for binary 651data). 652.It Cm ExitOnForwardFailure 653Specifies whether 654.Xr ssh 1 655should terminate the connection if it cannot set up all requested 656dynamic, tunnel, local, and remote port forwardings, (e.g.\& 657if either end is unable to bind and listen on a specified port). 658Note that 659.Cm ExitOnForwardFailure 660does not apply to connections made over port forwardings and will not, 661for example, cause 662.Xr ssh 1 663to exit if TCP connections to the ultimate forwarding destination fail. 664The argument must be 665.Cm yes 666or 667.Cm no 668(the default). 669.It Cm FingerprintHash 670Specifies the hash algorithm used when displaying key fingerprints. 671Valid options are: 672.Cm md5 673and 674.Cm sha256 675(the default). 676.It Cm ForwardAgent 677Specifies whether the connection to the authentication agent (if any) 678will be forwarded to the remote machine. 679The argument may be 680.Cm yes , 681.Cm no 682(the default), 683an explicit path to an agent socket or the name of an environment variable 684(beginning with 685.Sq $ ) 686in which to find the path. 687.Pp 688Agent forwarding should be enabled with caution. 689Users with the ability to bypass file permissions on the remote host 690(for the agent's Unix-domain socket) 691can access the local agent through the forwarded connection. 692An attacker cannot obtain key material from the agent, 693however they can perform operations on the keys that enable them to 694authenticate using the identities loaded into the agent. 695.It Cm ForwardX11 696Specifies whether X11 connections will be automatically redirected 697over the secure channel and 698.Ev DISPLAY 699set. 700The argument must be 701.Cm yes 702or 703.Cm no 704(the default). 705.Pp 706X11 forwarding should be enabled with caution. 707Users with the ability to bypass file permissions on the remote host 708(for the user's X11 authorization database) 709can access the local X11 display through the forwarded connection. 710An attacker may then be able to perform activities such as keystroke monitoring 711if the 712.Cm ForwardX11Trusted 713option is also enabled. 714.It Cm ForwardX11Timeout 715Specify a timeout for untrusted X11 forwarding 716using the format described in the 717.Sx TIME FORMATS 718section of 719.Xr sshd_config 5 . 720X11 connections received by 721.Xr ssh 1 722after this time will be refused. 723Setting 724.Cm ForwardX11Timeout 725to zero will disable the timeout and permit X11 forwarding for the life 726of the connection. 727The default is to disable untrusted X11 forwarding after twenty minutes has 728elapsed. 729.It Cm ForwardX11Trusted 730If this option is set to 731.Cm yes , 732remote X11 clients will have full access to the original X11 display. 733.Pp 734If this option is set to 735.Cm no 736(the default), 737remote X11 clients will be considered untrusted and prevented 738from stealing or tampering with data belonging to trusted X11 739clients. 740Furthermore, the 741.Xr xauth 1 742token used for the session will be set to expire after 20 minutes. 743Remote clients will be refused access after this time. 744.Pp 745See the X11 SECURITY extension specification for full details on 746the restrictions imposed on untrusted clients. 747.It Cm GatewayPorts 748Specifies whether remote hosts are allowed to connect to local 749forwarded ports. 750By default, 751.Xr ssh 1 752binds local port forwardings to the loopback address. 753This prevents other remote hosts from connecting to forwarded ports. 754.Cm GatewayPorts 755can be used to specify that ssh 756should bind local port forwardings to the wildcard address, 757thus allowing remote hosts to connect to forwarded ports. 758The argument must be 759.Cm yes 760or 761.Cm no 762(the default). 763.It Cm GlobalKnownHostsFile 764Specifies one or more files to use for the global 765host key database, separated by whitespace. 766The default is 767.Pa /etc/ssh/ssh_known_hosts , 768.Pa /etc/ssh/ssh_known_hosts2 . 769.It Cm GSSAPIAuthentication 770Specifies whether user authentication based on GSSAPI is allowed. 771The default is 772.Cm no . 773.It Cm GSSAPIDelegateCredentials 774Forward (delegate) credentials to the server. 775The default is 776.Cm no . 777.It Cm HashKnownHosts 778Indicates that 779.Xr ssh 1 780should hash host names and addresses when they are added to 781.Pa ~/.ssh/known_hosts . 782These hashed names may be used normally by 783.Xr ssh 1 784and 785.Xr sshd 8 , 786but they do not visually reveal identifying information if the 787file's contents are disclosed. 788The default is 789.Cm no . 790Note that existing names and addresses in known hosts files 791will not be converted automatically, 792but may be manually hashed using 793.Xr ssh-keygen 1 . 794.It Cm HostbasedAuthentication 795Specifies whether to try rhosts based authentication with public key 796authentication. 797The argument must be 798.Cm yes 799or 800.Cm no 801(the default). 802.It Cm HostbasedKeyTypes 803Specifies the key types that will be used for hostbased authentication 804as a comma-separated list of patterns. 805Alternately if the specified list begins with a 806.Sq + 807character, then the specified key types will be appended to the default set 808instead of replacing them. 809If the specified list begins with a 810.Sq - 811character, then the specified key types (including wildcards) will be removed 812from the default set instead of replacing them. 813If the specified list begins with a 814.Sq ^ 815character, then the specified key types will be placed at the head of the 816default set. 817The default for this option is: 818.Bd -literal -offset 3n 819ecdsa-sha2-nistp256-cert-v01@openssh.com, 820ecdsa-sha2-nistp384-cert-v01@openssh.com, 821ecdsa-sha2-nistp521-cert-v01@openssh.com, 822sk-ecdsa-sha2-nistp256-cert-v01@openssh.com, 823ssh-ed25519-cert-v01@openssh.com, 824sk-ssh-ed25519-cert-v01@openssh.com, 825rsa-sha2-512-cert-v01@openssh.com, 826rsa-sha2-256-cert-v01@openssh.com, 827ssh-rsa-cert-v01@openssh.com, 828ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, 829sk-ecdsa-sha2-nistp256@openssh.com, 830ssh-ed25519,sk-ssh-ed25519@openssh.com, 831rsa-sha2-512,rsa-sha2-256,ssh-rsa 832.Ed 833.Pp 834The 835.Fl Q 836option of 837.Xr ssh 1 838may be used to list supported key types. 839.It Cm HostKeyAlgorithms 840Specifies the host key algorithms 841that the client wants to use in order of preference. 842Alternately if the specified list begins with a 843.Sq + 844character, then the specified key types will be appended to the default set 845instead of replacing them. 846If the specified list begins with a 847.Sq - 848character, then the specified key types (including wildcards) will be removed 849from the default set instead of replacing them. 850If the specified list begins with a 851.Sq ^ 852character, then the specified key types will be placed at the head of the 853default set. 854The default for this option is: 855.Bd -literal -offset 3n 856ecdsa-sha2-nistp256-cert-v01@openssh.com, 857ecdsa-sha2-nistp384-cert-v01@openssh.com, 858ecdsa-sha2-nistp521-cert-v01@openssh.com, 859sk-ecdsa-sha2-nistp256-cert-v01@openssh.com, 860ssh-ed25519-cert-v01@openssh.com, 861sk-ssh-ed25519-cert-v01@openssh.com, 862rsa-sha2-512-cert-v01@openssh.com, 863rsa-sha2-256-cert-v01@openssh.com, 864ssh-rsa-cert-v01@openssh.com, 865ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, 866sk-ecdsa-sha2-nistp256@openssh.com, 867ssh-ed25519,sk-ssh-ed25519@openssh.com, 868rsa-sha2-512,rsa-sha2-256,ssh-rsa 869.Ed 870.Pp 871If hostkeys are known for the destination host then this default is modified 872to prefer their algorithms. 873.Pp 874The list of available key types may also be obtained using 875.Qq ssh -Q HostKeyAlgorithms . 876.It Cm HostKeyAlias 877Specifies an alias that should be used instead of the 878real host name when looking up or saving the host key 879in the host key database files and when validating host certificates. 880This option is useful for tunneling SSH connections 881or for multiple servers running on a single host. 882.It Cm Hostname 883Specifies the real host name to log into. 884This can be used to specify nicknames or abbreviations for hosts. 885Arguments to 886.Cm Hostname 887accept the tokens described in the 888.Sx TOKENS 889section. 890Numeric IP addresses are also permitted (both on the command line and in 891.Cm Hostname 892specifications). 893The default is the name given on the command line. 894.It Cm IdentitiesOnly 895Specifies that 896.Xr ssh 1 897should only use the configured authentication identity and certificate files 898(either the default files, or those explicitly configured in the 899.Nm 900files 901or passed on the 902.Xr ssh 1 903command-line), 904even if 905.Xr ssh-agent 1 906or a 907.Cm PKCS11Provider 908or 909.Cm SecurityKeyProvider 910offers more identities. 911The argument to this keyword must be 912.Cm yes 913or 914.Cm no 915(the default). 916This option is intended for situations where ssh-agent 917offers many different identities. 918.It Cm IdentityAgent 919Specifies the 920.Ux Ns -domain 921socket used to communicate with the authentication agent. 922.Pp 923This option overrides the 924.Ev SSH_AUTH_SOCK 925environment variable and can be used to select a specific agent. 926Setting the socket name to 927.Cm none 928disables the use of an authentication agent. 929If the string 930.Qq SSH_AUTH_SOCK 931is specified, the location of the socket will be read from the 932.Ev SSH_AUTH_SOCK 933environment variable. 934Otherwise if the specified value begins with a 935.Sq $ 936character, then it will be treated as an environment variable containing 937the location of the socket. 938.Pp 939Arguments to 940.Cm IdentityAgent 941may use the tilde syntax to refer to a user's home directory, 942the tokens described in the 943.Sx TOKENS 944section and environment variables as described in the 945.Sx ENVIRONMENT VARIABLES 946section. 947.It Cm IdentityFile 948Specifies a file from which the user's DSA, ECDSA, authenticator-hosted ECDSA, 949Ed25519, authenticator-hosted Ed25519 or RSA authentication identity is read. 950The default is 951.Pa ~/.ssh/id_dsa , 952.Pa ~/.ssh/id_ecdsa , 953.Pa ~/.ssh/id_ecdsa_sk , 954.Pa ~/.ssh/id_ed25519 , 955.Pa ~/.ssh/id_ed25519_sk 956and 957.Pa ~/.ssh/id_rsa . 958Additionally, any identities represented by the authentication agent 959will be used for authentication unless 960.Cm IdentitiesOnly 961is set. 962If no certificates have been explicitly specified by 963.Cm CertificateFile , 964.Xr ssh 1 965will try to load certificate information from the filename obtained by 966appending 967.Pa -cert.pub 968to the path of a specified 969.Cm IdentityFile . 970.Pp 971Arguments to 972.Cm IdentityFile 973may use the tilde syntax to refer to a user's home directory 974or the tokens described in the 975.Sx TOKENS 976section. 977.Pp 978It is possible to have 979multiple identity files specified in configuration files; all these 980identities will be tried in sequence. 981Multiple 982.Cm IdentityFile 983directives will add to the list of identities tried (this behaviour 984differs from that of other configuration directives). 985.Pp 986.Cm IdentityFile 987may be used in conjunction with 988.Cm IdentitiesOnly 989to select which identities in an agent are offered during authentication. 990.Cm IdentityFile 991may also be used in conjunction with 992.Cm CertificateFile 993in order to provide any certificate also needed for authentication with 994the identity. 995.It Cm IgnoreUnknown 996Specifies a pattern-list of unknown options to be ignored if they are 997encountered in configuration parsing. 998This may be used to suppress errors if 999.Nm 1000contains options that are unrecognised by 1001.Xr ssh 1 . 1002It is recommended that 1003.Cm IgnoreUnknown 1004be listed early in the configuration file as it will not be applied 1005to unknown options that appear before it. 1006.It Cm Include 1007Include the specified configuration file(s). 1008Multiple pathnames may be specified and each pathname may contain 1009.Xr glob 7 1010wildcards and, for user configurations, shell-like 1011.Sq ~ 1012references to user home directories. 1013Wildcards will be expanded and processed in lexical order. 1014Files without absolute paths are assumed to be in 1015.Pa ~/.ssh 1016if included in a user configuration file or 1017.Pa /etc/ssh 1018if included from the system configuration file. 1019.Cm Include 1020directive may appear inside a 1021.Cm Match 1022or 1023.Cm Host 1024block 1025to perform conditional inclusion. 1026.It Cm IPQoS 1027Specifies the IPv4 type-of-service or DSCP class for connections. 1028Accepted values are 1029.Cm af11 , 1030.Cm af12 , 1031.Cm af13 , 1032.Cm af21 , 1033.Cm af22 , 1034.Cm af23 , 1035.Cm af31 , 1036.Cm af32 , 1037.Cm af33 , 1038.Cm af41 , 1039.Cm af42 , 1040.Cm af43 , 1041.Cm cs0 , 1042.Cm cs1 , 1043.Cm cs2 , 1044.Cm cs3 , 1045.Cm cs4 , 1046.Cm cs5 , 1047.Cm cs6 , 1048.Cm cs7 , 1049.Cm ef , 1050.Cm le , 1051.Cm lowdelay , 1052.Cm throughput , 1053.Cm reliability , 1054a numeric value, or 1055.Cm none 1056to use the operating system default. 1057This option may take one or two arguments, separated by whitespace. 1058If one argument is specified, it is used as the packet class unconditionally. 1059If two values are specified, the first is automatically selected for 1060interactive sessions and the second for non-interactive sessions. 1061The default is 1062.Cm af21 1063(Low-Latency Data) 1064for interactive sessions and 1065.Cm cs1 1066(Lower Effort) 1067for non-interactive sessions. 1068.It Cm KbdInteractiveAuthentication 1069Specifies whether to use keyboard-interactive authentication. 1070The argument to this keyword must be 1071.Cm yes 1072(the default) 1073or 1074.Cm no . 1075.It Cm KbdInteractiveDevices 1076Specifies the list of methods to use in keyboard-interactive authentication. 1077Multiple method names must be comma-separated. 1078The default is to use the server specified list. 1079The methods available vary depending on what the server supports. 1080For an OpenSSH server, 1081it may be zero or more of: 1082.Cm bsdauth , 1083.Cm pam , 1084and 1085.Cm skey . 1086.It Cm KexAlgorithms 1087Specifies the available KEX (Key Exchange) algorithms. 1088Multiple algorithms must be comma-separated. 1089If the specified list begins with a 1090.Sq + 1091character, then the specified methods will be appended to the default set 1092instead of replacing them. 1093If the specified list begins with a 1094.Sq - 1095character, then the specified methods (including wildcards) will be removed 1096from the default set instead of replacing them. 1097If the specified list begins with a 1098.Sq ^ 1099character, then the specified methods will be placed at the head of the 1100default set. 1101The default is: 1102.Bd -literal -offset indent 1103curve25519-sha256,curve25519-sha256@libssh.org, 1104ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521, 1105diffie-hellman-group-exchange-sha256, 1106diffie-hellman-group16-sha512, 1107diffie-hellman-group18-sha512, 1108diffie-hellman-group14-sha256 1109.Ed 1110.Pp 1111The list of available key exchange algorithms may also be obtained using 1112.Qq ssh -Q kex . 1113.It Cm LocalCommand 1114Specifies a command to execute on the local machine after successfully 1115connecting to the server. 1116The command string extends to the end of the line, and is executed with 1117the user's shell. 1118Arguments to 1119.Cm LocalCommand 1120accept the tokens described in the 1121.Sx TOKENS 1122section. 1123.Pp 1124The command is run synchronously and does not have access to the 1125session of the 1126.Xr ssh 1 1127that spawned it. 1128It should not be used for interactive commands. 1129.Pp 1130This directive is ignored unless 1131.Cm PermitLocalCommand 1132has been enabled. 1133.It Cm LocalForward 1134Specifies that a TCP port on the local machine be forwarded over 1135the secure channel to the specified host and port from the remote machine. 1136The first argument specifies the listener and may be 1137.Sm off 1138.Oo Ar bind_address : Oc Ar port 1139.Sm on 1140or a Unix domain socket path. 1141The second argument is the destination and may be 1142.Ar host : Ns Ar hostport 1143or a Unix domain socket path if the remote host supports it. 1144.Pp 1145IPv6 addresses can be specified by enclosing addresses in square brackets. 1146Multiple forwardings may be specified, and additional forwardings can be 1147given on the command line. 1148Only the superuser can forward privileged ports. 1149By default, the local port is bound in accordance with the 1150.Cm GatewayPorts 1151setting. 1152However, an explicit 1153.Ar bind_address 1154may be used to bind the connection to a specific address. 1155The 1156.Ar bind_address 1157of 1158.Cm localhost 1159indicates that the listening port be bound for local use only, while an 1160empty address or 1161.Sq * 1162indicates that the port should be available from all interfaces. 1163Unix domain socket paths may use the tokens described in the 1164.Sx TOKENS 1165section and environment variables as described in the 1166.Sx ENVIRONMENT VARIABLES 1167section. 1168.It Cm LogLevel 1169Gives the verbosity level that is used when logging messages from 1170.Xr ssh 1 . 1171The possible values are: 1172QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. 1173The default is INFO. 1174DEBUG and DEBUG1 are equivalent. 1175DEBUG2 and DEBUG3 each specify higher levels of verbose output. 1176.It Cm MACs 1177Specifies the MAC (message authentication code) algorithms 1178in order of preference. 1179The MAC algorithm is used for data integrity protection. 1180Multiple algorithms must be comma-separated. 1181If the specified list begins with a 1182.Sq + 1183character, then the specified algorithms will be appended to the default set 1184instead of replacing them. 1185If the specified list begins with a 1186.Sq - 1187character, then the specified algorithms (including wildcards) will be removed 1188from the default set instead of replacing them. 1189If the specified list begins with a 1190.Sq ^ 1191character, then the specified algorithms will be placed at the head of the 1192default set. 1193.Pp 1194The algorithms that contain 1195.Qq -etm 1196calculate the MAC after encryption (encrypt-then-mac). 1197These are considered safer and their use recommended. 1198.Pp 1199The default is: 1200.Bd -literal -offset indent 1201umac-64-etm@openssh.com,umac-128-etm@openssh.com, 1202hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com, 1203hmac-sha1-etm@openssh.com, 1204umac-64@openssh.com,umac-128@openssh.com, 1205hmac-sha2-256,hmac-sha2-512,hmac-sha1 1206.Ed 1207.Pp 1208The list of available MAC algorithms may also be obtained using 1209.Qq ssh -Q mac . 1210.It Cm NoHostAuthenticationForLocalhost 1211Disable host authentication for localhost (loopback addresses). 1212The argument to this keyword must be 1213.Cm yes 1214or 1215.Cm no 1216(the default). 1217.It Cm NumberOfPasswordPrompts 1218Specifies the number of password prompts before giving up. 1219The argument to this keyword must be an integer. 1220The default is 3. 1221.It Cm PasswordAuthentication 1222Specifies whether to use password authentication. 1223The argument to this keyword must be 1224.Cm yes 1225(the default) 1226or 1227.Cm no . 1228.It Cm PermitLocalCommand 1229Allow local command execution via the 1230.Ic LocalCommand 1231option or using the 1232.Ic !\& Ns Ar command 1233escape sequence in 1234.Xr ssh 1 . 1235The argument must be 1236.Cm yes 1237or 1238.Cm no 1239(the default). 1240.It Cm PKCS11Provider 1241Specifies which PKCS#11 provider to use or 1242.Cm none 1243to indicate that no provider should be used (the default). 1244The argument to this keyword is a path to the PKCS#11 shared library 1245.Xr ssh 1 1246should use to communicate with a PKCS#11 token providing keys for user 1247authentication. 1248.It Cm Port 1249Specifies the port number to connect on the remote host. 1250The default is 22. 1251.It Cm PreferredAuthentications 1252Specifies the order in which the client should try authentication methods. 1253This allows a client to prefer one method (e.g.\& 1254.Cm keyboard-interactive ) 1255over another method (e.g.\& 1256.Cm password ) . 1257The default is: 1258.Bd -literal -offset indent 1259gssapi-with-mic,hostbased,publickey, 1260keyboard-interactive,password 1261.Ed 1262.It Cm ProxyCommand 1263Specifies the command to use to connect to the server. 1264The command 1265string extends to the end of the line, and is executed 1266using the user's shell 1267.Ql exec 1268directive to avoid a lingering shell process. 1269.Pp 1270Arguments to 1271.Cm ProxyCommand 1272accept the tokens described in the 1273.Sx TOKENS 1274section. 1275The command can be basically anything, 1276and should read from its standard input and write to its standard output. 1277It should eventually connect an 1278.Xr sshd 8 1279server running on some machine, or execute 1280.Ic sshd -i 1281somewhere. 1282Host key management will be done using the 1283.Cm Hostname 1284of the host being connected (defaulting to the name typed by the user). 1285Setting the command to 1286.Cm none 1287disables this option entirely. 1288Note that 1289.Cm CheckHostIP 1290is not available for connects with a proxy command. 1291.Pp 1292This directive is useful in conjunction with 1293.Xr nc 1 1294and its proxy support. 1295For example, the following directive would connect via an HTTP proxy at 1296192.0.2.0: 1297.Bd -literal -offset 3n 1298ProxyCommand /usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p 1299.Ed 1300.It Cm ProxyJump 1301Specifies one or more jump proxies as either 1302.Xo 1303.Sm off 1304.Op Ar user No @ 1305.Ar host 1306.Op : Ns Ar port 1307.Sm on 1308or an ssh URI 1309.Xc . 1310Multiple proxies may be separated by comma characters and will be visited 1311sequentially. 1312Setting this option will cause 1313.Xr ssh 1 1314to connect to the target host by first making a 1315.Xr ssh 1 1316connection to the specified 1317.Cm ProxyJump 1318host and then establishing a 1319TCP forwarding to the ultimate target from there. 1320.Pp 1321Note that this option will compete with the 1322.Cm ProxyCommand 1323option - whichever is specified first will prevent later instances of the 1324other from taking effect. 1325.Pp 1326Note also that the configuration for the destination host (either supplied 1327via the command-line or the configuration file) is not generally applied 1328to jump hosts. 1329.Pa ~/.ssh/config 1330should be used if specific configuration is required for jump hosts. 1331.It Cm ProxyUseFdpass 1332Specifies that 1333.Cm ProxyCommand 1334will pass a connected file descriptor back to 1335.Xr ssh 1 1336instead of continuing to execute and pass data. 1337The default is 1338.Cm no . 1339.It Cm PubkeyAcceptedKeyTypes 1340Specifies the key types that will be used for public key authentication 1341as a comma-separated list of patterns. 1342If the specified list begins with a 1343.Sq + 1344character, then the key types after it will be appended to the default 1345instead of replacing it. 1346If the specified list begins with a 1347.Sq - 1348character, then the specified key types (including wildcards) will be removed 1349from the default set instead of replacing them. 1350If the specified list begins with a 1351.Sq ^ 1352character, then the specified key types will be placed at the head of the 1353default set. 1354The default for this option is: 1355.Bd -literal -offset 3n 1356ecdsa-sha2-nistp256-cert-v01@openssh.com, 1357ecdsa-sha2-nistp384-cert-v01@openssh.com, 1358ecdsa-sha2-nistp521-cert-v01@openssh.com, 1359sk-ecdsa-sha2-nistp256-cert-v01@openssh.com, 1360ssh-ed25519-cert-v01@openssh.com, 1361sk-ssh-ed25519-cert-v01@openssh.com, 1362rsa-sha2-512-cert-v01@openssh.com, 1363rsa-sha2-256-cert-v01@openssh.com, 1364ssh-rsa-cert-v01@openssh.com, 1365ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, 1366sk-ecdsa-sha2-nistp256@openssh.com, 1367ssh-ed25519,sk-ssh-ed25519@openssh.com, 1368rsa-sha2-512,rsa-sha2-256,ssh-rsa 1369.Ed 1370.Pp 1371The list of available key types may also be obtained using 1372.Qq ssh -Q PubkeyAcceptedKeyTypes . 1373.It Cm PubkeyAuthentication 1374Specifies whether to try public key authentication. 1375The argument to this keyword must be 1376.Cm yes 1377(the default) 1378or 1379.Cm no . 1380.It Cm RekeyLimit 1381Specifies the maximum amount of data that may be transmitted before the 1382session key is renegotiated, optionally followed a maximum amount of 1383time that may pass before the session key is renegotiated. 1384The first argument is specified in bytes and may have a suffix of 1385.Sq K , 1386.Sq M , 1387or 1388.Sq G 1389to indicate Kilobytes, Megabytes, or Gigabytes, respectively. 1390The default is between 1391.Sq 1G 1392and 1393.Sq 4G , 1394depending on the cipher. 1395The optional second value is specified in seconds and may use any of the 1396units documented in the TIME FORMATS section of 1397.Xr sshd_config 5 . 1398The default value for 1399.Cm RekeyLimit 1400is 1401.Cm default none , 1402which means that rekeying is performed after the cipher's default amount 1403of data has been sent or received and no time based rekeying is done. 1404.It Cm RemoteCommand 1405Specifies a command to execute on the remote machine after successfully 1406connecting to the server. 1407The command string extends to the end of the line, and is executed with 1408the user's shell. 1409Arguments to 1410.Cm RemoteCommand 1411accept the tokens described in the 1412.Sx TOKENS 1413section. 1414.It Cm RemoteForward 1415Specifies that a TCP port on the remote machine be forwarded over 1416the secure channel. 1417The remote port may either be forwarded to a specified host and port 1418from the local machine, or may act as a SOCKS 4/5 proxy that allows a remote 1419client to connect to arbitrary destinations from the local machine. 1420The first argument is the listening specification and may be 1421.Sm off 1422.Oo Ar bind_address : Oc Ar port 1423.Sm on 1424or, if the remote host supports it, a Unix domain socket path. 1425If forwarding to a specific destination then the second argument must be 1426.Ar host : Ns Ar hostport 1427or a Unix domain socket path, 1428otherwise if no destination argument is specified then the remote forwarding 1429will be established as a SOCKS proxy. 1430.Pp 1431IPv6 addresses can be specified by enclosing addresses in square brackets. 1432Multiple forwardings may be specified, and additional 1433forwardings can be given on the command line. 1434Privileged ports can be forwarded only when 1435logging in as root on the remote machine. 1436Unix domain socket paths may use the tokens described in the 1437.Sx TOKENS 1438section and environment variables as described in the 1439.Sx ENVIRONMENT VARIABLES 1440section. 1441.Pp 1442If the 1443.Ar port 1444argument is 0, 1445the listen port will be dynamically allocated on the server and reported 1446to the client at run time. 1447.Pp 1448If the 1449.Ar bind_address 1450is not specified, the default is to only bind to loopback addresses. 1451If the 1452.Ar bind_address 1453is 1454.Ql * 1455or an empty string, then the forwarding is requested to listen on all 1456interfaces. 1457Specifying a remote 1458.Ar bind_address 1459will only succeed if the server's 1460.Cm GatewayPorts 1461option is enabled (see 1462.Xr sshd_config 5 ) . 1463.It Cm RequestTTY 1464Specifies whether to request a pseudo-tty for the session. 1465The argument may be one of: 1466.Cm no 1467(never request a TTY), 1468.Cm yes 1469(always request a TTY when standard input is a TTY), 1470.Cm force 1471(always request a TTY) or 1472.Cm auto 1473(request a TTY when opening a login session). 1474This option mirrors the 1475.Fl t 1476and 1477.Fl T 1478flags for 1479.Xr ssh 1 . 1480.It Cm RevokedHostKeys 1481Specifies revoked host public keys. 1482Keys listed in this file will be refused for host authentication. 1483Note that if this file does not exist or is not readable, 1484then host authentication will be refused for all hosts. 1485Keys may be specified as a text file, listing one public key per line, or as 1486an OpenSSH Key Revocation List (KRL) as generated by 1487.Xr ssh-keygen 1 . 1488For more information on KRLs, see the KEY REVOCATION LISTS section in 1489.Xr ssh-keygen 1 . 1490.It Cm SecurityKeyProvider 1491Specifies a path to a library that will be used when loading any 1492FIDO authenticator-hosted keys, overriding the default of using 1493the built-in USB HID support. 1494.Pp 1495If the specified value begins with a 1496.Sq $ 1497character, then it will be treated as an environment variable containing 1498the path to the library. 1499.It Cm SendEnv 1500Specifies what variables from the local 1501.Xr environ 7 1502should be sent to the server. 1503The server must also support it, and the server must be configured to 1504accept these environment variables. 1505Note that the 1506.Ev TERM 1507environment variable is always sent whenever a 1508pseudo-terminal is requested as it is required by the protocol. 1509Refer to 1510.Cm AcceptEnv 1511in 1512.Xr sshd_config 5 1513for how to configure the server. 1514Variables are specified by name, which may contain wildcard characters. 1515Multiple environment variables may be separated by whitespace or spread 1516across multiple 1517.Cm SendEnv 1518directives. 1519.Pp 1520See 1521.Sx PATTERNS 1522for more information on patterns. 1523.Pp 1524It is possible to clear previously set 1525.Cm SendEnv 1526variable names by prefixing patterns with 1527.Pa - . 1528The default is not to send any environment variables. 1529.It Cm ServerAliveCountMax 1530Sets the number of server alive messages (see below) which may be 1531sent without 1532.Xr ssh 1 1533receiving any messages back from the server. 1534If this threshold is reached while server alive messages are being sent, 1535ssh will disconnect from the server, terminating the session. 1536It is important to note that the use of server alive messages is very 1537different from 1538.Cm TCPKeepAlive 1539(below). 1540The server alive messages are sent through the encrypted channel 1541and therefore will not be spoofable. 1542The TCP keepalive option enabled by 1543.Cm TCPKeepAlive 1544is spoofable. 1545The server alive mechanism is valuable when the client or 1546server depend on knowing when a connection has become unresponsive. 1547.Pp 1548The default value is 3. 1549If, for example, 1550.Cm ServerAliveInterval 1551(see below) is set to 15 and 1552.Cm ServerAliveCountMax 1553is left at the default, if the server becomes unresponsive, 1554ssh will disconnect after approximately 45 seconds. 1555.It Cm ServerAliveInterval 1556Sets a timeout interval in seconds after which if no data has been received 1557from the server, 1558.Xr ssh 1 1559will send a message through the encrypted 1560channel to request a response from the server. 1561The default 1562is 0, indicating that these messages will not be sent to the server. 1563.It Cm SetEnv 1564Directly specify one or more environment variables and their contents to 1565be sent to the server. 1566Similarly to 1567.Cm SendEnv , 1568the server must be prepared to accept the environment variable. 1569.It Cm StreamLocalBindMask 1570Sets the octal file creation mode mask 1571.Pq umask 1572used when creating a Unix-domain socket file for local or remote 1573port forwarding. 1574This option is only used for port forwarding to a Unix-domain socket file. 1575.Pp 1576The default value is 0177, which creates a Unix-domain socket file that is 1577readable and writable only by the owner. 1578Note that not all operating systems honor the file mode on Unix-domain 1579socket files. 1580.It Cm StreamLocalBindUnlink 1581Specifies whether to remove an existing Unix-domain socket file for local 1582or remote port forwarding before creating a new one. 1583If the socket file already exists and 1584.Cm StreamLocalBindUnlink 1585is not enabled, 1586.Nm ssh 1587will be unable to forward the port to the Unix-domain socket file. 1588This option is only used for port forwarding to a Unix-domain socket file. 1589.Pp 1590The argument must be 1591.Cm yes 1592or 1593.Cm no 1594(the default). 1595.It Cm StrictHostKeyChecking 1596If this flag is set to 1597.Cm yes , 1598.Xr ssh 1 1599will never automatically add host keys to the 1600.Pa ~/.ssh/known_hosts 1601file, and refuses to connect to hosts whose host key has changed. 1602This provides maximum protection against man-in-the-middle (MITM) attacks, 1603though it can be annoying when the 1604.Pa /etc/ssh/ssh_known_hosts 1605file is poorly maintained or when connections to new hosts are 1606frequently made. 1607This option forces the user to manually 1608add all new hosts. 1609.Pp 1610If this flag is set to 1611.Dq accept-new 1612then ssh will automatically add new host keys to the user 1613known hosts files, but will not permit connections to hosts with 1614changed host keys. 1615If this flag is set to 1616.Dq no 1617or 1618.Dq off , 1619ssh will automatically add new host keys to the user known hosts files 1620and allow connections to hosts with changed hostkeys to proceed, 1621subject to some restrictions. 1622If this flag is set to 1623.Cm ask 1624(the default), 1625new host keys 1626will be added to the user known host files only after the user 1627has confirmed that is what they really want to do, and 1628ssh will refuse to connect to hosts whose host key has changed. 1629The host keys of 1630known hosts will be verified automatically in all cases. 1631.It Cm SyslogFacility 1632Gives the facility code that is used when logging messages from 1633.Xr ssh 1 . 1634The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2, 1635LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. 1636The default is USER. 1637.It Cm TCPKeepAlive 1638Specifies whether the system should send TCP keepalive messages to the 1639other side. 1640If they are sent, death of the connection or crash of one 1641of the machines will be properly noticed. 1642However, this means that 1643connections will die if the route is down temporarily, and some people 1644find it annoying. 1645.Pp 1646The default is 1647.Cm yes 1648(to send TCP keepalive messages), and the client will notice 1649if the network goes down or the remote host dies. 1650This is important in scripts, and many users want it too. 1651.Pp 1652To disable TCP keepalive messages, the value should be set to 1653.Cm no . 1654See also 1655.Cm ServerAliveInterval 1656for protocol-level keepalives. 1657.It Cm Tunnel 1658Request 1659.Xr tun 4 1660device forwarding between the client and the server. 1661The argument must be 1662.Cm yes , 1663.Cm point-to-point 1664(layer 3), 1665.Cm ethernet 1666(layer 2), 1667or 1668.Cm no 1669(the default). 1670Specifying 1671.Cm yes 1672requests the default tunnel mode, which is 1673.Cm point-to-point . 1674.It Cm TunnelDevice 1675Specifies the 1676.Xr tun 4 1677devices to open on the client 1678.Pq Ar local_tun 1679and the server 1680.Pq Ar remote_tun . 1681.Pp 1682The argument must be 1683.Sm off 1684.Ar local_tun Op : Ar remote_tun . 1685.Sm on 1686The devices may be specified by numerical ID or the keyword 1687.Cm any , 1688which uses the next available tunnel device. 1689If 1690.Ar remote_tun 1691is not specified, it defaults to 1692.Cm any . 1693The default is 1694.Cm any:any . 1695.It Cm UpdateHostKeys 1696Specifies whether 1697.Xr ssh 1 1698should accept notifications of additional hostkeys from the server sent 1699after authentication has completed and add them to 1700.Cm UserKnownHostsFile . 1701The argument must be 1702.Cm yes , 1703.Cm no 1704or 1705.Cm ask . 1706This option allows learning alternate hostkeys for a server 1707and supports graceful key rotation by allowing a server to send replacement 1708public keys before old ones are removed. 1709Additional hostkeys are only accepted if the key used to authenticate the 1710host was already trusted or explicitly accepted by the user. 1711.Pp 1712.Cm UpdateHostKeys 1713is enabled by default if the user has not overridden the default 1714.Cm UserKnownHostsFile 1715setting, otherwise 1716.Cm UpdateHostKeys 1717will be set to 1718.Cm ask . 1719.Pp 1720If 1721.Cm UpdateHostKeys 1722is set to 1723.Cm ask , 1724then the user is asked to confirm the modifications to the known_hosts file. 1725Confirmation is currently incompatible with 1726.Cm ControlPersist , 1727and will be disabled if it is enabled. 1728.Pp 1729Presently, only 1730.Xr sshd 8 1731from OpenSSH 6.8 and greater support the 1732.Qq hostkeys@openssh.com 1733protocol extension used to inform the client of all the server's hostkeys. 1734.It Cm User 1735Specifies the user to log in as. 1736This can be useful when a different user name is used on different machines. 1737This saves the trouble of 1738having to remember to give the user name on the command line. 1739.It Cm UserKnownHostsFile 1740Specifies one or more files to use for the user 1741host key database, separated by whitespace. 1742The default is 1743.Pa ~/.ssh/known_hosts , 1744.Pa ~/.ssh/known_hosts2 . 1745.It Cm VerifyHostKeyDNS 1746Specifies whether to verify the remote key using DNS and SSHFP resource 1747records. 1748If this option is set to 1749.Cm yes , 1750the client will implicitly trust keys that match a secure fingerprint 1751from DNS. 1752Insecure fingerprints will be handled as if this option was set to 1753.Cm ask . 1754If this option is set to 1755.Cm ask , 1756information on fingerprint match will be displayed, but the user will still 1757need to confirm new host keys according to the 1758.Cm StrictHostKeyChecking 1759option. 1760The default is 1761.Cm no . 1762.Pp 1763See also 1764.Sx VERIFYING HOST KEYS 1765in 1766.Xr ssh 1 . 1767.It Cm VisualHostKey 1768If this flag is set to 1769.Cm yes , 1770an ASCII art representation of the remote host key fingerprint is 1771printed in addition to the fingerprint string at login and 1772for unknown host keys. 1773If this flag is set to 1774.Cm no 1775(the default), 1776no fingerprint strings are printed at login and 1777only the fingerprint string will be printed for unknown host keys. 1778.It Cm XAuthLocation 1779Specifies the full pathname of the 1780.Xr xauth 1 1781program. 1782The default is 1783.Pa /usr/X11R6/bin/xauth . 1784.El 1785.Sh PATTERNS 1786A 1787.Em pattern 1788consists of zero or more non-whitespace characters, 1789.Sq * 1790(a wildcard that matches zero or more characters), 1791or 1792.Sq ?\& 1793(a wildcard that matches exactly one character). 1794For example, to specify a set of declarations for any host in the 1795.Qq .co.uk 1796set of domains, 1797the following pattern could be used: 1798.Pp 1799.Dl Host *.co.uk 1800.Pp 1801The following pattern 1802would match any host in the 192.168.0.[0-9] network range: 1803.Pp 1804.Dl Host 192.168.0.? 1805.Pp 1806A 1807.Em pattern-list 1808is a comma-separated list of patterns. 1809Patterns within pattern-lists may be negated 1810by preceding them with an exclamation mark 1811.Pq Sq !\& . 1812For example, 1813to allow a key to be used from anywhere within an organization 1814except from the 1815.Qq dialup 1816pool, 1817the following entry (in authorized_keys) could be used: 1818.Pp 1819.Dl from=\&"!*.dialup.example.com,*.example.com\&" 1820.Pp 1821Note that a negated match will never produce a positive result by itself. 1822For example, attempting to match 1823.Qq host3 1824against the following pattern-list will fail: 1825.Pp 1826.Dl from=\&"!host1,!host2\&" 1827.Pp 1828The solution here is to include a term that will yield a positive match, 1829such as a wildcard: 1830.Pp 1831.Dl from=\&"!host1,!host2,*\&" 1832.Sh TOKENS 1833Arguments to some keywords can make use of tokens, 1834which are expanded at runtime: 1835.Pp 1836.Bl -tag -width XXXX -offset indent -compact 1837.It %% 1838A literal 1839.Sq % . 1840.It \&%C 1841Hash of %l%h%p%r. 1842.It %d 1843Local user's home directory. 1844.It %h 1845The remote hostname. 1846.It %i 1847The local user ID. 1848.It %L 1849The local hostname. 1850.It %l 1851The local hostname, including the domain name. 1852.It %n 1853The original remote hostname, as given on the command line. 1854.It %p 1855The remote port. 1856.It %r 1857The remote username. 1858.It \&%T 1859The local 1860.Xr tun 4 1861or 1862.Xr tap 4 1863network interface assigned if 1864tunnel forwarding was requested, or 1865.Qq NONE 1866otherwise. 1867.It %u 1868The local username. 1869.El 1870.Pp 1871.Cm CertificateFile , 1872.Cm ControlPath , 1873.Cm IdentityAgent , 1874.Cm IdentityFile , 1875.Cm LocalForward , 1876.Cm Match exec , 1877.Cm RemoteCommand , 1878and 1879.Cm RemoteForward 1880accept the tokens %%, %C, %d, %h, %i, %L, %l, %n, %p, %r, and %u. 1881.Pp 1882.Cm Hostname 1883accepts the tokens %% and %h. 1884.Pp 1885.Cm LocalCommand 1886accepts all tokens. 1887.Pp 1888.Cm ProxyCommand 1889accepts the tokens %%, %h, %n, %p, and %r. 1890.Sh ENVIRONMENT VARIABLES 1891Arguments to some keywords can be expanded at runtime from environment 1892variables on the client by enclosing them in 1893.Ic ${} , 1894for example 1895.Ic ${HOME}/.ssh 1896would refer to the user's .ssh directory. 1897If a specified environment variable does not exist then an error will be 1898returned and the setting for that keyword will be ignored. 1899.Pp 1900The keywords 1901.Cm CertificateFile , 1902.Cm ControlPath , 1903.Cm IdentityAgent 1904and 1905.Cm IdentityFile 1906support environment variables. 1907The keywords 1908.Cm LocalForward 1909and 1910.Cm RemoteForward 1911support environment variables only for Unix domain socket paths. 1912.Sh FILES 1913.Bl -tag -width Ds 1914.It Pa ~/.ssh/config 1915This is the per-user configuration file. 1916The format of this file is described above. 1917This file is used by the SSH client. 1918Because of the potential for abuse, this file must have strict permissions: 1919read/write for the user, and not writable by others. 1920.It Pa /etc/ssh/ssh_config 1921Systemwide configuration file. 1922This file provides defaults for those 1923values that are not specified in the user's configuration file, and 1924for those users who do not have a configuration file. 1925This file must be world-readable. 1926.El 1927.Sh SEE ALSO 1928.Xr ssh 1 1929.Sh AUTHORS 1930.An -nosplit 1931OpenSSH is a derivative of the original and free 1932ssh 1.2.12 release by 1933.An Tatu Ylonen . 1934.An Aaron Campbell , Bob Beck , Markus Friedl , 1935.An Niels Provos , Theo de Raadt 1936and 1937.An Dug Song 1938removed many bugs, re-added newer features and 1939created OpenSSH. 1940.An Markus Friedl 1941contributed the support for SSH protocol versions 1.5 and 2.0. 1942