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: sshd_config.5,v 1.284 2019/03/22 20:58:34 jmc Exp $ 37.Dd $Mdocdate: March 22 2019 $ 38.Dt SSHD_CONFIG 5 39.Os 40.Sh NAME 41.Nm sshd_config 42.Nd OpenSSH SSH daemon configuration file 43.Sh DESCRIPTION 44.Xr sshd 8 45reads configuration data from 46.Pa /etc/ssh/sshd_config 47(or the file specified with 48.Fl f 49on the command line). 50The file contains keyword-argument pairs, one per line. 51For each keyword, the first obtained value will be used. 52Lines starting with 53.Ql # 54and empty lines are interpreted as comments. 55Arguments may optionally be enclosed in double quotes 56.Pq \&" 57in order to represent arguments containing spaces. 58.Pp 59The possible 60keywords and their meanings are as follows (note that 61keywords are case-insensitive and arguments are case-sensitive): 62.Bl -tag -width Ds 63.It Cm AcceptEnv 64Specifies what environment variables sent by the client will be copied into 65the session's 66.Xr environ 7 . 67See 68.Cm SendEnv 69and 70.Cm SetEnv 71in 72.Xr ssh_config 5 73for how to configure the client. 74The 75.Ev TERM 76environment variable is always accepted whenever the client 77requests a pseudo-terminal as it is required by the protocol. 78Variables are specified by name, which may contain the wildcard characters 79.Ql * 80and 81.Ql \&? . 82Multiple environment variables may be separated by whitespace or spread 83across multiple 84.Cm AcceptEnv 85directives. 86Be warned that some environment variables could be used to bypass restricted 87user environments. 88For this reason, care should be taken in the use of this directive. 89The default is not to accept any environment variables. 90.It Cm AddressFamily 91Specifies which address family should be used by 92.Xr sshd 8 . 93Valid arguments are 94.Cm any 95(the default), 96.Cm inet 97(use IPv4 only), or 98.Cm inet6 99(use IPv6 only). 100.It Cm AllowAgentForwarding 101Specifies whether 102.Xr ssh-agent 1 103forwarding is permitted. 104The default is 105.Cm yes . 106Note that disabling agent forwarding does not improve security 107unless users are also denied shell access, as they can always install 108their own forwarders. 109.It Cm AllowGroups 110This keyword can be followed by a list of group name patterns, separated 111by spaces. 112If specified, login is allowed only for users whose primary 113group or supplementary group list matches one of the patterns. 114Only group names are valid; a numerical group ID is not recognized. 115By default, login is allowed for all groups. 116The allow/deny directives are processed in the following order: 117.Cm DenyUsers , 118.Cm AllowUsers , 119.Cm DenyGroups , 120and finally 121.Cm AllowGroups . 122.Pp 123See PATTERNS in 124.Xr ssh_config 5 125for more information on patterns. 126.It Cm AllowStreamLocalForwarding 127Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted. 128The available options are 129.Cm yes 130(the default) 131or 132.Cm all 133to allow StreamLocal forwarding, 134.Cm no 135to prevent all StreamLocal forwarding, 136.Cm local 137to allow local (from the perspective of 138.Xr ssh 1 ) 139forwarding only or 140.Cm remote 141to allow remote forwarding only. 142Note that disabling StreamLocal forwarding does not improve security unless 143users are also denied shell access, as they can always install their 144own forwarders. 145.It Cm AllowTcpForwarding 146Specifies whether TCP forwarding is permitted. 147The available options are 148.Cm yes 149(the default) 150or 151.Cm all 152to allow TCP forwarding, 153.Cm no 154to prevent all TCP forwarding, 155.Cm local 156to allow local (from the perspective of 157.Xr ssh 1 ) 158forwarding only or 159.Cm remote 160to allow remote forwarding only. 161Note that disabling TCP forwarding does not improve security unless 162users are also denied shell access, as they can always install their 163own forwarders. 164.It Cm AllowUsers 165This keyword can be followed by a list of user name patterns, separated 166by spaces. 167If specified, login is allowed only for user names that 168match one of the patterns. 169Only user names are valid; a numerical user ID is not recognized. 170By default, login is allowed for all users. 171If the pattern takes the form USER@HOST then USER and HOST 172are separately checked, restricting logins to particular 173users from particular hosts. 174HOST criteria may additionally contain addresses to match in CIDR 175address/masklen format. 176The allow/deny directives are processed in the following order: 177.Cm DenyUsers , 178.Cm AllowUsers , 179.Cm DenyGroups , 180and finally 181.Cm AllowGroups . 182.Pp 183See PATTERNS in 184.Xr ssh_config 5 185for more information on patterns. 186.It Cm AuthenticationMethods 187Specifies the authentication methods that must be successfully completed 188for a user to be granted access. 189This option must be followed by one or more lists of comma-separated 190authentication method names, or by the single string 191.Cm any 192to indicate the default behaviour of accepting any single authentication 193method. 194If the default is overridden, then successful authentication requires 195completion of every method in at least one of these lists. 196.Pp 197For example, 198.Qq publickey,password publickey,keyboard-interactive 199would require the user to complete public key authentication, followed by 200either password or keyboard interactive authentication. 201Only methods that are next in one or more lists are offered at each stage, 202so for this example it would not be possible to attempt password or 203keyboard-interactive authentication before public key. 204.Pp 205For keyboard interactive authentication it is also possible to 206restrict authentication to a specific device by appending a 207colon followed by the device identifier 208.Cm bsdauth 209or 210.Cm pam . 211depending on the server configuration. 212For example, 213.Qq keyboard-interactive:bsdauth 214would restrict keyboard interactive authentication to the 215.Cm bsdauth 216device. 217.Pp 218If the publickey method is listed more than once, 219.Xr sshd 8 220verifies that keys that have been used successfully are not reused for 221subsequent authentications. 222For example, 223.Qq publickey,publickey 224requires successful authentication using two different public keys. 225.Pp 226Note that each authentication method listed should also be explicitly enabled 227in the configuration. 228.Pp 229The available authentication methods are: 230.Qq gssapi-with-mic , 231.Qq hostbased , 232.Qq keyboard-interactive , 233.Qq none 234(used for access to password-less accounts when 235.Cm PermitEmptyPasswords 236is enabled), 237.Qq password 238and 239.Qq publickey . 240.It Cm AuthorizedKeysCommand 241Specifies a program to be used to look up the user's public keys. 242The program must be owned by root, not writable by group or others and 243specified by an absolute path. 244Arguments to 245.Cm AuthorizedKeysCommand 246accept the tokens described in the 247.Sx TOKENS 248section. 249If no arguments are specified then the username of the target user is used. 250.Pp 251The program should produce on standard output zero or 252more lines of authorized_keys output (see 253.Sx AUTHORIZED_KEYS 254in 255.Xr sshd 8 ) . 256If a key supplied by 257.Cm AuthorizedKeysCommand 258does not successfully authenticate 259and authorize the user then public key authentication continues using the usual 260.Cm AuthorizedKeysFile 261files. 262By default, no 263.Cm AuthorizedKeysCommand 264is run. 265.It Cm AuthorizedKeysCommandUser 266Specifies the user under whose account the 267.Cm AuthorizedKeysCommand 268is run. 269It is recommended to use a dedicated user that has no other role on the host 270than running authorized keys commands. 271If 272.Cm AuthorizedKeysCommand 273is specified but 274.Cm AuthorizedKeysCommandUser 275is not, then 276.Xr sshd 8 277will refuse to start. 278.It Cm AuthorizedKeysFile 279Specifies the file that contains the public keys used for user authentication. 280The format is described in the 281.Sx AUTHORIZED_KEYS FILE FORMAT 282section of 283.Xr sshd 8 . 284Arguments to 285.Cm AuthorizedKeysFile 286accept the tokens described in the 287.Sx TOKENS 288section. 289After expansion, 290.Cm AuthorizedKeysFile 291is taken to be an absolute path or one relative to the user's home 292directory. 293Multiple files may be listed, separated by whitespace. 294Alternately this option may be set to 295.Cm none 296to skip checking for user keys in files. 297The default is 298.Qq .ssh/authorized_keys .ssh/authorized_keys2 . 299.It Cm AuthorizedPrincipalsCommand 300Specifies a program to be used to generate the list of allowed 301certificate principals as per 302.Cm AuthorizedPrincipalsFile . 303The program must be owned by root, not writable by group or others and 304specified by an absolute path. 305Arguments to 306.Cm AuthorizedPrincipalsCommand 307accept the tokens described in the 308.Sx TOKENS 309section. 310If no arguments are specified then the username of the target user is used. 311.Pp 312The program should produce on standard output zero or 313more lines of 314.Cm AuthorizedPrincipalsFile 315output. 316If either 317.Cm AuthorizedPrincipalsCommand 318or 319.Cm AuthorizedPrincipalsFile 320is specified, then certificates offered by the client for authentication 321must contain a principal that is listed. 322By default, no 323.Cm AuthorizedPrincipalsCommand 324is run. 325.It Cm AuthorizedPrincipalsCommandUser 326Specifies the user under whose account the 327.Cm AuthorizedPrincipalsCommand 328is run. 329It is recommended to use a dedicated user that has no other role on the host 330than running authorized principals commands. 331If 332.Cm AuthorizedPrincipalsCommand 333is specified but 334.Cm AuthorizedPrincipalsCommandUser 335is not, then 336.Xr sshd 8 337will refuse to start. 338.It Cm AuthorizedPrincipalsFile 339Specifies a file that lists principal names that are accepted for 340certificate authentication. 341When using certificates signed by a key listed in 342.Cm TrustedUserCAKeys , 343this file lists names, one of which must appear in the certificate for it 344to be accepted for authentication. 345Names are listed one per line preceded by key options (as described in 346.Sx AUTHORIZED_KEYS FILE FORMAT 347in 348.Xr sshd 8 ) . 349Empty lines and comments starting with 350.Ql # 351are ignored. 352.Pp 353Arguments to 354.Cm AuthorizedPrincipalsFile 355accept the tokens described in the 356.Sx TOKENS 357section. 358After expansion, 359.Cm AuthorizedPrincipalsFile 360is taken to be an absolute path or one relative to the user's home directory. 361The default is 362.Cm none , 363i.e. not to use a principals file \(en in this case, the username 364of the user must appear in a certificate's principals list for it to be 365accepted. 366.Pp 367Note that 368.Cm AuthorizedPrincipalsFile 369is only used when authentication proceeds using a CA listed in 370.Cm TrustedUserCAKeys 371and is not consulted for certification authorities trusted via 372.Pa ~/.ssh/authorized_keys , 373though the 374.Cm principals= 375key option offers a similar facility (see 376.Xr sshd 8 377for details). 378.It Cm Banner 379The contents of the specified file are sent to the remote user before 380authentication is allowed. 381If the argument is 382.Cm none 383then no banner is displayed. 384By default, no banner is displayed. 385.It Cm CASignatureAlgorithms 386Specifies which algorithms are allowed for signing of certificates 387by certificate authorities (CAs). 388The default is: 389.Bd -literal -offset indent 390ecdsa-sha2-nistp256.ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, 391ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa 392.Ed 393.Pp 394Certificates signed using other algorithms will not be accepted for 395public key or host-based authentication. 396.It Cm ChallengeResponseAuthentication 397Specifies whether challenge-response authentication is allowed (e.g. via 398PAM or through authentication styles supported in 399.Xr login.conf 5 ) 400The default is 401.Cm yes . 402.It Cm ChrootDirectory 403Specifies the pathname of a directory to 404.Xr chroot 2 405to after authentication. 406At session startup 407.Xr sshd 8 408checks that all components of the pathname are root-owned directories 409which are not writable by any other user or group. 410After the chroot, 411.Xr sshd 8 412changes the working directory to the user's home directory. 413Arguments to 414.Cm ChrootDirectory 415accept the tokens described in the 416.Sx TOKENS 417section. 418.Pp 419The 420.Cm ChrootDirectory 421must contain the necessary files and directories to support the 422user's session. 423For an interactive session this requires at least a shell, typically 424.Xr sh 1 , 425and basic 426.Pa /dev 427nodes such as 428.Xr null 4 , 429.Xr zero 4 , 430.Xr stdin 4 , 431.Xr stdout 4 , 432.Xr stderr 4 , 433and 434.Xr tty 4 435devices. 436For file transfer sessions using SFTP 437no additional configuration of the environment is necessary if the in-process 438sftp-server is used, 439though sessions which use logging may require 440.Pa /dev/log 441inside the chroot directory on some operating systems (see 442.Xr sftp-server 8 443for details). 444.Pp 445For safety, it is very important that the directory hierarchy be 446prevented from modification by other processes on the system (especially 447those outside the jail). 448Misconfiguration can lead to unsafe environments which 449.Xr sshd 8 450cannot detect. 451.Pp 452The default is 453.Cm none , 454indicating not to 455.Xr chroot 2 . 456.It Cm Ciphers 457Specifies the ciphers allowed. 458Multiple ciphers must be comma-separated. 459If the specified value begins with a 460.Sq + 461character, then the specified ciphers will be appended to the default set 462instead of replacing them. 463If the specified value begins with a 464.Sq - 465character, then the specified ciphers (including wildcards) will be removed 466from the default set instead of replacing them. 467.Pp 468The supported ciphers are: 469.Pp 470.Bl -item -compact -offset indent 471.It 4723des-cbc 473.It 474aes128-cbc 475.It 476aes192-cbc 477.It 478aes256-cbc 479.It 480aes128-ctr 481.It 482aes192-ctr 483.It 484aes256-ctr 485.It 486aes128-gcm@openssh.com 487.It 488aes256-gcm@openssh.com 489.It 490chacha20-poly1305@openssh.com 491.El 492.Pp 493The default is: 494.Bd -literal -offset indent 495chacha20-poly1305@openssh.com, 496aes128-ctr,aes192-ctr,aes256-ctr, 497aes128-gcm@openssh.com,aes256-gcm@openssh.com 498.Ed 499.Pp 500The list of available ciphers may also be obtained using 501.Qq ssh -Q cipher . 502.It Cm ClientAliveCountMax 503Sets the number of client alive messages which may be sent without 504.Xr sshd 8 505receiving any messages back from the client. 506If this threshold is reached while client alive messages are being sent, 507sshd will disconnect the client, terminating the session. 508It is important to note that the use of client alive messages is very 509different from 510.Cm TCPKeepAlive . 511The client alive messages are sent through the encrypted channel 512and therefore will not be spoofable. 513The TCP keepalive option enabled by 514.Cm TCPKeepAlive 515is spoofable. 516The client alive mechanism is valuable when the client or 517server depend on knowing when a connection has become inactive. 518.Pp 519The default value is 3. 520If 521.Cm ClientAliveInterval 522is set to 15, and 523.Cm ClientAliveCountMax 524is left at the default, unresponsive SSH clients 525will be disconnected after approximately 45 seconds. 526.It Cm ClientAliveInterval 527Sets a timeout interval in seconds after which if no data has been received 528from the client, 529.Xr sshd 8 530will send a message through the encrypted 531channel to request a response from the client. 532The default 533is 0, indicating that these messages will not be sent to the client. 534.It Cm Compression 535Specifies whether compression is enabled after 536the user has authenticated successfully. 537The argument must be 538.Cm yes , 539.Cm delayed 540(a legacy synonym for 541.Cm yes ) 542or 543.Cm no . 544The default is 545.Cm yes . 546.It Cm DenyGroups 547This keyword can be followed by a list of group name patterns, separated 548by spaces. 549Login is disallowed for users whose primary group or supplementary 550group list matches one of the patterns. 551Only group names are valid; a numerical group ID is not recognized. 552By default, login is allowed for all groups. 553The allow/deny directives are processed in the following order: 554.Cm DenyUsers , 555.Cm AllowUsers , 556.Cm DenyGroups , 557and finally 558.Cm AllowGroups . 559.Pp 560See PATTERNS in 561.Xr ssh_config 5 562for more information on patterns. 563.It Cm DenyUsers 564This keyword can be followed by a list of user name patterns, separated 565by spaces. 566Login is disallowed for user names that match one of the patterns. 567Only user names are valid; a numerical user ID is not recognized. 568By default, login is allowed for all users. 569If the pattern takes the form USER@HOST then USER and HOST 570are separately checked, restricting logins to particular 571users from particular hosts. 572HOST criteria may additionally contain addresses to match in CIDR 573address/masklen format. 574The allow/deny directives are processed in the following order: 575.Cm DenyUsers , 576.Cm AllowUsers , 577.Cm DenyGroups , 578and finally 579.Cm AllowGroups . 580.Pp 581See PATTERNS in 582.Xr ssh_config 5 583for more information on patterns. 584.It Cm DisableForwarding 585Disables all forwarding features, including X11, 586.Xr ssh-agent 1 , 587TCP and StreamLocal. 588This option overrides all other forwarding-related options and may 589simplify restricted configurations. 590.It Cm ExposeAuthInfo 591Writes a temporary file containing a list of authentication methods and 592public credentials (e.g. keys) used to authenticate the user. 593The location of the file is exposed to the user session through the 594.Ev SSH_USER_AUTH 595environment variable. 596The default is 597.Cm no . 598.It Cm FingerprintHash 599Specifies the hash algorithm used when logging key fingerprints. 600Valid options are: 601.Cm md5 602and 603.Cm sha256 . 604The default is 605.Cm sha256 . 606.It Cm ForceCommand 607Forces the execution of the command specified by 608.Cm ForceCommand , 609ignoring any command supplied by the client and 610.Pa ~/.ssh/rc 611if present. 612The command is invoked by using the user's login shell with the -c option. 613This applies to shell, command, or subsystem execution. 614It is most useful inside a 615.Cm Match 616block. 617The command originally supplied by the client is available in the 618.Ev SSH_ORIGINAL_COMMAND 619environment variable. 620Specifying a command of 621.Cm internal-sftp 622will force the use of an in-process SFTP server that requires no support 623files when used with 624.Cm ChrootDirectory . 625The default is 626.Cm none . 627.It Cm GatewayPorts 628Specifies whether remote hosts are allowed to connect to ports 629forwarded for the client. 630By default, 631.Xr sshd 8 632binds remote port forwardings to the loopback address. 633This prevents other remote hosts from connecting to forwarded ports. 634.Cm GatewayPorts 635can be used to specify that sshd 636should allow remote port forwardings to bind to non-loopback addresses, thus 637allowing other hosts to connect. 638The argument may be 639.Cm no 640to force remote port forwardings to be available to the local host only, 641.Cm yes 642to force remote port forwardings to bind to the wildcard address, or 643.Cm clientspecified 644to allow the client to select the address to which the forwarding is bound. 645The default is 646.Cm no . 647.It Cm GSSAPIAuthentication 648Specifies whether user authentication based on GSSAPI is allowed. 649The default is 650.Cm no . 651.It Cm GSSAPICleanupCredentials 652Specifies whether to automatically destroy the user's credentials cache 653on logout. 654The default is 655.Cm yes . 656.It Cm GSSAPIStrictAcceptorCheck 657Determines whether to be strict about the identity of the GSSAPI acceptor 658a client authenticates against. 659If set to 660.Cm yes 661then the client must authenticate against the host 662service on the current hostname. 663If set to 664.Cm no 665then the client may authenticate against any service key stored in the 666machine's default store. 667This facility is provided to assist with operation on multi homed machines. 668The default is 669.Cm yes . 670.It Cm HostbasedAcceptedKeyTypes 671Specifies the key types that will be accepted for hostbased authentication 672as a list of comma-separated patterns. 673Alternately if the specified value begins with a 674.Sq + 675character, then the specified key types will be appended to the default set 676instead of replacing them. 677If the specified value begins with a 678.Sq - 679character, then the specified key types (including wildcards) will be removed 680from the default set instead of replacing them. 681The default for this option is: 682.Bd -literal -offset 3n 683ecdsa-sha2-nistp256-cert-v01@openssh.com, 684ecdsa-sha2-nistp384-cert-v01@openssh.com, 685ecdsa-sha2-nistp521-cert-v01@openssh.com, 686ssh-ed25519-cert-v01@openssh.com, 687rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com, 688ssh-rsa-cert-v01@openssh.com, 689ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, 690ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa 691.Ed 692.Pp 693The list of available key types may also be obtained using 694.Qq ssh -Q key . 695.It Cm HostbasedAuthentication 696Specifies whether rhosts or /etc/hosts.equiv authentication together 697with successful public key client host authentication is allowed 698(host-based authentication). 699The default is 700.Cm no . 701.It Cm HostbasedUsesNameFromPacketOnly 702Specifies whether or not the server will attempt to perform a reverse 703name lookup when matching the name in the 704.Pa ~/.shosts , 705.Pa ~/.rhosts , 706and 707.Pa /etc/hosts.equiv 708files during 709.Cm HostbasedAuthentication . 710A setting of 711.Cm yes 712means that 713.Xr sshd 8 714uses the name supplied by the client rather than 715attempting to resolve the name from the TCP connection itself. 716The default is 717.Cm no . 718.It Cm HostCertificate 719Specifies a file containing a public host certificate. 720The certificate's public key must match a private host key already specified 721by 722.Cm HostKey . 723The default behaviour of 724.Xr sshd 8 725is not to load any certificates. 726.It Cm HostKey 727Specifies a file containing a private host key 728used by SSH. 729The defaults are 730.Pa /etc/ssh/ssh_host_ecdsa_key , 731.Pa /etc/ssh/ssh_host_ed25519_key 732and 733.Pa /etc/ssh/ssh_host_rsa_key . 734.Pp 735Note that 736.Xr sshd 8 737will refuse to use a file if it is group/world-accessible 738and that the 739.Cm HostKeyAlgorithms 740option restricts which of the keys are actually used by 741.Xr sshd 8 . 742.Pp 743It is possible to have multiple host key files. 744It is also possible to specify public host key files instead. 745In this case operations on the private key will be delegated 746to an 747.Xr ssh-agent 1 . 748.It Cm HostKeyAgent 749Identifies the UNIX-domain socket used to communicate 750with an agent that has access to the private host keys. 751If the string 752.Qq SSH_AUTH_SOCK 753is specified, the location of the socket will be read from the 754.Ev SSH_AUTH_SOCK 755environment variable. 756.It Cm HostKeyAlgorithms 757Specifies the host key algorithms 758that the server offers. 759The default for this option is: 760.Bd -literal -offset 3n 761ecdsa-sha2-nistp256-cert-v01@openssh.com, 762ecdsa-sha2-nistp384-cert-v01@openssh.com, 763ecdsa-sha2-nistp521-cert-v01@openssh.com, 764ssh-ed25519-cert-v01@openssh.com, 765rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com, 766ssh-rsa-cert-v01@openssh.com, 767ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, 768ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa 769.Ed 770.Pp 771The list of available key types may also be obtained using 772.Qq ssh -Q key . 773.It Cm IgnoreRhosts 774Specifies that 775.Pa .rhosts 776and 777.Pa .shosts 778files will not be used in 779.Cm HostbasedAuthentication . 780.Pp 781.Pa /etc/hosts.equiv 782and 783.Pa /etc/shosts.equiv 784are still used. 785The default is 786.Cm yes . 787.It Cm IgnoreUserKnownHosts 788Specifies whether 789.Xr sshd 8 790should ignore the user's 791.Pa ~/.ssh/known_hosts 792during 793.Cm HostbasedAuthentication 794and use only the system-wide known hosts file 795.Pa /etc/ssh/known_hosts . 796The default is 797.Cm no . 798.It Cm IPQoS 799Specifies the IPv4 type-of-service or DSCP class for the connection. 800Accepted values are 801.Cm af11 , 802.Cm af12 , 803.Cm af13 , 804.Cm af21 , 805.Cm af22 , 806.Cm af23 , 807.Cm af31 , 808.Cm af32 , 809.Cm af33 , 810.Cm af41 , 811.Cm af42 , 812.Cm af43 , 813.Cm cs0 , 814.Cm cs1 , 815.Cm cs2 , 816.Cm cs3 , 817.Cm cs4 , 818.Cm cs5 , 819.Cm cs6 , 820.Cm cs7 , 821.Cm ef , 822.Cm lowdelay , 823.Cm throughput , 824.Cm reliability , 825a numeric value, or 826.Cm none 827to use the operating system default. 828This option may take one or two arguments, separated by whitespace. 829If one argument is specified, it is used as the packet class unconditionally. 830If two values are specified, the first is automatically selected for 831interactive sessions and the second for non-interactive sessions. 832The default is 833.Cm af21 834(Low-Latency Data) 835for interactive sessions and 836.Cm cs1 837(Lower Effort) 838for non-interactive sessions. 839.It Cm KbdInteractiveAuthentication 840Specifies whether to allow keyboard-interactive authentication. 841The argument to this keyword must be 842.Cm yes 843or 844.Cm no . 845The default is to use whatever value 846.Cm ChallengeResponseAuthentication 847is set to 848(by default 849.Cm yes ) . 850.It Cm KerberosAuthentication 851Specifies whether the password provided by the user for 852.Cm PasswordAuthentication 853will be validated through the Kerberos KDC. 854To use this option, the server needs a 855Kerberos servtab which allows the verification of the KDC's identity. 856The default is 857.Cm no . 858.It Cm KerberosGetAFSToken 859If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire 860an AFS token before accessing the user's home directory. 861The default is 862.Cm no . 863.It Cm KerberosOrLocalPasswd 864If password authentication through Kerberos fails then 865the password will be validated via any additional local mechanism 866such as 867.Pa /etc/passwd . 868The default is 869.Cm yes . 870.It Cm KerberosTicketCleanup 871Specifies whether to automatically destroy the user's ticket cache 872file on logout. 873The default is 874.Cm yes . 875.It Cm KexAlgorithms 876Specifies the available KEX (Key Exchange) algorithms. 877Multiple algorithms must be comma-separated. 878Alternately if the specified value begins with a 879.Sq + 880character, then the specified methods will be appended to the default set 881instead of replacing them. 882If the specified value begins with a 883.Sq - 884character, then the specified methods (including wildcards) will be removed 885from the default set instead of replacing them. 886The supported algorithms are: 887.Pp 888.Bl -item -compact -offset indent 889.It 890curve25519-sha256 891.It 892curve25519-sha256@libssh.org 893.It 894diffie-hellman-group1-sha1 895.It 896diffie-hellman-group14-sha1 897.It 898diffie-hellman-group14-sha256 899.It 900diffie-hellman-group16-sha512 901.It 902diffie-hellman-group18-sha512 903.It 904diffie-hellman-group-exchange-sha1 905.It 906diffie-hellman-group-exchange-sha256 907.It 908ecdh-sha2-nistp256 909.It 910ecdh-sha2-nistp384 911.It 912ecdh-sha2-nistp521 913.El 914.Pp 915The default is: 916.Bd -literal -offset indent 917curve25519-sha256,curve25519-sha256@libssh.org, 918ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521, 919diffie-hellman-group-exchange-sha256, 920diffie-hellman-group16-sha512,diffie-hellman-group18-sha512, 921diffie-hellman-group14-sha256,diffie-hellman-group14-sha1 922.Ed 923.Pp 924The list of available key exchange algorithms may also be obtained using 925.Qq ssh -Q kex . 926.It Cm ListenAddress 927Specifies the local addresses 928.Xr sshd 8 929should listen on. 930The following forms may be used: 931.Pp 932.Bl -item -offset indent -compact 933.It 934.Cm ListenAddress 935.Sm off 936.Ar hostname | address 937.Sm on 938.Op Cm rdomain Ar domain 939.It 940.Cm ListenAddress 941.Sm off 942.Ar hostname : port 943.Sm on 944.Op Cm rdomain Ar domain 945.It 946.Cm ListenAddress 947.Sm off 948.Ar IPv4_address : port 949.Sm on 950.Op Cm rdomain Ar domain 951.It 952.Cm ListenAddress 953.Sm off 954.Oo Ar hostname | address Oc : Ar port 955.Sm on 956.Op Cm rdomain Ar domain 957.El 958.Pp 959The optional 960.Cm rdomain 961qualifier requests 962.Xr sshd 8 963listen in an explicit routing domain. 964If 965.Ar port 966is not specified, 967sshd will listen on the address and all 968.Cm Port 969options specified. 970The default is to listen on all local addresses on the current default 971routing domain. 972Multiple 973.Cm ListenAddress 974options are permitted. 975For more information on routing domains, see 976.Xr rdomain 4 . 977.It Cm LoginGraceTime 978The server disconnects after this time if the user has not 979successfully logged in. 980If the value is 0, there is no time limit. 981The default is 120 seconds. 982.It Cm LogLevel 983Gives the verbosity level that is used when logging messages from 984.Xr sshd 8 . 985The possible values are: 986QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. 987The default is INFO. 988DEBUG and DEBUG1 are equivalent. 989DEBUG2 and DEBUG3 each specify higher levels of debugging output. 990Logging with a DEBUG level violates the privacy of users and is not recommended. 991.It Cm MACs 992Specifies the available MAC (message authentication code) algorithms. 993The MAC algorithm is used for data integrity protection. 994Multiple algorithms must be comma-separated. 995If the specified value begins with a 996.Sq + 997character, then the specified algorithms will be appended to the default set 998instead of replacing them. 999If the specified value begins with a 1000.Sq - 1001character, then the specified algorithms (including wildcards) will be removed 1002from the default set instead of replacing them. 1003.Pp 1004The algorithms that contain 1005.Qq -etm 1006calculate the MAC after encryption (encrypt-then-mac). 1007These are considered safer and their use recommended. 1008The supported MACs are: 1009.Pp 1010.Bl -item -compact -offset indent 1011.It 1012hmac-md5 1013.It 1014hmac-md5-96 1015.It 1016hmac-sha1 1017.It 1018hmac-sha1-96 1019.It 1020hmac-sha2-256 1021.It 1022hmac-sha2-512 1023.It 1024umac-64@openssh.com 1025.It 1026umac-128@openssh.com 1027.It 1028hmac-md5-etm@openssh.com 1029.It 1030hmac-md5-96-etm@openssh.com 1031.It 1032hmac-sha1-etm@openssh.com 1033.It 1034hmac-sha1-96-etm@openssh.com 1035.It 1036hmac-sha2-256-etm@openssh.com 1037.It 1038hmac-sha2-512-etm@openssh.com 1039.It 1040umac-64-etm@openssh.com 1041.It 1042umac-128-etm@openssh.com 1043.El 1044.Pp 1045The default is: 1046.Bd -literal -offset indent 1047umac-64-etm@openssh.com,umac-128-etm@openssh.com, 1048hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com, 1049hmac-sha1-etm@openssh.com, 1050umac-64@openssh.com,umac-128@openssh.com, 1051hmac-sha2-256,hmac-sha2-512,hmac-sha1 1052.Ed 1053.Pp 1054The list of available MAC algorithms may also be obtained using 1055.Qq ssh -Q mac . 1056.It Cm Match 1057Introduces a conditional block. 1058If all of the criteria on the 1059.Cm Match 1060line are satisfied, the keywords on the following lines override those 1061set in the global section of the config file, until either another 1062.Cm Match 1063line or the end of the file. 1064If a keyword appears in multiple 1065.Cm Match 1066blocks that are satisfied, only the first instance of the keyword is 1067applied. 1068.Pp 1069The arguments to 1070.Cm Match 1071are one or more criteria-pattern pairs or the single token 1072.Cm All 1073which matches all criteria. 1074The available criteria are 1075.Cm User , 1076.Cm Group , 1077.Cm Host , 1078.Cm LocalAddress , 1079.Cm LocalPort , 1080.Cm RDomain , 1081and 1082.Cm Address 1083(with 1084.Cm RDomain 1085representing the 1086.Xr rdomain 4 1087on which the connection was received). 1088.Pp 1089The match patterns may consist of single entries or comma-separated 1090lists and may use the wildcard and negation operators described in the 1091.Sx PATTERNS 1092section of 1093.Xr ssh_config 5 . 1094.Pp 1095The patterns in an 1096.Cm Address 1097criteria may additionally contain addresses to match in CIDR 1098address/masklen format, 1099such as 192.0.2.0/24 or 2001:db8::/32. 1100Note that the mask length provided must be consistent with the address - 1101it is an error to specify a mask length that is too long for the address 1102or one with bits set in this host portion of the address. 1103For example, 192.0.2.0/33 and 192.0.2.0/8, respectively. 1104.Pp 1105Only a subset of keywords may be used on the lines following a 1106.Cm Match 1107keyword. 1108Available keywords are 1109.Cm AcceptEnv , 1110.Cm AllowAgentForwarding , 1111.Cm AllowGroups , 1112.Cm AllowStreamLocalForwarding , 1113.Cm AllowTcpForwarding , 1114.Cm AllowUsers , 1115.Cm AuthenticationMethods , 1116.Cm AuthorizedKeysCommand , 1117.Cm AuthorizedKeysCommandUser , 1118.Cm AuthorizedKeysFile , 1119.Cm AuthorizedPrincipalsCommand , 1120.Cm AuthorizedPrincipalsCommandUser , 1121.Cm AuthorizedPrincipalsFile , 1122.Cm Banner , 1123.Cm ChrootDirectory , 1124.Cm ClientAliveCountMax , 1125.Cm ClientAliveInterval , 1126.Cm DenyGroups , 1127.Cm DenyUsers , 1128.Cm ForceCommand , 1129.Cm GatewayPorts , 1130.Cm GSSAPIAuthentication , 1131.Cm HostbasedAcceptedKeyTypes , 1132.Cm HostbasedAuthentication , 1133.Cm HostbasedUsesNameFromPacketOnly , 1134.Cm IPQoS , 1135.Cm KbdInteractiveAuthentication , 1136.Cm KerberosAuthentication , 1137.Cm LogLevel , 1138.Cm MaxAuthTries , 1139.Cm MaxSessions , 1140.Cm PasswordAuthentication , 1141.Cm PermitEmptyPasswords , 1142.Cm PermitListen , 1143.Cm PermitOpen , 1144.Cm PermitRootLogin , 1145.Cm PermitTTY , 1146.Cm PermitTunnel , 1147.Cm PermitUserRC , 1148.Cm PubkeyAcceptedKeyTypes , 1149.Cm PubkeyAuthentication , 1150.Cm RekeyLimit , 1151.Cm RevokedKeys , 1152.Cm RDomain , 1153.Cm SetEnv , 1154.Cm StreamLocalBindMask , 1155.Cm StreamLocalBindUnlink , 1156.Cm TrustedUserCAKeys , 1157.Cm X11DisplayOffset , 1158.Cm X11Forwarding 1159and 1160.Cm X11UseLocalHost . 1161.It Cm MaxAuthTries 1162Specifies the maximum number of authentication attempts permitted per 1163connection. 1164Once the number of failures reaches half this value, 1165additional failures are logged. 1166The default is 6. 1167.It Cm MaxSessions 1168Specifies the maximum number of open shell, login or subsystem (e.g. sftp) 1169sessions permitted per network connection. 1170Multiple sessions may be established by clients that support connection 1171multiplexing. 1172Setting 1173.Cm MaxSessions 1174to 1 will effectively disable session multiplexing, whereas setting it to 0 1175will prevent all shell, login and subsystem sessions while still permitting 1176forwarding. 1177The default is 10. 1178.It Cm MaxStartups 1179Specifies the maximum number of concurrent unauthenticated connections to the 1180SSH daemon. 1181Additional connections will be dropped until authentication succeeds or the 1182.Cm LoginGraceTime 1183expires for a connection. 1184The default is 10:30:100. 1185.Pp 1186Alternatively, random early drop can be enabled by specifying 1187the three colon separated values 1188start:rate:full (e.g. "10:30:60"). 1189.Xr sshd 8 1190will refuse connection attempts with a probability of rate/100 (30%) 1191if there are currently start (10) unauthenticated connections. 1192The probability increases linearly and all connection attempts 1193are refused if the number of unauthenticated connections reaches full (60). 1194.It Cm PasswordAuthentication 1195Specifies whether password authentication is allowed. 1196The default is 1197.Cm yes . 1198.It Cm PermitEmptyPasswords 1199When password authentication is allowed, it specifies whether the 1200server allows login to accounts with empty password strings. 1201The default is 1202.Cm no . 1203.It Cm PermitListen 1204Specifies the addresses/ports on which a remote TCP port forwarding may listen. 1205The listen specification must be one of the following forms: 1206.Pp 1207.Bl -item -offset indent -compact 1208.It 1209.Cm PermitListen 1210.Sm off 1211.Ar port 1212.Sm on 1213.It 1214.Cm PermitListen 1215.Sm off 1216.Ar host : port 1217.Sm on 1218.El 1219.Pp 1220Multiple permissions may be specified by separating them with whitespace. 1221An argument of 1222.Cm any 1223can be used to remove all restrictions and permit any listen requests. 1224An argument of 1225.Cm none 1226can be used to prohibit all listen requests. 1227The host name may contain wildcards as described in the PATTERNS section in 1228.Xr ssh_config 5 . 1229The wildcard 1230.Sq * 1231can also be used in place of a port number to allow all ports. 1232By default all port forwarding listen requests are permitted. 1233Note that the 1234.Cm GatewayPorts 1235option may further restrict which addresses may be listened on. 1236Note also that 1237.Xr ssh 1 1238will request a listen host of 1239.Dq localhost 1240if no listen host was specifically requested, and this name is 1241treated differently to explicit localhost addresses of 1242.Dq 127.0.0.1 1243and 1244.Dq ::1 . 1245.It Cm PermitOpen 1246Specifies the destinations to which TCP port forwarding is permitted. 1247The forwarding specification must be one of the following forms: 1248.Pp 1249.Bl -item -offset indent -compact 1250.It 1251.Cm PermitOpen 1252.Sm off 1253.Ar host : port 1254.Sm on 1255.It 1256.Cm PermitOpen 1257.Sm off 1258.Ar IPv4_addr : port 1259.Sm on 1260.It 1261.Cm PermitOpen 1262.Sm off 1263.Ar \&[ IPv6_addr \&] : port 1264.Sm on 1265.El 1266.Pp 1267Multiple forwards may be specified by separating them with whitespace. 1268An argument of 1269.Cm any 1270can be used to remove all restrictions and permit any forwarding requests. 1271An argument of 1272.Cm none 1273can be used to prohibit all forwarding requests. 1274The wildcard 1275.Sq * 1276can be used for host or port to allow all hosts or ports, respectively. 1277By default all port forwarding requests are permitted. 1278.It Cm PermitRootLogin 1279Specifies whether root can log in using 1280.Xr ssh 1 . 1281The argument must be 1282.Cm yes , 1283.Cm prohibit-password , 1284.Cm forced-commands-only , 1285or 1286.Cm no . 1287The default is 1288.Cm prohibit-password . 1289.Pp 1290If this option is set to 1291.Cm prohibit-password 1292(or its deprecated alias, 1293.Cm without-password ) , 1294password and keyboard-interactive authentication are disabled for root. 1295.Pp 1296If this option is set to 1297.Cm forced-commands-only , 1298root login with public key authentication will be allowed, 1299but only if the 1300.Ar command 1301option has been specified 1302(which may be useful for taking remote backups even if root login is 1303normally not allowed). 1304All other authentication methods are disabled for root. 1305.Pp 1306If this option is set to 1307.Cm no , 1308root is not allowed to log in. 1309.It Cm PermitTTY 1310Specifies whether 1311.Xr pty 4 1312allocation is permitted. 1313The default is 1314.Cm yes . 1315.It Cm PermitTunnel 1316Specifies whether 1317.Xr tun 4 1318device forwarding is allowed. 1319The argument must be 1320.Cm yes , 1321.Cm point-to-point 1322(layer 3), 1323.Cm ethernet 1324(layer 2), or 1325.Cm no . 1326Specifying 1327.Cm yes 1328permits both 1329.Cm point-to-point 1330and 1331.Cm ethernet . 1332The default is 1333.Cm no . 1334.Pp 1335Independent of this setting, the permissions of the selected 1336.Xr tun 4 1337device must allow access to the user. 1338.It Cm PermitUserEnvironment 1339Specifies whether 1340.Pa ~/.ssh/environment 1341and 1342.Cm environment= 1343options in 1344.Pa ~/.ssh/authorized_keys 1345are processed by 1346.Xr sshd 8 . 1347Valid options are 1348.Cm yes , 1349.Cm no 1350or a pattern-list specifying which environment variable names to accept 1351(for example 1352.Qq LANG,LC_* ) . 1353The default is 1354.Cm no . 1355Enabling environment processing may enable users to bypass access 1356restrictions in some configurations using mechanisms such as 1357.Ev LD_PRELOAD . 1358.It Cm PermitUserRC 1359Specifies whether any 1360.Pa ~/.ssh/rc 1361file is executed. 1362The default is 1363.Cm yes . 1364.It Cm PidFile 1365Specifies the file that contains the process ID of the 1366SSH daemon, or 1367.Cm none 1368to not write one. 1369The default is 1370.Pa /var/run/sshd.pid . 1371.It Cm Port 1372Specifies the port number that 1373.Xr sshd 8 1374listens on. 1375The default is 22. 1376Multiple options of this type are permitted. 1377See also 1378.Cm ListenAddress . 1379.It Cm PrintLastLog 1380Specifies whether 1381.Xr sshd 8 1382should print the date and time of the last user login when a user logs 1383in interactively. 1384The default is 1385.Cm yes . 1386.It Cm PrintMotd 1387Specifies whether 1388.Xr sshd 8 1389should print 1390.Pa /etc/motd 1391when a user logs in interactively. 1392(On some systems it is also printed by the shell, 1393.Pa /etc/profile , 1394or equivalent.) 1395The default is 1396.Cm yes . 1397.It Cm PubkeyAcceptedKeyTypes 1398Specifies the key types that will be accepted for public key authentication 1399as a list of comma-separated patterns. 1400Alternately if the specified value begins with a 1401.Sq + 1402character, then the specified key types will be appended to the default set 1403instead of replacing them. 1404If the specified value begins with a 1405.Sq - 1406character, then the specified key types (including wildcards) will be removed 1407from the default set instead of replacing them. 1408The default for this option is: 1409.Bd -literal -offset 3n 1410ecdsa-sha2-nistp256-cert-v01@openssh.com, 1411ecdsa-sha2-nistp384-cert-v01@openssh.com, 1412ecdsa-sha2-nistp521-cert-v01@openssh.com, 1413ssh-ed25519-cert-v01@openssh.com, 1414rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com, 1415ssh-rsa-cert-v01@openssh.com, 1416ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, 1417ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa 1418.Ed 1419.Pp 1420The list of available key types may also be obtained using 1421.Qq ssh -Q key . 1422.It Cm PubkeyAuthentication 1423Specifies whether public key authentication is allowed. 1424The default is 1425.Cm yes . 1426.It Cm RekeyLimit 1427Specifies the maximum amount of data that may be transmitted before the 1428session key is renegotiated, optionally followed a maximum amount of 1429time that may pass before the session key is renegotiated. 1430The first argument is specified in bytes and may have a suffix of 1431.Sq K , 1432.Sq M , 1433or 1434.Sq G 1435to indicate Kilobytes, Megabytes, or Gigabytes, respectively. 1436The default is between 1437.Sq 1G 1438and 1439.Sq 4G , 1440depending on the cipher. 1441The optional second value is specified in seconds and may use any of the 1442units documented in the 1443.Sx TIME FORMATS 1444section. 1445The default value for 1446.Cm RekeyLimit 1447is 1448.Cm default none , 1449which means that rekeying is performed after the cipher's default amount 1450of data has been sent or received and no time based rekeying is done. 1451.It Cm RevokedKeys 1452Specifies revoked public keys file, or 1453.Cm none 1454to not use one. 1455Keys listed in this file will be refused for public key authentication. 1456Note that if this file is not readable, then public key authentication will 1457be refused for all users. 1458Keys may be specified as a text file, listing one public key per line, or as 1459an OpenSSH Key Revocation List (KRL) as generated by 1460.Xr ssh-keygen 1 . 1461For more information on KRLs, see the KEY REVOCATION LISTS section in 1462.Xr ssh-keygen 1 . 1463.It Cm RDomain 1464Specifies an explicit routing domain that is applied after authentication 1465has completed. 1466The user session, as well and any forwarded or listening IP sockets, 1467will be bound to this 1468.Xr rdomain 4 . 1469If the routing domain is set to 1470.Cm \&%D , 1471then the domain in which the incoming connection was received will be applied. 1472.It Cm SetEnv 1473Specifies one or more environment variables to set in child sessions started 1474by 1475.Xr sshd 8 1476as 1477.Dq NAME=VALUE . 1478The environment value may be quoted (e.g. if it contains whitespace 1479characters). 1480Environment variables set by 1481.Cm SetEnv 1482override the default environment and any variables specified by the user 1483via 1484.Cm AcceptEnv 1485or 1486.Cm PermitUserEnvironment . 1487.It Cm StreamLocalBindMask 1488Sets the octal file creation mode mask 1489.Pq umask 1490used when creating a Unix-domain socket file for local or remote 1491port forwarding. 1492This option is only used for port forwarding to a Unix-domain socket file. 1493.Pp 1494The default value is 0177, which creates a Unix-domain socket file that is 1495readable and writable only by the owner. 1496Note that not all operating systems honor the file mode on Unix-domain 1497socket files. 1498.It Cm StreamLocalBindUnlink 1499Specifies whether to remove an existing Unix-domain socket file for local 1500or remote port forwarding before creating a new one. 1501If the socket file already exists and 1502.Cm StreamLocalBindUnlink 1503is not enabled, 1504.Nm sshd 1505will be unable to forward the port to the Unix-domain socket file. 1506This option is only used for port forwarding to a Unix-domain socket file. 1507.Pp 1508The argument must be 1509.Cm yes 1510or 1511.Cm no . 1512The default is 1513.Cm no . 1514.It Cm StrictModes 1515Specifies whether 1516.Xr sshd 8 1517should check file modes and ownership of the 1518user's files and home directory before accepting login. 1519This is normally desirable because novices sometimes accidentally leave their 1520directory or files world-writable. 1521The default is 1522.Cm yes . 1523Note that this does not apply to 1524.Cm ChrootDirectory , 1525whose permissions and ownership are checked unconditionally. 1526.It Cm Subsystem 1527Configures an external subsystem (e.g. file transfer daemon). 1528Arguments should be a subsystem name and a command (with optional arguments) 1529to execute upon subsystem request. 1530.Pp 1531The command 1532.Cm sftp-server 1533implements the SFTP file transfer subsystem. 1534.Pp 1535Alternately the name 1536.Cm internal-sftp 1537implements an in-process SFTP server. 1538This may simplify configurations using 1539.Cm ChrootDirectory 1540to force a different filesystem root on clients. 1541.Pp 1542By default no subsystems are defined. 1543.It Cm SyslogFacility 1544Gives the facility code that is used when logging messages from 1545.Xr sshd 8 . 1546The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2, 1547LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. 1548The default is AUTH. 1549.It Cm TCPKeepAlive 1550Specifies whether the system should send TCP keepalive messages to the 1551other side. 1552If they are sent, death of the connection or crash of one 1553of the machines will be properly noticed. 1554However, this means that 1555connections will die if the route is down temporarily, and some people 1556find it annoying. 1557On the other hand, if TCP keepalives are not sent, 1558sessions may hang indefinitely on the server, leaving 1559.Qq ghost 1560users and consuming server resources. 1561.Pp 1562The default is 1563.Cm yes 1564(to send TCP keepalive messages), and the server will notice 1565if the network goes down or the client host crashes. 1566This avoids infinitely hanging sessions. 1567.Pp 1568To disable TCP keepalive messages, the value should be set to 1569.Cm no . 1570.It Cm TrustedUserCAKeys 1571Specifies a file containing public keys of certificate authorities that are 1572trusted to sign user certificates for authentication, or 1573.Cm none 1574to not use one. 1575Keys are listed one per line; empty lines and comments starting with 1576.Ql # 1577are allowed. 1578If a certificate is presented for authentication and has its signing CA key 1579listed in this file, then it may be used for authentication for any user 1580listed in the certificate's principals list. 1581Note that certificates that lack a list of principals will not be permitted 1582for authentication using 1583.Cm TrustedUserCAKeys . 1584For more details on certificates, see the CERTIFICATES section in 1585.Xr ssh-keygen 1 . 1586.It Cm UseDNS 1587Specifies whether 1588.Xr sshd 8 1589should look up the remote host name, and to check that 1590the resolved host name for the remote IP address maps back to the 1591very same IP address. 1592.Pp 1593If this option is set to 1594.Cm no 1595(the default) then only addresses and not host names may be used in 1596.Pa ~/.ssh/authorized_keys 1597.Cm from 1598and 1599.Nm 1600.Cm Match 1601.Cm Host 1602directives. 1603.It Cm UsePAM 1604Enables the Pluggable Authentication Module interface. 1605If set to 1606.Cm yes 1607this will enable PAM authentication using 1608.Cm ChallengeResponseAuthentication 1609and 1610.Cm PasswordAuthentication 1611in addition to PAM account and session module processing for all 1612authentication types. 1613.Pp 1614Because PAM challenge-response authentication usually serves an equivalent 1615role to password authentication, you should disable either 1616.Cm PasswordAuthentication 1617or 1618.Cm ChallengeResponseAuthentication. 1619.Pp 1620If 1621.Cm UsePAM 1622is enabled, you will not be able to run 1623.Xr sshd 8 1624as a non-root user. 1625The default is 1626.Cm no . 1627.It Cm VersionAddendum 1628Optionally specifies additional text to append to the SSH protocol banner 1629sent by the server upon connection. 1630The default is 1631.Cm none . 1632.It Cm X11DisplayOffset 1633Specifies the first display number available for 1634.Xr sshd 8 Ns 's 1635X11 forwarding. 1636This prevents sshd from interfering with real X11 servers. 1637The default is 10. 1638.It Cm X11Forwarding 1639Specifies whether X11 forwarding is permitted. 1640The argument must be 1641.Cm yes 1642or 1643.Cm no . 1644The default is 1645.Cm no . 1646.Pp 1647When X11 forwarding is enabled, there may be additional exposure to 1648the server and to client displays if the 1649.Xr sshd 8 1650proxy display is configured to listen on the wildcard address (see 1651.Cm X11UseLocalhost ) , 1652though this is not the default. 1653Additionally, the authentication spoofing and authentication data 1654verification and substitution occur on the client side. 1655The security risk of using X11 forwarding is that the client's X11 1656display server may be exposed to attack when the SSH client requests 1657forwarding (see the warnings for 1658.Cm ForwardX11 1659in 1660.Xr ssh_config 5 ) . 1661A system administrator may have a stance in which they want to 1662protect clients that may expose themselves to attack by unwittingly 1663requesting X11 forwarding, which can warrant a 1664.Cm no 1665setting. 1666.Pp 1667Note that disabling X11 forwarding does not prevent users from 1668forwarding X11 traffic, as users can always install their own forwarders. 1669.It Cm X11UseLocalhost 1670Specifies whether 1671.Xr sshd 8 1672should bind the X11 forwarding server to the loopback address or to 1673the wildcard address. 1674By default, 1675sshd binds the forwarding server to the loopback address and sets the 1676hostname part of the 1677.Ev DISPLAY 1678environment variable to 1679.Cm localhost . 1680This prevents remote hosts from connecting to the proxy display. 1681However, some older X11 clients may not function with this 1682configuration. 1683.Cm X11UseLocalhost 1684may be set to 1685.Cm no 1686to specify that the forwarding server should be bound to the wildcard 1687address. 1688The argument must be 1689.Cm yes 1690or 1691.Cm no . 1692The default is 1693.Cm yes . 1694.It Cm XAuthLocation 1695Specifies the full pathname of the 1696.Xr xauth 1 1697program, or 1698.Cm none 1699to not use one. 1700The default is 1701.Pa /usr/X11R6/bin/xauth . 1702.El 1703.Sh TIME FORMATS 1704.Xr sshd 8 1705command-line arguments and configuration file options that specify time 1706may be expressed using a sequence of the form: 1707.Sm off 1708.Ar time Op Ar qualifier , 1709.Sm on 1710where 1711.Ar time 1712is a positive integer value and 1713.Ar qualifier 1714is one of the following: 1715.Pp 1716.Bl -tag -width Ds -compact -offset indent 1717.It Aq Cm none 1718seconds 1719.It Cm s | Cm S 1720seconds 1721.It Cm m | Cm M 1722minutes 1723.It Cm h | Cm H 1724hours 1725.It Cm d | Cm D 1726days 1727.It Cm w | Cm W 1728weeks 1729.El 1730.Pp 1731Each member of the sequence is added together to calculate 1732the total time value. 1733.Pp 1734Time format examples: 1735.Pp 1736.Bl -tag -width Ds -compact -offset indent 1737.It 600 1738600 seconds (10 minutes) 1739.It 10m 174010 minutes 1741.It 1h30m 17421 hour 30 minutes (90 minutes) 1743.El 1744.Sh TOKENS 1745Arguments to some keywords can make use of tokens, 1746which are expanded at runtime: 1747.Pp 1748.Bl -tag -width XXXX -offset indent -compact 1749.It %% 1750A literal 1751.Sq % . 1752.It \&%D 1753The routing domain in which the incoming connection was received. 1754.It %F 1755The fingerprint of the CA key. 1756.It %f 1757The fingerprint of the key or certificate. 1758.It %h 1759The home directory of the user. 1760.It %i 1761The key ID in the certificate. 1762.It %K 1763The base64-encoded CA key. 1764.It %k 1765The base64-encoded key or certificate for authentication. 1766.It %s 1767The serial number of the certificate. 1768.It \&%T 1769The type of the CA key. 1770.It %t 1771The key or certificate type. 1772.It \&%U 1773The numeric user ID of the target user. 1774.It %u 1775The username. 1776.El 1777.Pp 1778.Cm AuthorizedKeysCommand 1779accepts the tokens %%, %f, %h, %k, %t, %U, and %u. 1780.Pp 1781.Cm AuthorizedKeysFile 1782accepts the tokens %%, %h, %U, and %u. 1783.Pp 1784.Cm AuthorizedPrincipalsCommand 1785accepts the tokens %%, %F, %f, %h, %i, %K, %k, %s, %T, %t, %U, and %u. 1786.Pp 1787.Cm AuthorizedPrincipalsFile 1788accepts the tokens %%, %h, %U, and %u. 1789.Pp 1790.Cm ChrootDirectory 1791accepts the tokens %%, %h, %U, and %u. 1792.Pp 1793.Cm RoutingDomain 1794accepts the token %D. 1795.Sh FILES 1796.Bl -tag -width Ds 1797.It Pa /etc/ssh/sshd_config 1798Contains configuration data for 1799.Xr sshd 8 . 1800This file should be writable by root only, but it is recommended 1801(though not necessary) that it be world-readable. 1802.El 1803.Sh SEE ALSO 1804.Xr sftp-server 8 , 1805.Xr sshd 8 1806.Sh AUTHORS 1807.An -nosplit 1808OpenSSH is a derivative of the original and free 1809ssh 1.2.12 release by 1810.An Tatu Ylonen . 1811.An Aaron Campbell , Bob Beck , Markus Friedl , Niels Provos , 1812.An Theo de Raadt 1813and 1814.An Dug Song 1815removed many bugs, re-added newer features and 1816created OpenSSH. 1817.An Markus Friedl 1818contributed the support for SSH protocol versions 1.5 and 2.0. 1819.An Niels Provos 1820and 1821.An Markus Friedl 1822contributed support for privilege separation. 1823