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