1.\" $NetBSD: sshd_config.5,v 1.31 2020/05/28 17:05:49 christos Exp $ 2.\" -*- nroff -*- 3.\" 4.\" Author: Tatu Ylonen <ylo@cs.hut.fi> 5.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 6.\" All rights reserved 7.\" 8.\" As far as I am concerned, the code I have written for this software 9.\" can be used freely for any purpose. Any derived versions of this 10.\" software must be clearly marked as such, and if the derived work is 11.\" incompatible with the protocol description in the RFC file, it must be 12.\" called by a name other than "ssh" or "Secure Shell". 13.\" 14.\" Copyright (c) 1999,2000 Markus Friedl. All rights reserved. 15.\" Copyright (c) 1999 Aaron Campbell. All rights reserved. 16.\" Copyright (c) 1999 Theo de Raadt. All rights reserved. 17.\" 18.\" Redistribution and use in source and binary forms, with or without 19.\" modification, are permitted provided that the following conditions 20.\" are met: 21.\" 1. Redistributions of source code must retain the above copyright 22.\" notice, this list of conditions and the following disclaimer. 23.\" 2. Redistributions in binary form must reproduce the above copyright 24.\" notice, this list of conditions and the following disclaimer in the 25.\" documentation and/or other materials provided with the distribution. 26.\" 27.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 28.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 29.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 30.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 31.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 32.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 33.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 34.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 35.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 36.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 37.\" 38.\" $OpenBSD: sshd_config.5,v 1.311 2020/04/17 06:12:41 jmc Exp $ 39.Dd April 17 2020 40.Dt SSHD_CONFIG 5 41.Os 42.Sh NAME 43.Nm sshd_config 44.Nd OpenSSH daemon configuration file 45.Sh DESCRIPTION 46.Xr sshd 8 47reads configuration data from 48.Pa /etc/ssh/sshd_config 49(or the file specified with 50.Fl f 51on the command line). 52The file contains keyword-argument pairs, one per line. 53For each keyword, the first obtained value will be used. 54Lines starting with 55.Ql # 56and empty lines are interpreted as comments. 57Arguments may optionally be enclosed in double quotes 58.Pq \&" 59in order to represent arguments containing spaces. 60.Pp 61The possible 62keywords and their meanings are as follows (note that 63keywords are case-insensitive and arguments are case-sensitive): 64.Bl -tag -width Ds 65.It Cm AcceptEnv 66Specifies what environment variables sent by the client will be copied into 67the session's 68.Xr environ 7 . 69See 70.Cm SendEnv 71and 72.Cm SetEnv 73in 74.Xr ssh_config 5 75for how to configure the client. 76The 77.Ev TERM 78environment variable is always accepted whenever the client 79requests a pseudo-terminal as it is required by the protocol. 80Variables are specified by name, which may contain the wildcard characters 81.Ql * 82and 83.Ql \&? . 84Multiple environment variables may be separated by whitespace or spread 85across multiple 86.Cm AcceptEnv 87directives. 88Be warned that some environment variables could be used to bypass restricted 89user environments. 90For this reason, care should be taken in the use of this directive. 91The default is not to accept any environment variables. 92.It Cm AddressFamily 93Specifies which address family should be used by 94.Xr sshd 8 . 95Valid arguments are 96.Cm any 97(the default), 98.Cm inet 99(use IPv4 only), or 100.Cm inet6 101(use IPv6 only). 102.It Cm AllowAgentForwarding 103Specifies whether 104.Xr ssh-agent 1 105forwarding is permitted. 106The default is 107.Cm yes . 108Note that disabling agent forwarding does not improve security 109unless users are also denied shell access, as they can always install 110their own forwarders. 111.It Cm AllowGroups 112This keyword can be followed by a list of group name patterns, separated 113by spaces. 114If specified, login is allowed only for users whose primary 115group or supplementary group list matches one of the patterns. 116Only group names are valid; a numerical group ID is not recognized. 117By default, login is allowed for all groups. 118The allow/deny groups directives are processed in the following order: 119.Cm DenyGroups , 120.Cm AllowGroups . 121.Pp 122See PATTERNS in 123.Xr ssh_config 5 124for more information on patterns. 125.It Cm AllowStreamLocalForwarding 126Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted. 127The available options are 128.Cm yes 129(the default) 130or 131.Cm all 132to allow StreamLocal forwarding, 133.Cm no 134to prevent all StreamLocal forwarding, 135.Cm local 136to allow local (from the perspective of 137.Xr ssh 1 ) 138forwarding only or 139.Cm remote 140to allow remote forwarding only. 141Note that disabling StreamLocal forwarding does not improve security unless 142users are also denied shell access, as they can always install their 143own forwarders. 144.It Cm AllowTcpForwarding 145Specifies whether TCP forwarding is permitted. 146The available options are 147.Cm yes 148(the default) 149or 150.Cm all 151to allow TCP forwarding, 152.Cm no 153to prevent all TCP forwarding, 154.Cm local 155to allow local (from the perspective of 156.Xr ssh 1 ) 157forwarding only or 158.Cm remote 159to allow remote forwarding only. 160Note that disabling TCP forwarding does not improve security unless 161users are also denied shell access, as they can always install their 162own forwarders. 163.It Cm AllowUsers 164This keyword can be followed by a list of user name patterns, separated 165by spaces. 166If specified, login is allowed only for user names that 167match one of the patterns. 168Only user names are valid; a numerical user ID is not recognized. 169By default, login is allowed for all users. 170If the pattern takes the form USER@HOST then USER and HOST 171are separately checked, restricting logins to particular 172users from particular hosts. 173HOST criteria may additionally contain addresses to match in CIDR 174address/masklen format. 175The allow/deny users directives are processed in the following order: 176.Cm DenyUsers , 177.Cm AllowUsers . 178.Pp 179See PATTERNS in 180.Xr ssh_config 5 181for more information on patterns. 182.It Cm AuthenticationMethods 183Specifies the authentication methods that must be successfully completed 184for a user to be granted access. 185This option must be followed by one or more lists of comma-separated 186authentication method names, or by the single string 187.Cm any 188to indicate the default behaviour of accepting any single authentication 189method. 190If the default is overridden, then successful authentication requires 191completion of every method in at least one of these lists. 192.Pp 193For example, 194.Qq publickey,password publickey,keyboard-interactive 195would require the user to complete public key authentication, followed by 196either password or keyboard interactive authentication. 197Only methods that are next in one or more lists are offered at each stage, 198so for this example it would not be possible to attempt password or 199keyboard-interactive authentication before public key. 200.Pp 201For keyboard interactive authentication it is also possible to 202restrict authentication to a specific device by appending a 203colon followed by the device identifier 204.Cm bsdauth , 205.Cm pam , 206or 207.Cm skey , 208depending on the server configuration. 209For example, 210.Qq keyboard-interactive:bsdauth 211would restrict keyboard interactive authentication to the 212.Cm bsdauth 213device. 214.Pp 215If the publickey method is listed more than once, 216.Xr sshd 8 217verifies that keys that have been used successfully are not reused for 218subsequent authentications. 219For example, 220.Qq publickey,publickey 221requires successful authentication using two different public keys. 222.Pp 223Note that each authentication method listed should also be explicitly enabled 224in the configuration. 225.Pp 226The available authentication methods are: 227.Qq gssapi-with-mic , 228.Qq hostbased , 229.Qq keyboard-interactive , 230.Qq none 231(used for access to password-less accounts when 232.Cm PermitEmptyPasswords 233is enabled), 234.Qq password 235and 236.Qq publickey . 237.It Cm AuthorizedKeysCommand 238Specifies a program to be used to look up the user's public keys. 239The program must be owned by root, not writable by group or others and 240specified by an absolute path. 241Arguments to 242.Cm AuthorizedKeysCommand 243accept the tokens described in the 244.Sx TOKENS 245section. 246If no arguments are specified then the username of the target user is used. 247.Pp 248The program should produce on standard output zero or 249more lines of authorized_keys output (see 250.Sx AUTHORIZED_KEYS 251in 252.Xr sshd 8 ) . 253.Cm AuthorizedKeysCommand 254is tried after the usual 255.Cm AuthorizedKeysFile 256files and will not be executed if a matching key is found there. 257By default, no 258.Cm AuthorizedKeysCommand 259is run. 260.It Cm AuthorizedKeysCommandUser 261Specifies the user under whose account the 262.Cm AuthorizedKeysCommand 263is run. 264It is recommended to use a dedicated user that has no other role on the host 265than running authorized keys commands. 266If 267.Cm AuthorizedKeysCommand 268is specified but 269.Cm AuthorizedKeysCommandUser 270is not, then 271.Xr sshd 8 272will refuse to start. 273.It Cm AuthorizedKeysFile 274Specifies the file that contains the public keys used for user authentication. 275The format is described in the AUTHORIZED_KEYS FILE FORMAT section of 276.Xr sshd 8 . 277Arguments to 278.Cm AuthorizedKeysFile 279accept the tokens described in the 280.Sx TOKENS 281section. 282After expansion, 283.Cm AuthorizedKeysFile 284is taken to be an absolute path or one relative to the user's home 285directory. 286Multiple files may be listed, separated by whitespace. 287Alternately this option may be set to 288.Cm none 289to skip checking for user keys in files. 290The default is 291.Qq .ssh/authorized_keys .ssh/authorized_keys2 . 292.It Cm AuthorizedPrincipalsCommand 293Specifies a program to be used to generate the list of allowed 294certificate principals as per 295.Cm AuthorizedPrincipalsFile . 296The program must be owned by root, not writable by group or others and 297specified by an absolute path. 298Arguments to 299.Cm AuthorizedPrincipalsCommand 300accept the tokens described in the 301.Sx TOKENS 302section. 303If no arguments are specified then the username of the target user is used. 304.Pp 305The program should produce on standard output zero or 306more lines of 307.Cm AuthorizedPrincipalsFile 308output. 309If either 310.Cm AuthorizedPrincipalsCommand 311or 312.Cm AuthorizedPrincipalsFile 313is specified, then certificates offered by the client for authentication 314must contain a principal that is listed. 315By default, no 316.Cm AuthorizedPrincipalsCommand 317is run. 318.It Cm AuthorizedPrincipalsCommandUser 319Specifies the user under whose account the 320.Cm AuthorizedPrincipalsCommand 321is run. 322It is recommended to use a dedicated user that has no other role on the host 323than running authorized principals commands. 324If 325.Cm AuthorizedPrincipalsCommand 326is specified but 327.Cm AuthorizedPrincipalsCommandUser 328is not, then 329.Xr sshd 8 330will refuse to start. 331.It Cm AuthorizedPrincipalsFile 332Specifies a file that lists principal names that are accepted for 333certificate authentication. 334When using certificates signed by a key listed in 335.Cm TrustedUserCAKeys , 336this file lists names, one of which must appear in the certificate for it 337to be accepted for authentication. 338Names are listed one per line preceded by key options (as described in 339.Sx AUTHORIZED_KEYS FILE FORMAT 340in 341.Xr sshd 8 ) . 342Empty lines and comments starting with 343.Ql # 344are ignored. 345.Pp 346Arguments to 347.Cm AuthorizedPrincipalsFile 348accept the tokens described in the 349.Sx TOKENS 350section. 351After expansion, 352.Cm AuthorizedPrincipalsFile 353is taken to be an absolute path or one relative to the user's home directory. 354The default is 355.Cm none , 356i.e. not to use a principals file \(en in this case, the username 357of the user must appear in a certificate's principals list for it to be 358accepted. 359.Pp 360Note that 361.Cm AuthorizedPrincipalsFile 362is only used when authentication proceeds using a CA listed in 363.Cm TrustedUserCAKeys 364and is not consulted for certification authorities trusted via 365.Pa ~/.ssh/authorized_keys , 366though the 367.Cm principals= 368key option offers a similar facility (see 369.Xr sshd 8 370for details). 371.It Cm Banner 372The contents of the specified file are sent to the remote user before 373authentication is allowed. 374If the argument is 375.Cm none 376then no banner is displayed. 377By default, no banner is displayed. 378.It Cm CASignatureAlgorithms 379Specifies which algorithms are allowed for signing of certificates 380by certificate authorities (CAs). 381The default is: 382.Bd -literal -offset indent 383ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, 384ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa 385.Ed 386.Pp 387Certificates signed using other algorithms will not be accepted for 388public key or host-based authentication. 389.It Cm ChallengeResponseAuthentication 390Specifies whether challenge-response authentication is allowed. 391All authentication styles from 392.Xr login.conf 5 393are supported. 394The default is 395.Cm yes . 396.It Cm ChrootDirectory 397Specifies the pathname of a directory to 398.Xr chroot 2 399to after authentication. 400At session startup 401.Xr sshd 8 402checks that all components of the pathname are root-owned directories 403which are not writable by any other user or group. 404After the chroot, 405.Xr sshd 8 406changes the working directory to the user's home directory. 407Arguments to 408.Cm ChrootDirectory 409accept the tokens described in the 410.Sx TOKENS 411section. 412.Pp 413The 414.Cm ChrootDirectory 415must contain the necessary files and directories to support the 416user's session. 417For an interactive session this requires at least a shell, typically 418.Xr sh 1 , 419and basic 420.Pa /dev 421nodes such as 422.Xr null 4 , 423.Xr zero 4 , 424.Xr stdin 4 , 425.Xr stdout 4 , 426.Xr stderr 4 , 427and 428.Xr tty 4 429devices. 430For file transfer sessions using SFTP 431no additional configuration of the environment is necessary if the in-process 432sftp-server is used, 433though sessions which use logging may require 434.Pa /dev/log 435inside the chroot directory on some operating systems (see 436.Xr sftp-server 8 437for details). 438.Pp 439For safety, it is very important that the directory hierarchy be 440prevented from modification by other processes on the system (especially 441those outside the jail). 442Misconfiguration can lead to unsafe environments which 443.Xr sshd 8 444cannot detect. 445.Pp 446The default is 447.Cm none , 448indicating not to 449.Xr chroot 2 . 450.It Cm Ciphers 451Specifies the ciphers allowed. 452Multiple ciphers must be comma-separated. 453If the specified list begins with a 454.Sq + 455character, then the specified ciphers will be appended to the default set 456instead of replacing them. 457If the specified list begins with a 458.Sq - 459character, then the specified ciphers (including wildcards) will be removed 460from the default set instead of replacing them. 461If the specified list begins with a 462.Sq ^ 463character, then the specified ciphers will be placed at the head of the 464default set. 465.Pp 466The supported ciphers are: 467.Pp 468.Bl -item -compact -offset indent 469.It 4703des-cbc 471.It 472aes128-cbc 473.It 474aes192-cbc 475.It 476aes256-cbc 477.It 478aes128-ctr 479.It 480aes192-ctr 481.It 482aes256-ctr 483.It 484aes128-gcm@openssh.com 485.It 486aes256-gcm@openssh.com 487.It 488chacha20-poly1305@openssh.com 489.El 490.Pp 491The default is: 492.Bd -literal -offset indent 493chacha20-poly1305@openssh.com, 494aes128-ctr,aes192-ctr,aes256-ctr, 495aes128-gcm@openssh.com,aes256-gcm@openssh.com 496.Ed 497.Pp 498The list of available ciphers may also be obtained using 499.Qq ssh -Q cipher . 500.It Cm ClientAliveCountMax 501Sets the number of client alive messages which may be sent without 502.Xr sshd 8 503receiving any messages back from the client. 504If this threshold is reached while client alive messages are being sent, 505sshd will disconnect the client, terminating the session. 506It is important to note that the use of client alive messages is very 507different from 508.Cm TCPKeepAlive . 509The client alive messages are sent through the encrypted channel 510and therefore will not be spoofable. 511The TCP keepalive option enabled by 512.Cm TCPKeepAlive 513is spoofable. 514The client alive mechanism is valuable when the client or 515server depend on knowing when a connection has become unresponsive. 516.Pp 517The default value is 3. 518If 519.Cm ClientAliveInterval 520is set to 15, and 521.Cm ClientAliveCountMax 522is left at the default, unresponsive SSH clients 523will be disconnected after approximately 45 seconds. 524Setting a zero 525.Cm ClientAliveCountMax 526disables connection termination. 527.It Cm ClientAliveInterval 528Sets a timeout interval in seconds after which if no data has been received 529from the client, 530.Xr sshd 8 531will send a message through the encrypted 532channel to request a response from the client. 533The default 534is 0, indicating that these messages will not be sent to the client. 535.It Cm Compression 536Specifies whether compression is enabled after 537the user has authenticated successfully. 538The argument must be 539.Cm yes , 540.Cm delayed 541(a legacy synonym for 542.Cm yes ) 543or 544.Cm no . 545The default is 546.Cm yes . 547.It Cm DenyGroups 548This keyword can be followed by a list of group name patterns, separated 549by spaces. 550Login is disallowed for users whose primary group or supplementary 551group list matches one of the patterns. 552Only group names are valid; a numerical group ID is not recognized. 553By default, login is allowed for all groups. 554The allow/deny groups directives are processed in the following order: 555.Cm DenyGroups , 556.Cm AllowGroups . 557.Pp 558See PATTERNS in 559.Xr ssh_config 5 560for more information on patterns. 561.It Cm DenyUsers 562This keyword can be followed by a list of user name patterns, separated 563by spaces. 564Login is disallowed for user names that match one of the patterns. 565Only user names are valid; a numerical user ID is not recognized. 566By default, login is allowed for all users. 567If the pattern takes the form USER@HOST then USER and HOST 568are separately checked, restricting logins to particular 569users from particular hosts. 570HOST criteria may additionally contain addresses to match in CIDR 571address/masklen format. 572The allow/deny users directives are processed in the following order: 573.Cm DenyUsers , 574.Cm AllowUsers . 575.Pp 576See PATTERNS in 577.Xr ssh_config 5 578for more information on patterns. 579.It Cm DisableForwarding 580Disables all forwarding features, including X11, 581.Xr ssh-agent 1 , 582TCP and StreamLocal. 583This option overrides all other forwarding-related options and may 584simplify restricted configurations. 585.It Cm ExposeAuthInfo 586Writes a temporary file containing a list of authentication methods and 587public credentials (e.g. keys) used to authenticate the user. 588The location of the file is exposed to the user session through the 589.Ev SSH_USER_AUTH 590environment variable. 591The default is 592.Cm no . 593.It Cm FingerprintHash 594Specifies the hash algorithm used when logging key fingerprints. 595Valid options are: 596.Cm md5 597and 598.Cm sha256 . 599The default is 600.Cm sha256 . 601.It Cm ForceCommand 602Forces the execution of the command specified by 603.Cm ForceCommand , 604ignoring any command supplied by the client and 605.Pa ~/.ssh/rc 606if present. 607The command is invoked by using the user's login shell with the -c option. 608This applies to shell, command, or subsystem execution. 609It is most useful inside a 610.Cm Match 611block. 612The command originally supplied by the client is available in the 613.Ev SSH_ORIGINAL_COMMAND 614environment variable. 615Specifying a command of 616.Cm internal-sftp 617will force the use of an in-process SFTP server that requires no support 618files when used with 619.Cm ChrootDirectory . 620The default is 621.Cm none . 622.It Cm GatewayPorts 623Specifies whether remote hosts are allowed to connect to ports 624forwarded for the client. 625By default, 626.Xr sshd 8 627binds remote port forwardings to the loopback address. 628This prevents other remote hosts from connecting to forwarded ports. 629.Cm GatewayPorts 630can be used to specify that sshd 631should allow remote port forwardings to bind to non-loopback addresses, thus 632allowing other hosts to connect. 633The argument may be 634.Cm no 635to force remote port forwardings to be available to the local host only, 636.Cm yes 637to force remote port forwardings to bind to the wildcard address, or 638.Cm clientspecified 639to allow the client to select the address to which the forwarding is bound. 640The default is 641.Cm no . 642.It Cm GSSAPIAuthentication 643Specifies whether user authentication based on GSSAPI is allowed. 644The default is 645.Cm no . 646.It Cm GSSAPICleanupCredentials 647Specifies whether to automatically destroy the user's credentials cache 648on logout. 649The default is 650.Cm yes . 651.It Cm GSSAPIStrictAcceptorCheck 652Determines whether to be strict about the identity of the GSSAPI acceptor 653a client authenticates against. 654If set to 655.Cm yes 656then the client must authenticate against the host 657service on the current hostname. 658If set to 659.Cm no 660then the client may authenticate against any service key stored in the 661machine's default store. 662This facility is provided to assist with operation on multi homed machines. 663The default is 664.Cm yes . 665.It Cm HostbasedAcceptedKeyTypes 666Specifies the key types that will be accepted for hostbased authentication 667as a list of comma-separated patterns. 668Alternately if the specified list begins with a 669.Sq + 670character, then the specified key types will be appended to the default set 671instead of replacing them. 672If the specified list begins with a 673.Sq - 674character, then the specified key types (including wildcards) will be removed 675from the default set instead of replacing them. 676If the specified list begins with a 677.Sq ^ 678character, then the specified key types will be placed at the head of the 679default set. 680The default for this option is: 681.Bd -literal -offset 3n 682ecdsa-sha2-nistp256-cert-v01@openssh.com, 683ecdsa-sha2-nistp384-cert-v01@openssh.com, 684ecdsa-sha2-nistp521-cert-v01@openssh.com, 685sk-ecdsa-sha2-nistp256-cert-v01@openssh.com, 686ssh-ed25519-cert-v01@openssh.com, 687sk-ssh-ed25519-cert-v01@openssh.com, 688rsa-sha2-512-cert-v01@openssh.com, 689rsa-sha2-256-cert-v01@openssh.com, 690ssh-rsa-cert-v01@openssh.com, 691ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, 692sk-ecdsa-sha2-nistp256@openssh.com, 693ssh-ed25519,sk-ssh-ed25519@openssh.com, 694rsa-sha2-512,rsa-sha2-256,ssh-rsa 695.Ed 696.Pp 697The list of available key types may also be obtained using 698.Qq ssh -Q 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 algorithms 762that the server offers. 763The default for this option is: 764.Bd -literal -offset 3n 765ecdsa-sha2-nistp256-cert-v01@openssh.com, 766ecdsa-sha2-nistp384-cert-v01@openssh.com, 767ecdsa-sha2-nistp521-cert-v01@openssh.com, 768sk-ecdsa-sha2-nistp256-cert-v01@openssh.com, 769ssh-ed25519-cert-v01@openssh.com, 770sk-ssh-ed25519-cert-v01@openssh.com, 771rsa-sha2-512-cert-v01@openssh.com, 772rsa-sha2-256-cert-v01@openssh.com, 773ssh-rsa-cert-v01@openssh.com, 774ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, 775sk-ecdsa-sha2-nistp256@openssh.com, 776ssh-ed25519,sk-ssh-ed25519@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. 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 but the default 1024.Pa /etc/ssh/sshd_config 1025overwrites it to 600 seconds. 1026.It Cm LogLevel 1027Gives the verbosity level that is used when logging messages from 1028.Xr sshd 8 . 1029The possible values are: 1030QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3. 1031The default is INFO. 1032DEBUG and DEBUG1 are equivalent. 1033DEBUG2 and DEBUG3 each specify higher levels of debugging output. 1034Logging with a DEBUG level violates the privacy of users and is not recommended. 1035.It Cm MACs 1036Specifies the available MAC (message authentication code) algorithms. 1037The MAC algorithm is used for data integrity protection. 1038Multiple algorithms must be comma-separated. 1039If the specified list begins with a 1040.Sq + 1041character, then the specified algorithms will be appended to the default set 1042instead of replacing them. 1043If the specified list begins with a 1044.Sq - 1045character, then the specified algorithms (including wildcards) will be removed 1046from the default set instead of replacing them. 1047If the specified list begins with a 1048.Sq ^ 1049character, then the specified algorithms will be placed at the head of the 1050default set. 1051.Pp 1052The algorithms that contain 1053.Qq -etm 1054calculate the MAC after encryption (encrypt-then-mac). 1055These are considered safer and their use recommended. 1056The supported MACs are: 1057.Pp 1058.Bl -item -compact -offset indent 1059.It 1060hmac-md5 1061.It 1062hmac-md5-96 1063.It 1064hmac-sha1 1065.It 1066hmac-sha1-96 1067.It 1068hmac-sha2-256 1069.It 1070hmac-sha2-512 1071.It 1072umac-64@openssh.com 1073.It 1074umac-128@openssh.com 1075.It 1076hmac-md5-etm@openssh.com 1077.It 1078hmac-md5-96-etm@openssh.com 1079.It 1080hmac-sha1-etm@openssh.com 1081.It 1082hmac-sha1-96-etm@openssh.com 1083.It 1084hmac-sha2-256-etm@openssh.com 1085.It 1086hmac-sha2-512-etm@openssh.com 1087.It 1088umac-64-etm@openssh.com 1089.It 1090umac-128-etm@openssh.com 1091.El 1092.Pp 1093The default is: 1094.Bd -literal -offset indent 1095umac-64-etm@openssh.com,umac-128-etm@openssh.com, 1096hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com, 1097hmac-sha1-etm@openssh.com, 1098umac-64@openssh.com,umac-128@openssh.com, 1099hmac-sha2-256,hmac-sha2-512,hmac-sha1 1100.Ed 1101.Pp 1102The list of available MAC algorithms may also be obtained using 1103.Qq ssh -Q mac . 1104.It Cm Match 1105Introduces a conditional block. 1106If all of the criteria on the 1107.Cm Match 1108line are satisfied, the keywords on the following lines override those 1109set in the global section of the config file, until either another 1110.Cm Match 1111line or the end of the file. 1112If a keyword appears in multiple 1113.Cm Match 1114blocks that are satisfied, only the first instance of the keyword is 1115applied. 1116.Pp 1117The arguments to 1118.Cm Match 1119are one or more criteria-pattern pairs or the single token 1120.Cm All 1121which matches all criteria. 1122The available criteria are 1123.Cm User , 1124.Cm Group , 1125.Cm Host , 1126.Cm LocalAddress , 1127.Cm LocalPort , 1128.Cm RDomain , 1129and 1130.Cm Address 1131(with 1132.Cm RDomain 1133representing the 1134.Xr rdomain 4 1135on which the connection was received). 1136.Pp 1137The match patterns may consist of single entries or comma-separated 1138lists and may use the wildcard and negation operators described in the 1139.Sx PATTERNS 1140section of 1141.Xr ssh_config 5 . 1142.Pp 1143The patterns in an 1144.Cm Address 1145criteria may additionally contain addresses to match in CIDR 1146address/masklen format, 1147such as 192.0.2.0/24 or 2001:db8::/32. 1148Note that the mask length provided must be consistent with the address - 1149it is an error to specify a mask length that is too long for the address 1150or one with bits set in this host portion of the address. 1151For example, 192.0.2.0/33 and 192.0.2.0/8, respectively. 1152.Pp 1153Only a subset of keywords may be used on the lines following a 1154.Cm Match 1155keyword. 1156Available keywords are 1157.Cm AcceptEnv , 1158.Cm AllowAgentForwarding , 1159.Cm AllowGroups , 1160.Cm AllowStreamLocalForwarding , 1161.Cm AllowTcpForwarding , 1162.Cm AllowUsers , 1163.Cm AuthenticationMethods , 1164.Cm AuthorizedKeysCommand , 1165.Cm AuthorizedKeysCommandUser , 1166.Cm AuthorizedKeysFile , 1167.Cm AuthorizedPrincipalsCommand , 1168.Cm AuthorizedPrincipalsCommandUser , 1169.Cm AuthorizedPrincipalsFile , 1170.Cm Banner , 1171.Cm ChrootDirectory , 1172.Cm ClientAliveCountMax , 1173.Cm ClientAliveInterval , 1174.Cm DenyGroups , 1175.Cm DenyUsers , 1176.Cm ForceCommand , 1177.Cm GatewayPorts , 1178.Cm GSSAPIAuthentication , 1179.Cm HostbasedAcceptedKeyTypes , 1180.Cm HostbasedAuthentication , 1181.Cm HostbasedUsesNameFromPacketOnly , 1182.Cm IgnoreRhosts , 1183.Cm Include , 1184.Cm IPQoS , 1185.Cm KbdInteractiveAuthentication , 1186.Cm KerberosAuthentication , 1187.Cm LogLevel , 1188.Cm MaxAuthTries , 1189.Cm MaxSessions , 1190.Cm PasswordAuthentication , 1191.Cm PermitEmptyPasswords , 1192.Cm PermitListen , 1193.Cm PermitOpen , 1194.Cm PermitRootLogin , 1195.Cm PermitTTY , 1196.Cm PermitTunnel , 1197.Cm PermitUserRC , 1198.Cm PubkeyAcceptedKeyTypes , 1199.Cm PubkeyAuthentication , 1200.Cm RekeyLimit , 1201.Cm RevokedKeys , 1202.Cm RDomain , 1203.Cm SetEnv , 1204.Cm StreamLocalBindMask , 1205.Cm StreamLocalBindUnlink , 1206.Cm TrustedUserCAKeys , 1207.Cm X11DisplayOffset , 1208.Cm X11Forwarding 1209and 1210.Cm X11UseLocalhost . 1211.It Cm MaxAuthTries 1212Specifies the maximum number of authentication attempts permitted per 1213connection. 1214Once the number of failures reaches half this value, 1215additional failures are logged. 1216The default is 6. 1217.It Cm MaxSessions 1218Specifies the maximum number of open shell, login or subsystem (e.g. sftp) 1219sessions permitted per network connection. 1220Multiple sessions may be established by clients that support connection 1221multiplexing. 1222Setting 1223.Cm MaxSessions 1224to 1 will effectively disable session multiplexing, whereas setting it to 0 1225will prevent all shell, login and subsystem sessions while still permitting 1226forwarding. 1227The default is 10. 1228.It Cm MaxStartups 1229Specifies the maximum number of concurrent unauthenticated connections to the 1230SSH daemon. 1231Additional connections will be dropped until authentication succeeds or the 1232.Cm LoginGraceTime 1233expires for a connection. 1234The default is 10:30:100. 1235.Pp 1236Alternatively, random early drop can be enabled by specifying 1237the three colon separated values 1238start:rate:full (e.g. "10:30:60"). 1239.Xr sshd 8 1240will refuse connection attempts with a probability of rate/100 (30%) 1241if there are currently start (10) unauthenticated connections. 1242The probability increases linearly and all connection attempts 1243are refused if the number of unauthenticated connections reaches full (60). 1244.It Cm PasswordAuthentication 1245Specifies whether password authentication is allowed. 1246The default is 1247.Cm yes . 1248.It Cm PermitEmptyPasswords 1249When password authentication is allowed, it specifies whether the 1250server allows login to accounts with empty password strings. 1251The default is 1252.Cm no . 1253.It Cm PermitListen 1254Specifies the addresses/ports on which a remote TCP port forwarding may listen. 1255The listen specification must be one of the following forms: 1256.Pp 1257.Bl -item -offset indent -compact 1258.It 1259.Cm PermitListen 1260.Sm off 1261.Ar port 1262.Sm on 1263.It 1264.Cm PermitListen 1265.Sm off 1266.Ar host : port 1267.Sm on 1268.El 1269.Pp 1270Multiple permissions may be specified by separating them with whitespace. 1271An argument of 1272.Cm any 1273can be used to remove all restrictions and permit any listen requests. 1274An argument of 1275.Cm none 1276can be used to prohibit all listen requests. 1277The host name may contain wildcards as described in the PATTERNS section in 1278.Xr ssh_config 5 . 1279The wildcard 1280.Sq * 1281can also be used in place of a port number to allow all ports. 1282By default all port forwarding listen requests are permitted. 1283Note that the 1284.Cm GatewayPorts 1285option may further restrict which addresses may be listened on. 1286Note also that 1287.Xr ssh 1 1288will request a listen host of 1289.Dq localhost 1290if no listen host was specifically requested, and this name is 1291treated differently to explicit localhost addresses of 1292.Dq 127.0.0.1 1293and 1294.Dq ::1 . 1295.It Cm PermitOpen 1296Specifies the destinations to which TCP port forwarding is permitted. 1297The forwarding specification must be one of the following forms: 1298.Pp 1299.Bl -item -offset indent -compact 1300.It 1301.Cm PermitOpen 1302.Sm off 1303.Ar host : port 1304.Sm on 1305.It 1306.Cm PermitOpen 1307.Sm off 1308.Ar IPv4_addr : port 1309.Sm on 1310.It 1311.Cm PermitOpen 1312.Sm off 1313.Ar \&[ IPv6_addr \&] : port 1314.Sm on 1315.El 1316.Pp 1317Multiple forwards may be specified by separating them with whitespace. 1318An argument of 1319.Cm any 1320can be used to remove all restrictions and permit any forwarding requests. 1321An argument of 1322.Cm none 1323can be used to prohibit all forwarding requests. 1324The wildcard 1325.Sq * 1326can be used for host or port to allow all hosts or ports respectively. 1327Otherwise, no pattern matching or address lookups are performed on supplied 1328names. 1329By default all port forwarding requests are permitted. 1330.It Cm PermitRootLogin 1331Specifies whether root can log in using 1332.Xr ssh 1 . 1333The argument must be 1334.Cm yes , 1335.Cm prohibit-password , 1336.Cm forced-commands-only , 1337or 1338.Cm no . 1339The default is 1340.Cm prohibit-password . 1341.Pp 1342If this option is set to 1343.Cm prohibit-password 1344(or its deprecated alias, 1345.Cm without-password ) , 1346password and keyboard-interactive authentication are disabled for root. 1347.Pp 1348If this option is set to 1349.Cm forced-commands-only , 1350root login with public key authentication will be allowed, 1351but only if the 1352.Ar command 1353option has been specified 1354(which may be useful for taking remote backups even if root login is 1355normally not allowed). 1356All other authentication methods are disabled for root. 1357.Pp 1358If this option is set to 1359.Cm no , 1360root is not allowed to log in. 1361.It Cm PermitTTY 1362Specifies whether 1363.Xr pty 4 1364allocation is permitted. 1365The default is 1366.Cm yes . 1367.It Cm PermitTunnel 1368Specifies whether 1369.Xr tun 4 1370device forwarding is allowed. 1371The argument must be 1372.Cm yes , 1373.Cm point-to-point 1374(layer 3), 1375.Cm ethernet 1376(layer 2), or 1377.Cm no . 1378Specifying 1379.Cm yes 1380permits both 1381.Cm point-to-point 1382and 1383.Cm ethernet . 1384The default is 1385.Cm no . 1386.Pp 1387Independent of this setting, the permissions of the selected 1388.Xr tun 4 1389device must allow access to the user. 1390.It Cm PermitUserEnvironment 1391Specifies whether 1392.Pa ~/.ssh/environment 1393and 1394.Cm environment= 1395options in 1396.Pa ~/.ssh/authorized_keys 1397are processed by 1398.Xr sshd 8 . 1399Valid options are 1400.Cm yes , 1401.Cm no 1402or a pattern-list specifying which environment variable names to accept 1403(for example 1404.Qq LANG,LC_* ) . 1405The default is 1406.Cm no . 1407Enabling environment processing may enable users to bypass access 1408restrictions in some configurations using mechanisms such as 1409.Ev LD_PRELOAD . 1410.It Cm PermitUserRC 1411Specifies whether any 1412.Pa ~/.ssh/rc 1413file is executed. 1414The default is 1415.Cm yes . 1416.It Cm PidFile 1417Specifies the file that contains the process ID of the 1418SSH daemon, or 1419.Cm none 1420to not write one. 1421The default is 1422.Pa /var/run/sshd.pid . 1423.It Cm Port 1424Specifies the port number that 1425.Xr sshd 8 1426listens on. 1427The default is 22. 1428Multiple options of this type are permitted. 1429See also 1430.Cm ListenAddress . 1431.It Cm PrintLastLog 1432Specifies whether 1433.Xr sshd 8 1434should print the date and time of the last user login when a user logs 1435in interactively. 1436The default is 1437.Cm yes . 1438.It Cm PrintMotd 1439Specifies whether 1440.Xr sshd 8 1441should print 1442.Pa /etc/motd 1443when a user logs in interactively. 1444(On some systems it is also printed by the shell, 1445.Pa /etc/profile , 1446or equivalent.) 1447The default is 1448.Cm yes . 1449.It Cm PubkeyAcceptedKeyTypes 1450Specifies the key types that will be accepted for public key authentication 1451as a list of comma-separated patterns. 1452Alternately if the specified list begins with a 1453.Sq + 1454character, then the specified key types will be appended to the default set 1455instead of replacing them. 1456If the specified list begins with a 1457.Sq - 1458character, then the specified key types (including wildcards) will be removed 1459from the default set instead of replacing them. 1460If the specified list begins with a 1461.Sq ^ 1462character, then the specified key types will be placed at the head of the 1463default set. 1464The default for this option is: 1465.Bd -literal -offset 3n 1466ecdsa-sha2-nistp256-cert-v01@openssh.com, 1467ecdsa-sha2-nistp384-cert-v01@openssh.com, 1468ecdsa-sha2-nistp521-cert-v01@openssh.com, 1469sk-ecdsa-sha2-nistp256-cert-v01@openssh.com, 1470ssh-ed25519-cert-v01@openssh.com, 1471sk-ssh-ed25519-cert-v01@openssh.com, 1472rsa-sha2-512-cert-v01@openssh.com, 1473rsa-sha2-256-cert-v01@openssh.com, 1474ssh-rsa-cert-v01@openssh.com, 1475ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521, 1476sk-ecdsa-sha2-nistp256@openssh.com, 1477ssh-ed25519,sk-ssh-ed25519@openssh.com, 1478rsa-sha2-512,rsa-sha2-256,ssh-rsa 1479.Ed 1480.Pp 1481The list of available key types may also be obtained using 1482.Qq ssh -Q PubkeyAcceptedKeyTypes . 1483.It Cm PubkeyAuthOptions 1484Sets one or more public key authentication options. 1485Two option keywords are currently supported: 1486.Cm none 1487(the default; indicating no additional options are enabled) 1488and 1489.Cm touch-required . 1490.Pp 1491The 1492.Cm touch-required 1493option causes public key authentication using a FIDO authenticator algorithm 1494(i.e.\& 1495.Cm ecdsa-sk 1496or 1497.Cm ed25519-sk ) 1498to always require the signature to attest that a physically present user 1499explicitly confirmed the authentication (usually by touching the authenticator). 1500By default, 1501.Xr sshd 8 1502requires user presence unless overridden with an authorized_keys option. 1503The 1504.Cm touch-required 1505flag disables this override. 1506This option has no effect for other, non-authenticator public key types. 1507.It Cm PubkeyAuthentication 1508Specifies whether public key authentication is allowed. 1509The default is 1510.Cm yes . 1511.It Cm RekeyLimit 1512Specifies the maximum amount of data that may be transmitted before the 1513session key is renegotiated, optionally followed a maximum amount of 1514time that may pass before the session key is renegotiated. 1515The first argument is specified in bytes and may have a suffix of 1516.Sq K , 1517.Sq M , 1518or 1519.Sq G 1520to indicate Kilobytes, Megabytes, or Gigabytes, respectively. 1521The default is between 1522.Sq 1G 1523and 1524.Sq 4G , 1525depending on the cipher. 1526The optional second value is specified in seconds and may use any of the 1527units documented in the 1528.Sx TIME FORMATS 1529section. 1530The default value for 1531.Cm RekeyLimit 1532is 1533.Cm default none , 1534which means that rekeying is performed after the cipher's default amount 1535of data has been sent or received and no time based rekeying is done. 1536.It Cm RevokedKeys 1537Specifies revoked public keys file, or 1538.Cm none 1539to not use one. 1540Keys listed in this file will be refused for public key authentication. 1541Note that if this file is not readable, then public key authentication will 1542be refused for all users. 1543Keys may be specified as a text file, listing one public key per line, or as 1544an OpenSSH Key Revocation List (KRL) as generated by 1545.Xr ssh-keygen 1 . 1546For more information on KRLs, see the KEY REVOCATION LISTS section in 1547.Xr ssh-keygen 1 . 1548.It Cm RDomain 1549Specifies an explicit routing domain that is applied after authentication 1550has completed. 1551The user session, as well and any forwarded or listening IP sockets, 1552will be bound to this 1553.Xr rdomain 4 . 1554If the routing domain is set to 1555.Cm \&%D , 1556then the domain in which the incoming connection was received will be applied. 1557.It Cm SecurityKeyProvider 1558Specifies a path to a library that will be used when loading 1559FIDO authenticator-hosted keys, overriding the default of using 1560the built-in USB HID support. 1561.It Cm SetEnv 1562Specifies one or more environment variables to set in child sessions started 1563by 1564.Xr sshd 8 1565as 1566.Dq NAME=VALUE . 1567The environment value may be quoted (e.g. if it contains whitespace 1568characters). 1569Environment variables set by 1570.Cm SetEnv 1571override the default environment and any variables specified by the user 1572via 1573.Cm AcceptEnv 1574or 1575.Cm PermitUserEnvironment . 1576.It Cm StreamLocalBindMask 1577Sets the octal file creation mode mask 1578.Pq umask 1579used when creating a Unix-domain socket file for local or remote 1580port forwarding. 1581This option is only used for port forwarding to a Unix-domain socket file. 1582.Pp 1583The default value is 0177, which creates a Unix-domain socket file that is 1584readable and writable only by the owner. 1585Note that not all operating systems honor the file mode on Unix-domain 1586socket files. 1587.It Cm StreamLocalBindUnlink 1588Specifies whether to remove an existing Unix-domain socket file for local 1589or remote port forwarding before creating a new one. 1590If the socket file already exists and 1591.Cm StreamLocalBindUnlink 1592is not enabled, 1593.Nm sshd 1594will be unable to forward the port to the Unix-domain socket file. 1595This option is only used for port forwarding to a Unix-domain socket file. 1596.Pp 1597The argument must be 1598.Cm yes 1599or 1600.Cm no . 1601The default is 1602.Cm no . 1603.It Cm StrictModes 1604Specifies whether 1605.Xr sshd 8 1606should check file modes and ownership of the 1607user's files and home directory before accepting login. 1608This is normally desirable because novices sometimes accidentally leave their 1609directory or files world-writable. 1610The default is 1611.Cm yes . 1612Note that this does not apply to 1613.Cm ChrootDirectory , 1614whose permissions and ownership are checked unconditionally. 1615.It Cm Subsystem 1616Configures an external subsystem (e.g. file transfer daemon). 1617Arguments should be a subsystem name and a command (with optional arguments) 1618to execute upon subsystem request. 1619.Pp 1620The command 1621.Cm sftp-server 1622implements the SFTP file transfer subsystem. 1623.Pp 1624Alternately the name 1625.Cm internal-sftp 1626implements an in-process SFTP server. 1627This may simplify configurations using 1628.Cm ChrootDirectory 1629to force a different filesystem root on clients. 1630.Pp 1631By default no subsystems are defined. 1632.It Cm SyslogFacility 1633Gives the facility code that is used when logging messages from 1634.Xr sshd 8 . 1635The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2, 1636LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7. 1637The default is AUTH. 1638.It Cm TCPKeepAlive 1639Specifies whether the system should send TCP keepalive messages to the 1640other side. 1641If they are sent, death of the connection or crash of one 1642of the machines will be properly noticed. 1643However, this means that 1644connections will die if the route is down temporarily, and some people 1645find it annoying. 1646On the other hand, if TCP keepalives are not sent, 1647sessions may hang indefinitely on the server, leaving 1648.Qq ghost 1649users and consuming server resources. 1650.Pp 1651The default is 1652.Cm yes 1653(to send TCP keepalive messages), and the server will notice 1654if the network goes down or the client host crashes. 1655This avoids infinitely hanging sessions. 1656.Pp 1657To disable TCP keepalive messages, the value should be set to 1658.Cm no . 1659.It Cm TrustedUserCAKeys 1660Specifies a file containing public keys of certificate authorities that are 1661trusted to sign user certificates for authentication, or 1662.Cm none 1663to not use one. 1664Keys are listed one per line; empty lines and comments starting with 1665.Ql # 1666are allowed. 1667If a certificate is presented for authentication and has its signing CA key 1668listed in this file, then it may be used for authentication for any user 1669listed in the certificate's principals list. 1670Note that certificates that lack a list of principals will not be permitted 1671for authentication using 1672.Cm TrustedUserCAKeys . 1673For more details on certificates, see the CERTIFICATES section in 1674.Xr ssh-keygen 1 . 1675.It Cm UseDNS 1676Specifies whether 1677.Xr sshd 8 1678should look up the remote host name, and to check that 1679the resolved host name for the remote IP address maps back to the 1680very same IP address. 1681.Pp 1682If this option is set to 1683.Cm no 1684(the default) then only addresses and not host names may be used in 1685.Pa ~/.ssh/authorized_keys 1686.Cm from 1687and 1688.Nm 1689.Cm Match 1690.Cm Host 1691directives. 1692.It Cm VersionAddendum 1693Optionally specifies additional text to append to the SSH protocol banner 1694sent by the server upon connection. 1695The default is 1696.Cm none . 1697.It Cm X11DisplayOffset 1698Specifies the first display number available for 1699.Xr sshd 8 Ns 's 1700X11 forwarding. 1701This prevents sshd from interfering with real X11 servers. 1702The default is 10. 1703.It Cm X11Forwarding 1704Specifies whether X11 forwarding is permitted. 1705The argument must be 1706.Cm yes 1707or 1708.Cm no . 1709The default is 1710.Cm no . 1711.Pp 1712When X11 forwarding is enabled, there may be additional exposure to 1713the server and to client displays if the 1714.Xr sshd 8 1715proxy display is configured to listen on the wildcard address (see 1716.Cm X11UseLocalhost ) , 1717though this is not the default. 1718Additionally, the authentication spoofing and authentication data 1719verification and substitution occur on the client side. 1720The security risk of using X11 forwarding is that the client's X11 1721display server may be exposed to attack when the SSH client requests 1722forwarding (see the warnings for 1723.Cm ForwardX11 1724in 1725.Xr ssh_config 5 ) . 1726A system administrator may have a stance in which they want to 1727protect clients that may expose themselves to attack by unwittingly 1728requesting X11 forwarding, which can warrant a 1729.Cm no 1730setting. 1731.Pp 1732Note that disabling X11 forwarding does not prevent users from 1733forwarding X11 traffic, as users can always install their own forwarders. 1734.It Cm X11UseLocalhost 1735Specifies whether 1736.Xr sshd 8 1737should bind the X11 forwarding server to the loopback address or to 1738the wildcard address. 1739By default, 1740sshd binds the forwarding server to the loopback address and sets the 1741hostname part of the 1742.Ev DISPLAY 1743environment variable to 1744.Cm localhost . 1745This prevents remote hosts from connecting to the proxy display. 1746However, some older X11 clients may not function with this 1747configuration. 1748.Cm X11UseLocalhost 1749may be set to 1750.Cm no 1751to specify that the forwarding server should be bound to the wildcard 1752address. 1753The argument must be 1754.Cm yes 1755or 1756.Cm no . 1757The default is 1758.Cm yes . 1759.It Cm XAuthLocation 1760Specifies the full pathname of the 1761.Xr xauth 1 1762program, or 1763.Cm none 1764to not use one. 1765The default is 1766.Pa /usr/X11R6/bin/xauth . 1767.It Cm UseLPK 1768Specifies whether LDAP public key retrieval must be used or not. It allow 1769an easy centralisation of public keys within an LDAP directory. The argument must be 1770.Dq yes 1771or 1772.Dq no . 1773.It Cm LpkLdapConf 1774Specifies whether LDAP Public keys should parse the specified ldap.conf file 1775instead of sshd_config Tokens. The argument must be a valid path to an ldap.conf 1776file like 1777.Pa /etc/ldap.conf 1778.It Cm LpkServers 1779Specifies LDAP one or more [:space:] separated server's url the following form may be used: 1780.Pp 1781LpkServers ldaps://127.0.0.1 ldap://127.0.0.2 ldap://127.0.0.3 1782.It Cm LpkUserDN 1783Specifies the LDAP user DN. 1784.Pp 1785LpkUserDN ou=users,dc=phear,dc=org 1786.It Cm LpkGroupDN 1787Specifies the LDAP groups DN. 1788.Pp 1789LpkGroupDN ou=groups,dc=phear,dc=org 1790.It Cm LpkBindDN 1791Specifies the LDAP bind DN to use if necessary. 1792.Pp 1793LpkBindDN cn=Manager,dc=phear,dc=org 1794.It Cm LpkBindPw 1795Specifies the LDAP bind credential. 1796.Pp 1797LpkBindPw secret 1798.It Cm LpkServerGroup 1799Specifies one or more [:space:] separated group the server is part of. 1800.Pp 1801LpkServerGroup unix mail prod 1802.It Cm LpkFilter 1803Specifies an additional LDAP filter to use for finding SSH keys 1804.Pp 1805LpkFilter (hostAccess=master.phear.org) 1806.It Cm LpkForceTLS 1807Specifies if the LDAP server connection must be tried, forced or not used. The argument must be 1808.Dq yes 1809or 1810.Dq no 1811or 1812.Dq try . 1813.It Cm LpkSearchTimelimit 1814Specifies the search time limit before the search is considered over. value is 1815in seconds. 1816.Pp 1817LpkSearchTimelimit 3 1818.It Cm LpkBindTimelimit 1819Specifies the bind time limit before the connection is considered dead. value is 1820in seconds. 1821.Pp 1822LpkBindTimelimit 3 1823.El 1824.Sh TIME FORMATS 1825.Xr sshd 8 1826command-line arguments and configuration file options that specify time 1827may be expressed using a sequence of the form: 1828.Sm off 1829.Ar time Op Ar qualifier , 1830.Sm on 1831where 1832.Ar time 1833is a positive integer value and 1834.Ar qualifier 1835is one of the following: 1836.Pp 1837.Bl -tag -width Ds -compact -offset indent 1838.It Aq Cm none 1839seconds 1840.It Cm s | Cm S 1841seconds 1842.It Cm m | Cm M 1843minutes 1844.It Cm h | Cm H 1845hours 1846.It Cm d | Cm D 1847days 1848.It Cm w | Cm W 1849weeks 1850.El 1851.Pp 1852Each member of the sequence is added together to calculate 1853the total time value. 1854.Pp 1855Time format examples: 1856.Pp 1857.Bl -tag -width Ds -compact -offset indent 1858.It 600 1859600 seconds (10 minutes) 1860.It 10m 186110 minutes 1862.It 1h30m 18631 hour 30 minutes (90 minutes) 1864.El 1865.Sh TOKENS 1866Arguments to some keywords can make use of tokens, 1867which are expanded at runtime: 1868.Pp 1869.Bl -tag -width XXXX -offset indent -compact 1870.It %% 1871A literal 1872.Sq % . 1873.It \&%D 1874The routing domain in which the incoming connection was received. 1875.It %F 1876The fingerprint of the CA key. 1877.It %f 1878The fingerprint of the key or certificate. 1879.It %h 1880The home directory of the user. 1881.It %i 1882The key ID in the certificate. 1883.It %K 1884The base64-encoded CA key. 1885.It %k 1886The base64-encoded key or certificate for authentication. 1887.It %s 1888The serial number of the certificate. 1889.It \&%T 1890The type of the CA key. 1891.It %t 1892The key or certificate type. 1893.It \&%U 1894The numeric user ID of the target user. 1895.It %u 1896The username. 1897.El 1898.Pp 1899.Cm AuthorizedKeysCommand 1900accepts the tokens %%, %f, %h, %k, %t, %U, and %u. 1901.Pp 1902.Cm AuthorizedKeysFile 1903accepts the tokens %%, %h, %U, and %u. 1904.Pp 1905.Cm AuthorizedPrincipalsCommand 1906accepts the tokens %%, %F, %f, %h, %i, %K, %k, %s, %T, %t, %U, and %u. 1907.Pp 1908.Cm AuthorizedPrincipalsFile 1909accepts the tokens %%, %h, %U, and %u. 1910.Pp 1911.Cm ChrootDirectory 1912accepts the tokens %%, %h, %U, and %u. 1913.Pp 1914.Cm RoutingDomain 1915accepts the token %D. 1916.Sh FILES 1917.Bl -tag -width Ds 1918.It Pa /etc/ssh/sshd_config 1919Contains configuration data for 1920.Xr sshd 8 . 1921This file should be writable by root only, but it is recommended 1922(though not necessary) that it be world-readable. 1923.El 1924.Sh SEE ALSO 1925.Xr sftp-server 8 , 1926.Xr sshd 8 1927.Sh AUTHORS 1928.An -nosplit 1929OpenSSH is a derivative of the original and free 1930ssh 1.2.12 release by 1931.An Tatu Ylonen . 1932.An Aaron Campbell , Bob Beck , Markus Friedl , Niels Provos , 1933.An Theo de Raadt 1934and 1935.An Dug Song 1936removed many bugs, re-added newer features and 1937created OpenSSH. 1938.An Markus Friedl 1939contributed the support for SSH protocol versions 1.5 and 2.0. 1940.An Niels Provos 1941and 1942.An Markus Friedl 1943contributed support for privilege separation. 1944