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