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.328 2021/02/27 23:42:37 djm Exp $ 37.Dd $Mdocdate: February 27 2021 $ 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 HostbasedAcceptedAlgorithms 664Specifies the signature algorithms that will be accepted for hostbased 665authentication as a list of comma-separated patterns. 666Alternately if the specified list begins with a 667.Sq + 668character, then the specified signature algorithms will be appended to 669the default set instead of replacing them. 670If the specified list begins with a 671.Sq - 672character, then the specified signature algorithms (including wildcards) 673will be removed from the default set instead of replacing them. 674If the specified list begins with a 675.Sq ^ 676character, then the specified signature algorithms will be placed at 677the head of the default 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 signature algorithms may also be obtained using 697.Qq ssh -Q HostbasedAcceptedAlgorithms . 698This was formerly named HostbasedAcceptedKeyTypes. 699.It Cm HostbasedAuthentication 700Specifies whether rhosts or /etc/hosts.equiv authentication together 701with successful public key client host authentication is allowed 702(host-based authentication). 703The default is 704.Cm no . 705.It Cm HostbasedUsesNameFromPacketOnly 706Specifies whether or not the server will attempt to perform a reverse 707name lookup when matching the name in the 708.Pa ~/.shosts , 709.Pa ~/.rhosts , 710and 711.Pa /etc/hosts.equiv 712files during 713.Cm HostbasedAuthentication . 714A setting of 715.Cm yes 716means that 717.Xr sshd 8 718uses the name supplied by the client rather than 719attempting to resolve the name from the TCP connection itself. 720The default is 721.Cm no . 722.It Cm HostCertificate 723Specifies a file containing a public host certificate. 724The certificate's public key must match a private host key already specified 725by 726.Cm HostKey . 727The default behaviour of 728.Xr sshd 8 729is not to load any certificates. 730.It Cm HostKey 731Specifies a file containing a private host key 732used by SSH. 733The defaults are 734.Pa /etc/ssh/ssh_host_ecdsa_key , 735.Pa /etc/ssh/ssh_host_ed25519_key 736and 737.Pa /etc/ssh/ssh_host_rsa_key . 738.Pp 739Note that 740.Xr sshd 8 741will refuse to use a file if it is group/world-accessible 742and that the 743.Cm HostKeyAlgorithms 744option restricts which of the keys are actually used by 745.Xr sshd 8 . 746.Pp 747It is possible to have multiple host key files. 748It is also possible to specify public host key files instead. 749In this case operations on the private key will be delegated 750to an 751.Xr ssh-agent 1 . 752.It Cm HostKeyAgent 753Identifies the UNIX-domain socket used to communicate 754with an agent that has access to the private host keys. 755If the string 756.Qq SSH_AUTH_SOCK 757is specified, the location of the socket will be read from the 758.Ev SSH_AUTH_SOCK 759environment variable. 760.It Cm HostKeyAlgorithms 761Specifies the host key signature algorithms 762that the server offers. 763The default for this option is: 764.Bd -literal -offset 3n 765ssh-ed25519-cert-v01@openssh.com, 766ecdsa-sha2-nistp256-cert-v01@openssh.com, 767ecdsa-sha2-nistp384-cert-v01@openssh.com, 768ecdsa-sha2-nistp521-cert-v01@openssh.com, 769sk-ssh-ed25519-cert-v01@openssh.com, 770sk-ecdsa-sha2-nistp256-cert-v01@openssh.com, 771rsa-sha2-512-cert-v01@openssh.com, 772rsa-sha2-256-cert-v01@openssh.com, 773ssh-rsa-cert-v01@openssh.com, 774ssh-ed25519, 775ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, 776sk-ssh-ed25519@openssh.com, 777sk-ecdsa-sha2-nistp256@openssh.com, 778rsa-sha2-512,rsa-sha2-256,ssh-rsa 779.Ed 780.Pp 781The list of available signature algorithms may also be obtained using 782.Qq ssh -Q HostKeyAlgorithms . 783.It Cm IgnoreRhosts 784Specifies whether to ignore per-user 785.Pa .rhosts 786and 787.Pa .shosts 788files during 789.Cm HostbasedAuthentication . 790The system-wide 791.Pa /etc/hosts.equiv 792and 793.Pa /etc/shosts.equiv 794are still used regardless of this setting. 795.Pp 796Accepted values are 797.Cm yes 798(the default) to ignore all per-user files, 799.Cm shosts-only 800to allow the use of 801.Pa .shosts 802but to ignore 803.Pa .rhosts 804or 805.Cm no 806to allow both 807.Pa .shosts 808and 809.Pa rhosts . 810.It Cm IgnoreUserKnownHosts 811Specifies whether 812.Xr sshd 8 813should ignore the user's 814.Pa ~/.ssh/known_hosts 815during 816.Cm HostbasedAuthentication 817and use only the system-wide known hosts file 818.Pa /etc/ssh/known_hosts . 819The default is 820.Dq no . 821.It Cm Include 822Include the specified configuration file(s). 823Multiple pathnames may be specified and each pathname may contain 824.Xr glob 7 825wildcards that will be expanded and processed in lexical order. 826Files without absolute paths are assumed to be in 827.Pa /etc/ssh . 828An 829.Cm Include 830directive may appear inside a 831.Cm Match 832block 833to perform conditional inclusion. 834.It Cm IPQoS 835Specifies the IPv4 type-of-service or DSCP class for the connection. 836Accepted values are 837.Cm af11 , 838.Cm af12 , 839.Cm af13 , 840.Cm af21 , 841.Cm af22 , 842.Cm af23 , 843.Cm af31 , 844.Cm af32 , 845.Cm af33 , 846.Cm af41 , 847.Cm af42 , 848.Cm af43 , 849.Cm cs0 , 850.Cm cs1 , 851.Cm cs2 , 852.Cm cs3 , 853.Cm cs4 , 854.Cm cs5 , 855.Cm cs6 , 856.Cm cs7 , 857.Cm ef , 858.Cm le , 859.Cm lowdelay , 860.Cm throughput , 861.Cm reliability , 862a numeric value, or 863.Cm none 864to use the operating system default. 865This option may take one or two arguments, separated by whitespace. 866If one argument is specified, it is used as the packet class unconditionally. 867If two values are specified, the first is automatically selected for 868interactive sessions and the second for non-interactive sessions. 869The default is 870.Cm af21 871(Low-Latency Data) 872for interactive sessions and 873.Cm cs1 874(Lower Effort) 875for non-interactive sessions. 876.It Cm KbdInteractiveAuthentication 877Specifies whether to allow keyboard-interactive authentication. 878The argument to this keyword must be 879.Cm yes 880or 881.Cm no . 882The default is to use whatever value 883.Cm ChallengeResponseAuthentication 884is set to 885(by default 886.Cm yes ) . 887.It Cm KerberosAuthentication 888Specifies whether the password provided by the user for 889.Cm PasswordAuthentication 890will be validated through the Kerberos KDC. 891To use this option, the server needs a 892Kerberos servtab which allows the verification of the KDC's identity. 893The default is 894.Cm no . 895.It Cm KerberosGetAFSToken 896If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire 897an AFS token before accessing the user's home directory. 898The default is 899.Cm no . 900.It Cm KerberosOrLocalPasswd 901If password authentication through Kerberos fails then 902the password will be validated via any additional local mechanism 903such as 904.Pa /etc/passwd . 905The default is 906.Cm yes . 907.It Cm KerberosTicketCleanup 908Specifies whether to automatically destroy the user's ticket cache 909file on logout. 910The default is 911.Cm yes . 912.It Cm KexAlgorithms 913Specifies the available KEX (Key Exchange) algorithms. 914Multiple algorithms must be comma-separated. 915Alternately if the specified list begins with a 916.Sq + 917character, then the specified methods will be appended to the default set 918instead of replacing them. 919If the specified list begins with a 920.Sq - 921character, then the specified methods (including wildcards) will be removed 922from the default set instead of replacing them. 923If the specified list begins with a 924.Sq ^ 925character, then the specified methods will be placed at the head of the 926default set. 927The supported algorithms are: 928.Pp 929.Bl -item -compact -offset indent 930.It 931curve25519-sha256 932.It 933curve25519-sha256@libssh.org 934.It 935diffie-hellman-group1-sha1 936.It 937diffie-hellman-group14-sha1 938.It 939diffie-hellman-group14-sha256 940.It 941diffie-hellman-group16-sha512 942.It 943diffie-hellman-group18-sha512 944.It 945diffie-hellman-group-exchange-sha1 946.It 947diffie-hellman-group-exchange-sha256 948.It 949ecdh-sha2-nistp256 950.It 951ecdh-sha2-nistp384 952.It 953ecdh-sha2-nistp521 954.It 955sntrup761x25519-sha512@openssh.com 956.El 957.Pp 958The default is: 959.Bd -literal -offset indent 960curve25519-sha256,curve25519-sha256@libssh.org, 961ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521, 962diffie-hellman-group-exchange-sha256, 963diffie-hellman-group16-sha512,diffie-hellman-group18-sha512, 964diffie-hellman-group14-sha256 965.Ed 966.Pp 967The list of available key exchange algorithms may also be obtained using 968.Qq ssh -Q KexAlgorithms . 969.It Cm ListenAddress 970Specifies the local addresses 971.Xr sshd 8 972should listen on. 973The following forms may be used: 974.Pp 975.Bl -item -offset indent -compact 976.It 977.Cm ListenAddress 978.Sm off 979.Ar hostname | address 980.Sm on 981.Op Cm rdomain Ar domain 982.It 983.Cm ListenAddress 984.Sm off 985.Ar hostname : port 986.Sm on 987.Op Cm rdomain Ar domain 988.It 989.Cm ListenAddress 990.Sm off 991.Ar IPv4_address : port 992.Sm on 993.Op Cm rdomain Ar domain 994.It 995.Cm ListenAddress 996.Sm off 997.Oo Ar hostname | address Oc : Ar port 998.Sm on 999.Op Cm rdomain Ar domain 1000.El 1001.Pp 1002The optional 1003.Cm rdomain 1004qualifier requests 1005.Xr sshd 8 1006listen in an explicit routing domain. 1007If 1008.Ar port 1009is not specified, 1010sshd will listen on the address and all 1011.Cm Port 1012options specified. 1013The default is to listen on all local addresses on the current default 1014routing domain. 1015Multiple 1016.Cm ListenAddress 1017options are permitted. 1018For more information on routing domains, see 1019.Xr rdomain 4 . 1020.It Cm LoginGraceTime 1021The server disconnects after this time if the user has not 1022successfully logged in. 1023If the value is 0, there is no time limit. 1024The default is 120 seconds. 1025.It Cm LogLevel 1026Gives the verbosity level that is used when logging messages from 1027.Xr sshd 8 . 1028The possible values are: 1029QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. 1030The default is INFO. 1031DEBUG and DEBUG1 are equivalent. 1032DEBUG2 and DEBUG3 each specify higher levels of debugging output. 1033Logging with a DEBUG level violates the privacy of users and is not recommended. 1034.It Cm LogVerbose 1035Specify one or more overrides to LogLevel. 1036An override consists of a pattern lists that matches the source file, function 1037and line number to force detailed logging for. 1038For example, an override pattern of: 1039.Bd -literal -offset indent 1040kex.c:*:1000,*:kex_exchange_identification():*,packet.c:* 1041.Ed 1042.Pp 1043would enable detailed logging for line 1000 of 1044.Pa kex.c , 1045everything in the 1046.Fn kex_exchange_identification 1047function, and all code in the 1048.Pa packet.c 1049file. 1050This option is intended for debugging and no overrides are enabled by default. 1051.It Cm MACs 1052Specifies the available MAC (message authentication code) algorithms. 1053The MAC algorithm is used for data integrity protection. 1054Multiple algorithms must be comma-separated. 1055If the specified list begins with a 1056.Sq + 1057character, then the specified algorithms will be appended to the default set 1058instead of replacing them. 1059If the specified list begins with a 1060.Sq - 1061character, then the specified algorithms (including wildcards) will be removed 1062from the default set instead of replacing them. 1063If the specified list begins with a 1064.Sq ^ 1065character, then the specified algorithms will be placed at the head of the 1066default set. 1067.Pp 1068The algorithms that contain 1069.Qq -etm 1070calculate the MAC after encryption (encrypt-then-mac). 1071These are considered safer and their use recommended. 1072The supported MACs are: 1073.Pp 1074.Bl -item -compact -offset indent 1075.It 1076hmac-md5 1077.It 1078hmac-md5-96 1079.It 1080hmac-sha1 1081.It 1082hmac-sha1-96 1083.It 1084hmac-sha2-256 1085.It 1086hmac-sha2-512 1087.It 1088umac-64@openssh.com 1089.It 1090umac-128@openssh.com 1091.It 1092hmac-md5-etm@openssh.com 1093.It 1094hmac-md5-96-etm@openssh.com 1095.It 1096hmac-sha1-etm@openssh.com 1097.It 1098hmac-sha1-96-etm@openssh.com 1099.It 1100hmac-sha2-256-etm@openssh.com 1101.It 1102hmac-sha2-512-etm@openssh.com 1103.It 1104umac-64-etm@openssh.com 1105.It 1106umac-128-etm@openssh.com 1107.El 1108.Pp 1109The default is: 1110.Bd -literal -offset indent 1111umac-64-etm@openssh.com,umac-128-etm@openssh.com, 1112hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com, 1113hmac-sha1-etm@openssh.com, 1114umac-64@openssh.com,umac-128@openssh.com, 1115hmac-sha2-256,hmac-sha2-512,hmac-sha1 1116.Ed 1117.Pp 1118The list of available MAC algorithms may also be obtained using 1119.Qq ssh -Q mac . 1120.It Cm Match 1121Introduces a conditional block. 1122If all of the criteria on the 1123.Cm Match 1124line are satisfied, the keywords on the following lines override those 1125set in the global section of the config file, until either another 1126.Cm Match 1127line or the end of the file. 1128If a keyword appears in multiple 1129.Cm Match 1130blocks that are satisfied, only the first instance of the keyword is 1131applied. 1132.Pp 1133The arguments to 1134.Cm Match 1135are one or more criteria-pattern pairs or the single token 1136.Cm All 1137which matches all criteria. 1138The available criteria are 1139.Cm User , 1140.Cm Group , 1141.Cm Host , 1142.Cm LocalAddress , 1143.Cm LocalPort , 1144.Cm RDomain , 1145and 1146.Cm Address 1147(with 1148.Cm RDomain 1149representing the 1150.Xr rdomain 4 1151on which the connection was received). 1152.Pp 1153The match patterns may consist of single entries or comma-separated 1154lists and may use the wildcard and negation operators described in the 1155.Sx PATTERNS 1156section of 1157.Xr ssh_config 5 . 1158.Pp 1159The patterns in an 1160.Cm Address 1161criteria may additionally contain addresses to match in CIDR 1162address/masklen format, 1163such as 192.0.2.0/24 or 2001:db8::/32. 1164Note that the mask length provided must be consistent with the address - 1165it is an error to specify a mask length that is too long for the address 1166or one with bits set in this host portion of the address. 1167For example, 192.0.2.0/33 and 192.0.2.0/8, respectively. 1168.Pp 1169Only a subset of keywords may be used on the lines following a 1170.Cm Match 1171keyword. 1172Available keywords are 1173.Cm AcceptEnv , 1174.Cm AllowAgentForwarding , 1175.Cm AllowGroups , 1176.Cm AllowStreamLocalForwarding , 1177.Cm AllowTcpForwarding , 1178.Cm AllowUsers , 1179.Cm AuthenticationMethods , 1180.Cm AuthorizedKeysCommand , 1181.Cm AuthorizedKeysCommandUser , 1182.Cm AuthorizedKeysFile , 1183.Cm AuthorizedPrincipalsCommand , 1184.Cm AuthorizedPrincipalsCommandUser , 1185.Cm AuthorizedPrincipalsFile , 1186.Cm Banner , 1187.Cm ChrootDirectory , 1188.Cm ClientAliveCountMax , 1189.Cm ClientAliveInterval , 1190.Cm DenyGroups , 1191.Cm DenyUsers , 1192.Cm DisableForwarding , 1193.Cm ForceCommand , 1194.Cm GatewayPorts , 1195.Cm GSSAPIAuthentication , 1196.Cm HostbasedAcceptedAlgorithms , 1197.Cm HostbasedAuthentication , 1198.Cm HostbasedUsesNameFromPacketOnly , 1199.Cm IgnoreRhosts , 1200.Cm Include , 1201.Cm IPQoS , 1202.Cm KbdInteractiveAuthentication , 1203.Cm KerberosAuthentication , 1204.Cm LogLevel , 1205.Cm MaxAuthTries , 1206.Cm MaxSessions , 1207.Cm PasswordAuthentication , 1208.Cm PermitEmptyPasswords , 1209.Cm PermitListen , 1210.Cm PermitOpen , 1211.Cm PermitRootLogin , 1212.Cm PermitTTY , 1213.Cm PermitTunnel , 1214.Cm PermitUserRC , 1215.Cm PubkeyAcceptedAlgorithms , 1216.Cm PubkeyAuthentication , 1217.Cm RekeyLimit , 1218.Cm RevokedKeys , 1219.Cm RDomain , 1220.Cm SetEnv , 1221.Cm StreamLocalBindMask , 1222.Cm StreamLocalBindUnlink , 1223.Cm TrustedUserCAKeys , 1224.Cm X11DisplayOffset , 1225.Cm X11Forwarding 1226and 1227.Cm X11UseLocalhost . 1228.It Cm MaxAuthTries 1229Specifies the maximum number of authentication attempts permitted per 1230connection. 1231Once the number of failures reaches half this value, 1232additional failures are logged. 1233The default is 6. 1234.It Cm MaxSessions 1235Specifies the maximum number of open shell, login or subsystem (e.g. sftp) 1236sessions permitted per network connection. 1237Multiple sessions may be established by clients that support connection 1238multiplexing. 1239Setting 1240.Cm MaxSessions 1241to 1 will effectively disable session multiplexing, whereas setting it to 0 1242will prevent all shell, login and subsystem sessions while still permitting 1243forwarding. 1244The default is 10. 1245.It Cm MaxStartups 1246Specifies the maximum number of concurrent unauthenticated connections to the 1247SSH daemon. 1248Additional connections will be dropped until authentication succeeds or the 1249.Cm LoginGraceTime 1250expires for a connection. 1251The default is 10:30:100. 1252.Pp 1253Alternatively, random early drop can be enabled by specifying 1254the three colon separated values 1255start:rate:full (e.g. "10:30:60"). 1256.Xr sshd 8 1257will refuse connection attempts with a probability of rate/100 (30%) 1258if there are currently start (10) unauthenticated connections. 1259The probability increases linearly and all connection attempts 1260are refused if the number of unauthenticated connections reaches full (60). 1261.It Cm PasswordAuthentication 1262Specifies whether password authentication is allowed. 1263The default is 1264.Cm yes . 1265.It Cm PermitEmptyPasswords 1266When password authentication is allowed, it specifies whether the 1267server allows login to accounts with empty password strings. 1268The default is 1269.Cm no . 1270.It Cm PermitListen 1271Specifies the addresses/ports on which a remote TCP port forwarding may listen. 1272The listen specification must be one of the following forms: 1273.Pp 1274.Bl -item -offset indent -compact 1275.It 1276.Cm PermitListen 1277.Sm off 1278.Ar port 1279.Sm on 1280.It 1281.Cm PermitListen 1282.Sm off 1283.Ar host : port 1284.Sm on 1285.El 1286.Pp 1287Multiple permissions may be specified by separating them with whitespace. 1288An argument of 1289.Cm any 1290can be used to remove all restrictions and permit any listen requests. 1291An argument of 1292.Cm none 1293can be used to prohibit all listen requests. 1294The host name may contain wildcards as described in the PATTERNS section in 1295.Xr ssh_config 5 . 1296The wildcard 1297.Sq * 1298can also be used in place of a port number to allow all ports. 1299By default all port forwarding listen requests are permitted. 1300Note that the 1301.Cm GatewayPorts 1302option may further restrict which addresses may be listened on. 1303Note also that 1304.Xr ssh 1 1305will request a listen host of 1306.Dq localhost 1307if no listen host was specifically requested, and this name is 1308treated differently to explicit localhost addresses of 1309.Dq 127.0.0.1 1310and 1311.Dq ::1 . 1312.It Cm PermitOpen 1313Specifies the destinations to which TCP port forwarding is permitted. 1314The forwarding specification must be one of the following forms: 1315.Pp 1316.Bl -item -offset indent -compact 1317.It 1318.Cm PermitOpen 1319.Sm off 1320.Ar host : port 1321.Sm on 1322.It 1323.Cm PermitOpen 1324.Sm off 1325.Ar IPv4_addr : port 1326.Sm on 1327.It 1328.Cm PermitOpen 1329.Sm off 1330.Ar \&[ IPv6_addr \&] : port 1331.Sm on 1332.El 1333.Pp 1334Multiple forwards may be specified by separating them with whitespace. 1335An argument of 1336.Cm any 1337can be used to remove all restrictions and permit any forwarding requests. 1338An argument of 1339.Cm none 1340can be used to prohibit all forwarding requests. 1341The wildcard 1342.Sq * 1343can be used for host or port to allow all hosts or ports respectively. 1344Otherwise, no pattern matching or address lookups are performed on supplied 1345names. 1346By default all port forwarding requests are permitted. 1347.It Cm PermitRootLogin 1348Specifies whether root can log in using 1349.Xr ssh 1 . 1350The argument must be 1351.Cm yes , 1352.Cm prohibit-password , 1353.Cm forced-commands-only , 1354or 1355.Cm no . 1356The default is 1357.Cm prohibit-password . 1358.Pp 1359If this option is set to 1360.Cm prohibit-password 1361(or its deprecated alias, 1362.Cm without-password ) , 1363password and keyboard-interactive authentication are disabled for root. 1364.Pp 1365If this option is set to 1366.Cm forced-commands-only , 1367root login with public key authentication will be allowed, 1368but only if the 1369.Ar command 1370option has been specified 1371(which may be useful for taking remote backups even if root login is 1372normally not allowed). 1373All other authentication methods are disabled for root. 1374.Pp 1375If this option is set to 1376.Cm no , 1377root is not allowed to log in. 1378.It Cm PermitTTY 1379Specifies whether 1380.Xr pty 4 1381allocation is permitted. 1382The default is 1383.Cm yes . 1384.It Cm PermitTunnel 1385Specifies whether 1386.Xr tun 4 1387device forwarding is allowed. 1388The argument must be 1389.Cm yes , 1390.Cm point-to-point 1391(layer 3), 1392.Cm ethernet 1393(layer 2), or 1394.Cm no . 1395Specifying 1396.Cm yes 1397permits both 1398.Cm point-to-point 1399and 1400.Cm ethernet . 1401The default is 1402.Cm no . 1403.Pp 1404Independent of this setting, the permissions of the selected 1405.Xr tun 4 1406device must allow access to the user. 1407.It Cm PermitUserEnvironment 1408Specifies whether 1409.Pa ~/.ssh/environment 1410and 1411.Cm environment= 1412options in 1413.Pa ~/.ssh/authorized_keys 1414are processed by 1415.Xr sshd 8 . 1416Valid options are 1417.Cm yes , 1418.Cm no 1419or a pattern-list specifying which environment variable names to accept 1420(for example 1421.Qq LANG,LC_* ) . 1422The default is 1423.Cm no . 1424Enabling environment processing may enable users to bypass access 1425restrictions in some configurations using mechanisms such as 1426.Ev LD_PRELOAD . 1427.It Cm PermitUserRC 1428Specifies whether any 1429.Pa ~/.ssh/rc 1430file is executed. 1431The default is 1432.Cm yes . 1433.It Cm PerSourceMaxStartups 1434Specifies the number of unauthenticated connections allowed from a 1435given source address, or 1436.Dq none 1437if there is no limit. 1438This limit is applied in addition to 1439.Cm MaxStartups , 1440whichever is lower. 1441The default is 1442.Cm none . 1443.It Cm PerSourceNetBlockSize 1444Specifies the number of bits of source address that are grouped together 1445for the purposes of applying PerSourceMaxStartups limits. 1446Values for IPv4 and optionally IPv6 may be specified, separated by a colon. 1447The default is 1448.Cm 32:128 , 1449which means each address is considered individually. 1450.It Cm PidFile 1451Specifies the file that contains the process ID of the 1452SSH daemon, or 1453.Cm none 1454to not write one. 1455The default is 1456.Pa /var/run/sshd.pid . 1457.It Cm Port 1458Specifies the port number that 1459.Xr sshd 8 1460listens on. 1461The default is 22. 1462Multiple options of this type are permitted. 1463See also 1464.Cm ListenAddress . 1465.It Cm PrintLastLog 1466Specifies whether 1467.Xr sshd 8 1468should print the date and time of the last user login when a user logs 1469in interactively. 1470The default is 1471.Cm yes . 1472.It Cm PrintMotd 1473Specifies whether 1474.Xr sshd 8 1475should print 1476.Pa /etc/motd 1477when a user logs in interactively. 1478(On some systems it is also printed by the shell, 1479.Pa /etc/profile , 1480or equivalent.) 1481The default is 1482.Cm yes . 1483.It Cm PubkeyAcceptedAlgorithms 1484Specifies the signature algorithms that will be accepted for public key 1485authentication as a list of comma-separated patterns. 1486Alternately if the specified list begins with a 1487.Sq + 1488character, then the specified algorithms will be appended to the default set 1489instead of replacing them. 1490If the specified list begins with a 1491.Sq - 1492character, then the specified algorithms (including wildcards) will be removed 1493from the default set instead of replacing them. 1494If the specified list begins with a 1495.Sq ^ 1496character, then the specified algorithms will be placed at the head of the 1497default set. 1498The default for this option is: 1499.Bd -literal -offset 3n 1500ssh-ed25519-cert-v01@openssh.com, 1501ecdsa-sha2-nistp256-cert-v01@openssh.com, 1502ecdsa-sha2-nistp384-cert-v01@openssh.com, 1503ecdsa-sha2-nistp521-cert-v01@openssh.com, 1504sk-ssh-ed25519-cert-v01@openssh.com, 1505sk-ecdsa-sha2-nistp256-cert-v01@openssh.com, 1506rsa-sha2-512-cert-v01@openssh.com, 1507rsa-sha2-256-cert-v01@openssh.com, 1508ssh-rsa-cert-v01@openssh.com, 1509ssh-ed25519, 1510ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, 1511sk-ssh-ed25519@openssh.com, 1512sk-ecdsa-sha2-nistp256@openssh.com, 1513rsa-sha2-512,rsa-sha2-256,ssh-rsa 1514.Ed 1515.Pp 1516The list of available signature algorithms may also be obtained using 1517.Qq ssh -Q PubkeyAcceptedAlgorithms . 1518.It Cm PubkeyAuthOptions 1519Sets one or more public key authentication options. 1520The supported keywords are: 1521.Cm none 1522(the default; indicating no additional options are enabled), 1523.Cm touch-required 1524and 1525.Cm verify-required . 1526.Pp 1527The 1528.Cm touch-required 1529option causes public key authentication using a FIDO authenticator algorithm 1530(i.e.\& 1531.Cm ecdsa-sk 1532or 1533.Cm ed25519-sk ) 1534to always require the signature to attest that a physically present user 1535explicitly confirmed the authentication (usually by touching the authenticator). 1536By default, 1537.Xr sshd 8 1538requires user presence unless overridden with an authorized_keys option. 1539The 1540.Cm touch-required 1541flag disables this override. 1542.Pp 1543The 1544.Cm verify-required 1545option requires a FIDO key signature attest that the user was verified, 1546e.g. via a PIN. 1547.Pp 1548Neither the 1549.Cm touch-required 1550or 1551.Cm verify-required 1552options have any effect for other, non-FIDO, public key types. 1553.It Cm PubkeyAuthentication 1554Specifies whether public key authentication is allowed. 1555The default is 1556.Cm yes . 1557.It Cm RekeyLimit 1558Specifies the maximum amount of data that may be transmitted before the 1559session key is renegotiated, optionally followed by a maximum amount of 1560time that may pass before the session key is renegotiated. 1561The first argument is specified in bytes and may have a suffix of 1562.Sq K , 1563.Sq M , 1564or 1565.Sq G 1566to indicate Kilobytes, Megabytes, or Gigabytes, respectively. 1567The default is between 1568.Sq 1G 1569and 1570.Sq 4G , 1571depending on the cipher. 1572The optional second value is specified in seconds and may use any of the 1573units documented in the 1574.Sx TIME FORMATS 1575section. 1576The default value for 1577.Cm RekeyLimit 1578is 1579.Cm default none , 1580which means that rekeying is performed after the cipher's default amount 1581of data has been sent or received and no time based rekeying is done. 1582.It Cm RevokedKeys 1583Specifies revoked public keys file, or 1584.Cm none 1585to not use one. 1586Keys listed in this file will be refused for public key authentication. 1587Note that if this file is not readable, then public key authentication will 1588be refused for all users. 1589Keys may be specified as a text file, listing one public key per line, or as 1590an OpenSSH Key Revocation List (KRL) as generated by 1591.Xr ssh-keygen 1 . 1592For more information on KRLs, see the KEY REVOCATION LISTS section in 1593.Xr ssh-keygen 1 . 1594.It Cm RDomain 1595Specifies an explicit routing domain that is applied after authentication 1596has completed. 1597The user session, as well and any forwarded or listening IP sockets, 1598will be bound to this 1599.Xr rdomain 4 . 1600If the routing domain is set to 1601.Cm \&%D , 1602then the domain in which the incoming connection was received will be applied. 1603.It Cm SecurityKeyProvider 1604Specifies a path to a library that will be used when loading 1605FIDO authenticator-hosted keys, overriding the default of using 1606the built-in USB HID support. 1607.It Cm SetEnv 1608Specifies one or more environment variables to set in child sessions started 1609by 1610.Xr sshd 8 1611as 1612.Dq NAME=VALUE . 1613The environment value may be quoted (e.g. if it contains whitespace 1614characters). 1615Environment variables set by 1616.Cm SetEnv 1617override the default environment and any variables specified by the user 1618via 1619.Cm AcceptEnv 1620or 1621.Cm PermitUserEnvironment . 1622.It Cm StreamLocalBindMask 1623Sets the octal file creation mode mask 1624.Pq umask 1625used when creating a Unix-domain socket file for local or remote 1626port forwarding. 1627This option is only used for port forwarding to a Unix-domain socket file. 1628.Pp 1629The default value is 0177, which creates a Unix-domain socket file that is 1630readable and writable only by the owner. 1631Note that not all operating systems honor the file mode on Unix-domain 1632socket files. 1633.It Cm StreamLocalBindUnlink 1634Specifies whether to remove an existing Unix-domain socket file for local 1635or remote port forwarding before creating a new one. 1636If the socket file already exists and 1637.Cm StreamLocalBindUnlink 1638is not enabled, 1639.Nm sshd 1640will be unable to forward the port to the Unix-domain socket file. 1641This option is only used for port forwarding to a Unix-domain socket file. 1642.Pp 1643The argument must be 1644.Cm yes 1645or 1646.Cm no . 1647The default is 1648.Cm no . 1649.It Cm StrictModes 1650Specifies whether 1651.Xr sshd 8 1652should check file modes and ownership of the 1653user's files and home directory before accepting login. 1654This is normally desirable because novices sometimes accidentally leave their 1655directory or files world-writable. 1656The default is 1657.Cm yes . 1658Note that this does not apply to 1659.Cm ChrootDirectory , 1660whose permissions and ownership are checked unconditionally. 1661.It Cm Subsystem 1662Configures an external subsystem (e.g. file transfer daemon). 1663Arguments should be a subsystem name and a command (with optional arguments) 1664to execute upon subsystem request. 1665.Pp 1666The command 1667.Cm sftp-server 1668implements the SFTP file transfer subsystem. 1669.Pp 1670Alternately the name 1671.Cm internal-sftp 1672implements an in-process SFTP server. 1673This may simplify configurations using 1674.Cm ChrootDirectory 1675to force a different filesystem root on clients. 1676.Pp 1677By default no subsystems are defined. 1678.It Cm SyslogFacility 1679Gives the facility code that is used when logging messages from 1680.Xr sshd 8 . 1681The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2, 1682LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. 1683The default is AUTH. 1684.It Cm TCPKeepAlive 1685Specifies whether the system should send TCP keepalive messages to the 1686other side. 1687If they are sent, death of the connection or crash of one 1688of the machines will be properly noticed. 1689However, this means that 1690connections will die if the route is down temporarily, and some people 1691find it annoying. 1692On the other hand, if TCP keepalives are not sent, 1693sessions may hang indefinitely on the server, leaving 1694.Qq ghost 1695users and consuming server resources. 1696.Pp 1697The default is 1698.Cm yes 1699(to send TCP keepalive messages), and the server will notice 1700if the network goes down or the client host crashes. 1701This avoids infinitely hanging sessions. 1702.Pp 1703To disable TCP keepalive messages, the value should be set to 1704.Cm no . 1705.It Cm TrustedUserCAKeys 1706Specifies a file containing public keys of certificate authorities that are 1707trusted to sign user certificates for authentication, or 1708.Cm none 1709to not use one. 1710Keys are listed one per line; empty lines and comments starting with 1711.Ql # 1712are allowed. 1713If a certificate is presented for authentication and has its signing CA key 1714listed in this file, then it may be used for authentication for any user 1715listed in the certificate's principals list. 1716Note that certificates that lack a list of principals will not be permitted 1717for authentication using 1718.Cm TrustedUserCAKeys . 1719For more details on certificates, see the CERTIFICATES section in 1720.Xr ssh-keygen 1 . 1721.It Cm UseDNS 1722Specifies whether 1723.Xr sshd 8 1724should look up the remote host name, and to check that 1725the resolved host name for the remote IP address maps back to the 1726very same IP address. 1727.Pp 1728If this option is set to 1729.Cm no 1730(the default) then only addresses and not host names may be used in 1731.Pa ~/.ssh/authorized_keys 1732.Cm from 1733and 1734.Nm 1735.Cm Match 1736.Cm Host 1737directives. 1738.It Cm VersionAddendum 1739Optionally specifies additional text to append to the SSH protocol banner 1740sent by the server upon connection. 1741The default is 1742.Cm none . 1743.It Cm X11DisplayOffset 1744Specifies the first display number available for 1745.Xr sshd 8 Ns 's 1746X11 forwarding. 1747This prevents sshd from interfering with real X11 servers. 1748The default is 10. 1749.It Cm X11Forwarding 1750Specifies whether X11 forwarding is permitted. 1751The argument must be 1752.Cm yes 1753or 1754.Cm no . 1755The default is 1756.Cm no . 1757.Pp 1758When X11 forwarding is enabled, there may be additional exposure to 1759the server and to client displays if the 1760.Xr sshd 8 1761proxy display is configured to listen on the wildcard address (see 1762.Cm X11UseLocalhost ) , 1763though this is not the default. 1764Additionally, the authentication spoofing and authentication data 1765verification and substitution occur on the client side. 1766The security risk of using X11 forwarding is that the client's X11 1767display server may be exposed to attack when the SSH client requests 1768forwarding (see the warnings for 1769.Cm ForwardX11 1770in 1771.Xr ssh_config 5 ) . 1772A system administrator may have a stance in which they want to 1773protect clients that may expose themselves to attack by unwittingly 1774requesting X11 forwarding, which can warrant a 1775.Cm no 1776setting. 1777.Pp 1778Note that disabling X11 forwarding does not prevent users from 1779forwarding X11 traffic, as users can always install their own forwarders. 1780.It Cm X11UseLocalhost 1781Specifies whether 1782.Xr sshd 8 1783should bind the X11 forwarding server to the loopback address or to 1784the wildcard address. 1785By default, 1786sshd binds the forwarding server to the loopback address and sets the 1787hostname part of the 1788.Ev DISPLAY 1789environment variable to 1790.Cm localhost . 1791This prevents remote hosts from connecting to the proxy display. 1792However, some older X11 clients may not function with this 1793configuration. 1794.Cm X11UseLocalhost 1795may be set to 1796.Cm no 1797to specify that the forwarding server should be bound to the wildcard 1798address. 1799The argument must be 1800.Cm yes 1801or 1802.Cm no . 1803The default is 1804.Cm yes . 1805.It Cm XAuthLocation 1806Specifies the full pathname of the 1807.Xr xauth 1 1808program, or 1809.Cm none 1810to not use one. 1811The default is 1812.Pa /usr/X11R6/bin/xauth . 1813.El 1814.Sh TIME FORMATS 1815.Xr sshd 8 1816command-line arguments and configuration file options that specify time 1817may be expressed using a sequence of the form: 1818.Sm off 1819.Ar time Op Ar qualifier , 1820.Sm on 1821where 1822.Ar time 1823is a positive integer value and 1824.Ar qualifier 1825is one of the following: 1826.Pp 1827.Bl -tag -width Ds -compact -offset indent 1828.It Aq Cm none 1829seconds 1830.It Cm s | Cm S 1831seconds 1832.It Cm m | Cm M 1833minutes 1834.It Cm h | Cm H 1835hours 1836.It Cm d | Cm D 1837days 1838.It Cm w | Cm W 1839weeks 1840.El 1841.Pp 1842Each member of the sequence is added together to calculate 1843the total time value. 1844.Pp 1845Time format examples: 1846.Pp 1847.Bl -tag -width Ds -compact -offset indent 1848.It 600 1849600 seconds (10 minutes) 1850.It 10m 185110 minutes 1852.It 1h30m 18531 hour 30 minutes (90 minutes) 1854.El 1855.Sh TOKENS 1856Arguments to some keywords can make use of tokens, 1857which are expanded at runtime: 1858.Pp 1859.Bl -tag -width XXXX -offset indent -compact 1860.It %% 1861A literal 1862.Sq % . 1863.It \&%D 1864The routing domain in which the incoming connection was received. 1865.It %F 1866The fingerprint of the CA key. 1867.It %f 1868The fingerprint of the key or certificate. 1869.It %h 1870The home directory of the user. 1871.It %i 1872The key ID in the certificate. 1873.It %K 1874The base64-encoded CA key. 1875.It %k 1876The base64-encoded key or certificate for authentication. 1877.It %s 1878The serial number of the certificate. 1879.It \&%T 1880The type of the CA key. 1881.It %t 1882The key or certificate type. 1883.It \&%U 1884The numeric user ID of the target user. 1885.It %u 1886The username. 1887.El 1888.Pp 1889.Cm AuthorizedKeysCommand 1890accepts the tokens %%, %f, %h, %k, %t, %U, and %u. 1891.Pp 1892.Cm AuthorizedKeysFile 1893accepts the tokens %%, %h, %U, and %u. 1894.Pp 1895.Cm AuthorizedPrincipalsCommand 1896accepts the tokens %%, %F, %f, %h, %i, %K, %k, %s, %T, %t, %U, and %u. 1897.Pp 1898.Cm AuthorizedPrincipalsFile 1899accepts the tokens %%, %h, %U, and %u. 1900.Pp 1901.Cm ChrootDirectory 1902accepts the tokens %%, %h, %U, and %u. 1903.Pp 1904.Cm RoutingDomain 1905accepts the token %D. 1906.Sh FILES 1907.Bl -tag -width Ds 1908.It Pa /etc/ssh/sshd_config 1909Contains configuration data for 1910.Xr sshd 8 . 1911This file should be writable by root only, but it is recommended 1912(though not necessary) that it be world-readable. 1913.El 1914.Sh SEE ALSO 1915.Xr sftp-server 8 , 1916.Xr sshd 8 1917.Sh AUTHORS 1918.An -nosplit 1919OpenSSH is a derivative of the original and free 1920ssh 1.2.12 release by 1921.An Tatu Ylonen . 1922.An Aaron Campbell , Bob Beck , Markus Friedl , Niels Provos , 1923.An Theo de Raadt 1924and 1925.An Dug Song 1926removed many bugs, re-added newer features and 1927created OpenSSH. 1928.An Markus Friedl 1929contributed the support for SSH protocol versions 1.5 and 2.0. 1930.An Niels Provos 1931and 1932.An Markus Friedl 1933contributed support for privilege separation. 1934