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