2 .\" Author: Tatu Ylonen <ylo@cs.hut.fi>
3 .\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4 .\" All rights reserved
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".
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.
16 .\" Redistribution and use in source and binary forms, with or without
17 .\" modification, are permitted provided that the following conditions
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.
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.
36 .\" $OpenBSD: sshd_config.5,v 1.263 2018/02/16 02:40:45 djm Exp $
38 .Dd $Mdocdate: February 16 2018 $
43 .Nd OpenSSH SSH daemon configuration file
46 reads configuration data from
47 .Pa /etc/ssh/sshd_config
48 (or the file specified with
51 The file contains keyword-argument pairs, one per line.
52 For each keyword, the first obtained value will be used.
55 and empty lines are interpreted as comments.
56 Arguments may optionally be enclosed in double quotes
58 in order to represent arguments containing spaces.
61 keywords and their meanings are as follows (note that
62 keywords are case-insensitive and arguments are case-sensitive):
65 Specifies what environment variables sent by the client will be copied into
72 for how to configure the client.
75 environment variable is always sent whenever the client
76 requests a pseudo-terminal as it is required by the protocol.
77 Variables are specified by name, which may contain the wildcard characters
81 Multiple environment variables may be separated by whitespace or spread
85 Be warned that some environment variables could be used to bypass restricted
87 For this reason, care should be taken in the use of this directive.
88 The default is not to accept any environment variables.
90 Specifies which address family should be used by
99 .It Cm AllowAgentForwarding
102 forwarding is permitted.
105 Note that disabling agent forwarding does not improve security
106 unless users are also denied shell access, as they can always install
107 their own forwarders.
109 This keyword can be followed by a list of group name patterns, separated
111 If specified, login is allowed only for users whose primary
112 group or supplementary group list matches one of the patterns.
113 Only group names are valid; a numerical group ID is not recognized.
114 By default, login is allowed for all groups.
115 The allow/deny directives are processed in the following order:
124 for more information on patterns.
125 .It Cm AllowStreamLocalForwarding
126 Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
127 The available options are
132 to allow StreamLocal forwarding,
134 to prevent all StreamLocal forwarding,
136 to allow local (from the perspective of
140 to allow remote forwarding only.
141 Note that disabling StreamLocal forwarding does not improve security unless
142 users are also denied shell access, as they can always install their
144 .It Cm AllowTcpForwarding
145 Specifies whether TCP forwarding is permitted.
146 The available options are
151 to allow TCP forwarding,
153 to prevent all TCP forwarding,
155 to allow local (from the perspective of
159 to allow remote forwarding only.
160 Note that disabling TCP forwarding does not improve security unless
161 users are also denied shell access, as they can always install their
164 This keyword can be followed by a list of user name patterns, separated
166 If specified, login is allowed only for user names that
167 match one of the patterns.
168 Only user names are valid; a numerical user ID is not recognized.
169 By default, login is allowed for all users.
170 If the pattern takes the form USER@HOST then USER and HOST
171 are separately checked, restricting logins to particular
172 users from particular hosts.
173 HOST criteria may additionally contain addresses to match in CIDR
174 address/masklen format.
175 The allow/deny directives are processed in the following order:
184 for more information on patterns.
185 .It Cm AuthenticationMethods
186 Specifies the authentication methods that must be successfully completed
187 for a user to be granted access.
188 This option must be followed by one or more comma-separated lists of
189 authentication method names, or by the single string
191 to indicate the default behaviour of accepting any single authentication
193 If the default is overridden, then successful authentication requires
194 completion of every method in at least one of these lists.
197 .Qq publickey,password publickey,keyboard-interactive
198 would require the user to complete public key authentication, followed by
199 either password or keyboard interactive authentication.
200 Only methods that are next in one or more lists are offered at each stage,
201 so for this example it would not be possible to attempt password or
202 keyboard-interactive authentication before public key.
204 For keyboard interactive authentication it is also possible to
205 restrict authentication to a specific device by appending a
206 colon followed by the device identifier
211 depending on the server configuration.
213 .Qq keyboard-interactive:bsdauth
214 would restrict keyboard interactive authentication to the
218 If the publickey method is listed more than once,
220 verifies that keys that have been used successfully are not reused for
221 subsequent authentications.
223 .Qq publickey,publickey
224 requires successful authentication using two different public keys.
226 Note that each authentication method listed should also be explicitly enabled
227 in the configuration.
229 The available authentication methods are:
230 .Qq gssapi-with-mic ,
232 .Qq keyboard-interactive ,
234 (used for access to password-less accounts when
235 .Cm PermitEmptyPassword
240 .It Cm AuthorizedKeysCommand
241 Specifies a program to be used to look up the user's public keys.
242 The program must be owned by root, not writable by group or others and
243 specified by an absolute path.
245 .Cm AuthorizedKeysCommand
246 accept the tokens described in the
249 If no arguments are specified then the username of the target user is used.
251 The program should produce on standard output zero or
252 more lines of authorized_keys output (see
257 .Cm AuthorizedKeysCommand
258 does not successfully authenticate
259 and authorize the user then public key authentication continues using the usual
260 .Cm AuthorizedKeysFile
263 .Cm AuthorizedKeysCommand
265 .It Cm AuthorizedKeysCommandUser
266 Specifies the user under whose account the
267 .Cm AuthorizedKeysCommand
269 It is recommended to use a dedicated user that has no other role on the host
270 than running authorized keys commands.
272 .Cm AuthorizedKeysCommand
274 .Cm AuthorizedKeysCommandUser
277 will refuse to start.
278 .It Cm AuthorizedKeysFile
279 Specifies the file that contains the public keys used for user authentication.
280 The format is described in the
281 .Sx AUTHORIZED_KEYS FILE FORMAT
285 .Cm AuthorizedKeysFile
286 accept the tokens described in the
290 .Cm AuthorizedKeysFile
291 is taken to be an absolute path or one relative to the user's home
293 Multiple files may be listed, separated by whitespace.
294 Alternately this option may be set to
296 to skip checking for user keys in files.
298 .Qq .ssh/authorized_keys .ssh/authorized_keys2 .
299 .It Cm AuthorizedPrincipalsCommand
300 Specifies a program to be used to generate the list of allowed
301 certificate principals as per
302 .Cm AuthorizedPrincipalsFile .
303 The program must be owned by root, not writable by group or others and
304 specified by an absolute path.
306 .Cm AuthorizedPrincipalsCommand
307 accept the tokens described in the
310 If no arguments are specified then the username of the target user is used.
312 The program should produce on standard output zero or
314 .Cm AuthorizedPrincipalsFile
317 .Cm AuthorizedPrincipalsCommand
319 .Cm AuthorizedPrincipalsFile
320 is specified, then certificates offered by the client for authentication
321 must contain a principal that is listed.
323 .Cm AuthorizedPrincipalsCommand
325 .It Cm AuthorizedPrincipalsCommandUser
326 Specifies the user under whose account the
327 .Cm AuthorizedPrincipalsCommand
329 It is recommended to use a dedicated user that has no other role on the host
330 than running authorized principals commands.
332 .Cm AuthorizedPrincipalsCommand
334 .Cm AuthorizedPrincipalsCommandUser
337 will refuse to start.
338 .It Cm AuthorizedPrincipalsFile
339 Specifies a file that lists principal names that are accepted for
340 certificate authentication.
341 When using certificates signed by a key listed in
342 .Cm TrustedUserCAKeys ,
343 this file lists names, one of which must appear in the certificate for it
344 to be accepted for authentication.
345 Names are listed one per line preceded by key options (as described in
346 .Sx AUTHORIZED_KEYS FILE FORMAT
349 Empty lines and comments starting with
354 .Cm AuthorizedPrincipalsFile
355 accept the tokens described in the
359 .Cm AuthorizedPrincipalsFile
360 is taken to be an absolute path or one relative to the user's home directory.
363 i.e. not to use a principals file \(en in this case, the username
364 of the user must appear in a certificate's principals list for it to be
368 .Cm AuthorizedPrincipalsFile
369 is only used when authentication proceeds using a CA listed in
370 .Cm TrustedUserCAKeys
371 and is not consulted for certification authorities trusted via
372 .Pa ~/.ssh/authorized_keys ,
375 key option offers a similar facility (see
379 The contents of the specified file are sent to the remote user before
380 authentication is allowed.
383 then no banner is displayed.
384 By default, no banner is displayed.
385 .It Cm ChallengeResponseAuthentication
386 Specifies whether challenge-response authentication is allowed (e.g. via
387 PAM or through authentication styles supported in
391 .It Cm ChrootDirectory
392 Specifies the pathname of a directory to
394 to after authentication.
397 checks that all components of the pathname are root-owned directories
398 which are not writable by any other user or group.
401 changes the working directory to the user's home directory.
404 accept the tokens described in the
410 must contain the necessary files and directories to support the
412 For an interactive session this requires at least a shell, typically
425 For file transfer sessions using SFTP
426 no additional configuration of the environment is necessary if the in-process
428 though sessions which use logging may require
430 inside the chroot directory on some operating systems (see
434 For safety, it is very important that the directory hierarchy be
435 prevented from modification by other processes on the system (especially
436 those outside the jail).
437 Misconfiguration can lead to unsafe environments which
446 Specifies the ciphers allowed.
447 Multiple ciphers must be comma-separated.
448 If the specified value begins with a
450 character, then the specified ciphers will be appended to the default set
451 instead of replacing them.
452 If the specified value begins with a
454 character, then the specified ciphers (including wildcards) will be removed
455 from the default set instead of replacing them.
457 The supported ciphers are:
459 .Bl -item -compact -offset indent
475 aes128-gcm@openssh.com
477 aes256-gcm@openssh.com
479 chacha20-poly1305@openssh.com
483 .Bd -literal -offset indent
484 chacha20-poly1305@openssh.com,
485 aes128-ctr,aes192-ctr,aes256-ctr,
486 aes128-gcm@openssh.com,aes256-gcm@openssh.com,
487 aes128-cbc,aes192-cbc,aes256-cbc
490 The list of available ciphers may also be obtained using
492 .It Cm ClientAliveCountMax
493 Sets the number of client alive messages which may be sent without
495 receiving any messages back from the client.
496 If this threshold is reached while client alive messages are being sent,
497 sshd will disconnect the client, terminating the session.
498 It is important to note that the use of client alive messages is very
501 The client alive messages are sent through the encrypted channel
502 and therefore will not be spoofable.
503 The TCP keepalive option enabled by
506 The client alive mechanism is valuable when the client or
507 server depend on knowing when a connection has become inactive.
509 The default value is 3.
511 .Cm ClientAliveInterval
513 .Cm ClientAliveCountMax
514 is left at the default, unresponsive SSH clients
515 will be disconnected after approximately 45 seconds.
516 .It Cm ClientAliveInterval
517 Sets a timeout interval in seconds after which if no data has been received
520 will send a message through the encrypted
521 channel to request a response from the client.
523 is 0, indicating that these messages will not be sent to the client.
525 Specifies whether compression is enabled after
526 the user has authenticated successfully.
530 (a legacy synonym for
537 This keyword can be followed by a list of group name patterns, separated
539 Login is disallowed for users whose primary group or supplementary
540 group list matches one of the patterns.
541 Only group names are valid; a numerical group ID is not recognized.
542 By default, login is allowed for all groups.
543 The allow/deny directives are processed in the following order:
552 for more information on patterns.
554 This keyword can be followed by a list of user name patterns, separated
556 Login is disallowed for user names that match one of the patterns.
557 Only user names are valid; a numerical user ID is not recognized.
558 By default, login is allowed for all users.
559 If the pattern takes the form USER@HOST then USER and HOST
560 are separately checked, restricting logins to particular
561 users from particular hosts.
562 HOST criteria may additionally contain addresses to match in CIDR
563 address/masklen format.
564 The allow/deny directives are processed in the following order:
573 for more information on patterns.
574 .It Cm DisableForwarding
575 Disables all forwarding features, including X11,
578 This option overrides all other forwarding-related options and may
579 simplify restricted configurations.
580 .It Cm ExposeAuthInfo
581 Writes a temporary file containing a list of authentication methods and
582 public credentials (e.g. keys) used to authenticate the user.
583 The location of the file is exposed to the user session through the
585 environment variable.
588 .It Cm FingerprintHash
589 Specifies the hash algorithm used when logging key fingerprints.
597 Forces the execution of the command specified by
599 ignoring any command supplied by the client and
602 The command is invoked by using the user's login shell with the -c option.
603 This applies to shell, command, or subsystem execution.
604 It is most useful inside a
607 The command originally supplied by the client is available in the
608 .Ev SSH_ORIGINAL_COMMAND
609 environment variable.
610 Specifying a command of
612 will force the use of an in-process SFTP server that requires no support
614 .Cm ChrootDirectory .
618 Specifies whether remote hosts are allowed to connect to ports
619 forwarded for the client.
622 binds remote port forwardings to the loopback address.
623 This prevents other remote hosts from connecting to forwarded ports.
625 can be used to specify that sshd
626 should allow remote port forwardings to bind to non-loopback addresses, thus
627 allowing other hosts to connect.
630 to force remote port forwardings to be available to the local host only,
632 to force remote port forwardings to bind to the wildcard address, or
634 to allow the client to select the address to which the forwarding is bound.
637 .It Cm GSSAPIAuthentication
638 Specifies whether user authentication based on GSSAPI is allowed.
641 .It Cm GSSAPICleanupCredentials
642 Specifies whether to automatically destroy the user's credentials cache
646 .It Cm GSSAPIStrictAcceptorCheck
647 Determines whether to be strict about the identity of the GSSAPI acceptor
648 a client authenticates against.
651 then the client must authenticate against the host
652 service on the current hostname.
655 then the client may authenticate against any service key stored in the
656 machine's default store.
657 This facility is provided to assist with operation on multi homed machines.
660 .It Cm HostbasedAcceptedKeyTypes
661 Specifies the key types that will be accepted for hostbased authentication
662 as a comma-separated pattern list.
663 Alternately if the specified value begins with a
665 character, then the specified key types will be appended to the default set
666 instead of replacing them.
667 If the specified value begins with a
669 character, then the specified key types (including wildcards) will be removed
670 from the default set instead of replacing them.
671 The default for this option is:
672 .Bd -literal -offset 3n
673 ecdsa-sha2-nistp256-cert-v01@openssh.com,
674 ecdsa-sha2-nistp384-cert-v01@openssh.com,
675 ecdsa-sha2-nistp521-cert-v01@openssh.com,
676 ssh-ed25519-cert-v01@openssh.com,
677 ssh-rsa-cert-v01@openssh.com,
678 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
682 The list of available key types may also be obtained using
684 .It Cm HostbasedAuthentication
685 Specifies whether rhosts or /etc/hosts.equiv authentication together
686 with successful public key client host authentication is allowed
687 (host-based authentication).
690 .It Cm HostbasedUsesNameFromPacketOnly
691 Specifies whether or not the server will attempt to perform a reverse
692 name lookup when matching the name in the
698 .Cm HostbasedAuthentication .
703 uses the name supplied by the client rather than
704 attempting to resolve the name from the TCP connection itself.
707 .It Cm HostCertificate
708 Specifies a file containing a public host certificate.
709 The certificate's public key must match a private host key already specified
712 The default behaviour of
714 is not to load any certificates.
716 Specifies a file containing a private host key
719 .Pa /etc/ssh/ssh_host_ecdsa_key ,
720 .Pa /etc/ssh/ssh_host_ed25519_key
722 .Pa /etc/ssh/ssh_host_rsa_key .
726 will refuse to use a file if it is group/world-accessible
728 .Cm HostKeyAlgorithms
729 option restricts which of the keys are actually used by
732 It is possible to have multiple host key files.
733 It is also possible to specify public host key files instead.
734 In this case operations on the private key will be delegated
738 Identifies the UNIX-domain socket used to communicate
739 with an agent that has access to the private host keys.
742 is specified, the location of the socket will be read from the
744 environment variable.
745 .It Cm HostKeyAlgorithms
746 Specifies the host key algorithms
747 that the server offers.
748 The default for this option is:
749 .Bd -literal -offset 3n
750 ecdsa-sha2-nistp256-cert-v01@openssh.com,
751 ecdsa-sha2-nistp384-cert-v01@openssh.com,
752 ecdsa-sha2-nistp521-cert-v01@openssh.com,
753 ssh-ed25519-cert-v01@openssh.com,
754 ssh-rsa-cert-v01@openssh.com,
755 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
759 The list of available key types may also be obtained using
766 files will not be used in
767 .Cm HostbasedAuthentication .
771 .Pa /etc/ssh/shosts.equiv
775 .It Cm IgnoreUserKnownHosts
778 should ignore the user's
779 .Pa ~/.ssh/known_hosts
781 .Cm HostbasedAuthentication
782 and use only the system-wide known hosts file
783 .Pa /etc/ssh/known_hosts .
787 Specifies the IPv4 type-of-service or DSCP class for the connection.
815 to use the operating system default.
816 This option may take one or two arguments, separated by whitespace.
817 If one argument is specified, it is used as the packet class unconditionally.
818 If two values are specified, the first is automatically selected for
819 interactive sessions and the second for non-interactive sessions.
822 for interactive sessions and
824 for non-interactive sessions.
825 .It Cm KbdInteractiveAuthentication
826 Specifies whether to allow keyboard-interactive authentication.
827 The argument to this keyword must be
831 The default is to use whatever value
832 .Cm ChallengeResponseAuthentication
836 .It Cm KerberosAuthentication
837 Specifies whether the password provided by the user for
838 .Cm PasswordAuthentication
839 will be validated through the Kerberos KDC.
840 To use this option, the server needs a
841 Kerberos servtab which allows the verification of the KDC's identity.
844 .It Cm KerberosGetAFSToken
845 If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
846 an AFS token before accessing the user's home directory.
849 .It Cm KerberosOrLocalPasswd
850 If password authentication through Kerberos fails then
851 the password will be validated via any additional local mechanism
856 .It Cm KerberosTicketCleanup
857 Specifies whether to automatically destroy the user's ticket cache
862 Specifies the available KEX (Key Exchange) algorithms.
863 Multiple algorithms must be comma-separated.
864 Alternately if the specified value begins with a
866 character, then the specified methods will be appended to the default set
867 instead of replacing them.
868 If the specified value begins with a
870 character, then the specified methods (including wildcards) will be removed
871 from the default set instead of replacing them.
872 The supported algorithms are:
874 .Bl -item -compact -offset indent
878 curve25519-sha256@libssh.org
880 diffie-hellman-group1-sha1
882 diffie-hellman-group14-sha1
884 diffie-hellman-group14-sha256
886 diffie-hellman-group16-sha512
888 diffie-hellman-group18-sha512
890 diffie-hellman-group-exchange-sha1
892 diffie-hellman-group-exchange-sha256
902 .Bd -literal -offset indent
903 curve25519-sha256,curve25519-sha256@libssh.org,
904 ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
905 diffie-hellman-group-exchange-sha256,
906 diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,
907 diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
910 The list of available key exchange algorithms may also be obtained using
913 Specifies the local addresses
916 The following forms may be used:
918 .Bl -item -offset indent -compact
922 .Ar hostname | address
924 .Op Cm rdomain Ar domain
930 .Op Cm rdomain Ar domain
934 .Ar IPv4_address : port
936 .Op Cm rdomain Ar domain
940 .Oo Ar hostname | address Oc : Ar port
942 .Op Cm rdomain Ar domain
949 listen in an explicit routing domain.
953 sshd will listen on the address and all
956 The default is to listen on all local addresses on the current default
960 options are permitted.
961 For more information on routing domains, see
963 .It Cm LoginGraceTime
964 The server disconnects after this time if the user has not
965 successfully logged in.
966 If the value is 0, there is no time limit.
967 The default is 120 seconds.
969 Gives the verbosity level that is used when logging messages from
971 The possible values are:
972 QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
974 DEBUG and DEBUG1 are equivalent.
975 DEBUG2 and DEBUG3 each specify higher levels of debugging output.
976 Logging with a DEBUG level violates the privacy of users and is not recommended.
978 Specifies the available MAC (message authentication code) algorithms.
979 The MAC algorithm is used for data integrity protection.
980 Multiple algorithms must be comma-separated.
981 If the specified value begins with a
983 character, then the specified algorithms will be appended to the default set
984 instead of replacing them.
985 If the specified value begins with a
987 character, then the specified algorithms (including wildcards) will be removed
988 from the default set instead of replacing them.
990 The algorithms that contain
992 calculate the MAC after encryption (encrypt-then-mac).
993 These are considered safer and their use recommended.
994 The supported MACs are:
996 .Bl -item -compact -offset indent
1012 umac-128@openssh.com
1014 hmac-md5-etm@openssh.com
1016 hmac-md5-96-etm@openssh.com
1018 hmac-sha1-etm@openssh.com
1020 hmac-sha1-96-etm@openssh.com
1022 hmac-sha2-256-etm@openssh.com
1024 hmac-sha2-512-etm@openssh.com
1026 umac-64-etm@openssh.com
1028 umac-128-etm@openssh.com
1032 .Bd -literal -offset indent
1033 umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1034 hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
1035 hmac-sha1-etm@openssh.com,
1036 umac-64@openssh.com,umac-128@openssh.com,
1037 hmac-sha2-256,hmac-sha2-512,hmac-sha1
1040 The list of available MAC algorithms may also be obtained using
1043 Introduces a conditional block.
1044 If all of the criteria on the
1046 line are satisfied, the keywords on the following lines override those
1047 set in the global section of the config file, until either another
1049 line or the end of the file.
1050 If a keyword appears in multiple
1052 blocks that are satisfied, only the first instance of the keyword is
1057 are one or more criteria-pattern pairs or the single token
1059 which matches all criteria.
1060 The available criteria are
1073 on which the connection was received.)
1075 The match patterns may consist of single entries or comma-separated
1076 lists and may use the wildcard and negation operators described in the
1083 criteria may additionally contain addresses to match in CIDR
1084 address/masklen format,
1085 such as 192.0.2.0/24 or 2001:db8::/32.
1086 Note that the mask length provided must be consistent with the address -
1087 it is an error to specify a mask length that is too long for the address
1088 or one with bits set in this host portion of the address.
1089 For example, 192.0.2.0/33 and 192.0.2.0/8, respectively.
1091 Only a subset of keywords may be used on the lines following a
1094 Available keywords are
1096 .Cm AllowAgentForwarding ,
1098 .Cm AllowStreamLocalForwarding ,
1099 .Cm AllowTcpForwarding ,
1101 .Cm AuthenticationMethods ,
1102 .Cm AuthorizedKeysCommand ,
1103 .Cm AuthorizedKeysCommandUser ,
1104 .Cm AuthorizedKeysFile ,
1105 .Cm AuthorizedPrincipalsCommand ,
1106 .Cm AuthorizedPrincipalsCommandUser ,
1107 .Cm AuthorizedPrincipalsFile ,
1109 .Cm ChrootDirectory ,
1110 .Cm ClientAliveCountMax ,
1111 .Cm ClientAliveInterval ,
1116 .Cm GSSAPIAuthentication ,
1117 .Cm HostbasedAcceptedKeyTypes ,
1118 .Cm HostbasedAuthentication ,
1119 .Cm HostbasedUsesNameFromPacketOnly ,
1121 .Cm KbdInteractiveAuthentication ,
1122 .Cm KerberosAuthentication ,
1126 .Cm PasswordAuthentication ,
1127 .Cm PermitEmptyPasswords ,
1129 .Cm PermitRootLogin ,
1133 .Cm PubkeyAcceptedKeyTypes ,
1134 .Cm PubkeyAuthentication ,
1138 .Cm StreamLocalBindMask ,
1139 .Cm StreamLocalBindUnlink ,
1140 .Cm TrustedUserCAKeys ,
1141 .Cm X11DisplayOffset ,
1144 .Cm X11UseLocalHost .
1146 Specifies the maximum number of authentication attempts permitted per
1148 Once the number of failures reaches half this value,
1149 additional failures are logged.
1152 Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1153 sessions permitted per network connection.
1154 Multiple sessions may be established by clients that support connection
1158 to 1 will effectively disable session multiplexing, whereas setting it to 0
1159 will prevent all shell, login and subsystem sessions while still permitting
1163 Specifies the maximum number of concurrent unauthenticated connections to the
1165 Additional connections will be dropped until authentication succeeds or the
1167 expires for a connection.
1168 The default is 10:30:100.
1170 Alternatively, random early drop can be enabled by specifying
1171 the three colon separated values
1172 start:rate:full (e.g. "10:30:60").
1174 will refuse connection attempts with a probability of rate/100 (30%)
1175 if there are currently start (10) unauthenticated connections.
1176 The probability increases linearly and all connection attempts
1177 are refused if the number of unauthenticated connections reaches full (60).
1178 .It Cm PasswordAuthentication
1179 Specifies whether password authentication is allowed.
1184 .It Cm PermitEmptyPasswords
1185 When password authentication is allowed, it specifies whether the
1186 server allows login to accounts with empty password strings.
1190 Specifies the destinations to which TCP port forwarding is permitted.
1191 The forwarding specification must be one of the following forms:
1193 .Bl -item -offset indent -compact
1202 .Ar IPv4_addr : port
1207 .Ar \&[ IPv6_addr \&] : port
1211 Multiple forwards may be specified by separating them with whitespace.
1214 can be used to remove all restrictions and permit any forwarding requests.
1217 can be used to prohibit all forwarding requests.
1220 can be used for host or port to allow all hosts or ports, respectively.
1221 By default all port forwarding requests are permitted.
1222 .It Cm PermitRootLogin
1223 Specifies whether root can log in using
1225 The argument must be
1227 .Cm prohibit-password ,
1228 .Cm forced-commands-only ,
1234 .Cm ChallengeResponseAuthentication
1239 this setting may be overridden by the PAM policy.
1241 If this option is set to
1242 .Cm prohibit-password
1243 (or its deprecated alias,
1244 .Cm without-password ) ,
1245 password and keyboard-interactive authentication are disabled for root.
1247 If this option is set to
1248 .Cm forced-commands-only ,
1249 root login with public key authentication will be allowed,
1252 option has been specified
1253 (which may be useful for taking remote backups even if root login is
1254 normally not allowed).
1255 All other authentication methods are disabled for root.
1257 If this option is set to
1259 root is not allowed to log in.
1263 allocation is permitted.
1269 device forwarding is allowed.
1270 The argument must be
1286 Independent of this setting, the permissions of the selected
1288 device must allow access to the user.
1289 .It Cm PermitUserEnvironment
1291 .Pa ~/.ssh/environment
1295 .Pa ~/.ssh/authorized_keys
1300 Enabling environment processing may enable users to bypass access
1301 restrictions in some configurations using mechanisms such as
1304 Specifies whether any
1310 Specifies the file that contains the process ID of the
1315 .Pa /var/run/sshd.pid .
1317 Specifies the port number that
1321 Multiple options of this type are permitted.
1327 should print the date and time of the last user login when a user logs
1336 when a user logs in interactively.
1337 (On some systems it is also printed by the shell,
1342 .It Cm PubkeyAcceptedKeyTypes
1343 Specifies the key types that will be accepted for public key authentication
1344 as a comma-separated pattern list.
1345 Alternately if the specified value begins with a
1347 character, then the specified key types will be appended to the default set
1348 instead of replacing them.
1349 If the specified value begins with a
1351 character, then the specified key types (including wildcards) will be removed
1352 from the default set instead of replacing them.
1353 The default for this option is:
1354 .Bd -literal -offset 3n
1355 ecdsa-sha2-nistp256-cert-v01@openssh.com,
1356 ecdsa-sha2-nistp384-cert-v01@openssh.com,
1357 ecdsa-sha2-nistp521-cert-v01@openssh.com,
1358 ssh-ed25519-cert-v01@openssh.com,
1359 ssh-rsa-cert-v01@openssh.com,
1360 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1364 The list of available key types may also be obtained using
1366 .It Cm PubkeyAuthentication
1367 Specifies whether public key authentication is allowed.
1371 Specifies the maximum amount of data that may be transmitted before the
1372 session key is renegotiated, optionally followed a maximum amount of
1373 time that may pass before the session key is renegotiated.
1374 The first argument is specified in bytes and may have a suffix of
1379 to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1380 The default is between
1384 depending on the cipher.
1385 The optional second value is specified in seconds and may use any of the
1386 units documented in the
1389 The default value for
1393 which means that rekeying is performed after the cipher's default amount
1394 of data has been sent or received and no time based rekeying is done.
1396 Specifies revoked public keys file, or
1399 Keys listed in this file will be refused for public key authentication.
1400 Note that if this file is not readable, then public key authentication will
1401 be refused for all users.
1402 Keys may be specified as a text file, listing one public key per line, or as
1403 an OpenSSH Key Revocation List (KRL) as generated by
1405 For more information on KRLs, see the KEY REVOCATION LISTS section in
1408 Specifies an explicit routing domain that is applied after authentication
1410 The user session, as well and any forwarded or listening IP sockets,
1411 will be bound to this
1413 If the routing domain is set to
1415 then the domain in which the incoming connection was received will be applied.
1416 .It Cm StreamLocalBindMask
1417 Sets the octal file creation mode mask
1419 used when creating a Unix-domain socket file for local or remote
1421 This option is only used for port forwarding to a Unix-domain socket file.
1423 The default value is 0177, which creates a Unix-domain socket file that is
1424 readable and writable only by the owner.
1425 Note that not all operating systems honor the file mode on Unix-domain
1427 .It Cm StreamLocalBindUnlink
1428 Specifies whether to remove an existing Unix-domain socket file for local
1429 or remote port forwarding before creating a new one.
1430 If the socket file already exists and
1431 .Cm StreamLocalBindUnlink
1434 will be unable to forward the port to the Unix-domain socket file.
1435 This option is only used for port forwarding to a Unix-domain socket file.
1437 The argument must be
1446 should check file modes and ownership of the
1447 user's files and home directory before accepting login.
1448 This is normally desirable because novices sometimes accidentally leave their
1449 directory or files world-writable.
1452 Note that this does not apply to
1453 .Cm ChrootDirectory ,
1454 whose permissions and ownership are checked unconditionally.
1456 Configures an external subsystem (e.g. file transfer daemon).
1457 Arguments should be a subsystem name and a command (with optional arguments)
1458 to execute upon subsystem request.
1462 implements the SFTP file transfer subsystem.
1464 Alternately the name
1466 implements an in-process SFTP server.
1467 This may simplify configurations using
1469 to force a different filesystem root on clients.
1471 By default no subsystems are defined.
1472 .It Cm SyslogFacility
1473 Gives the facility code that is used when logging messages from
1475 The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1476 LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1477 The default is AUTH.
1479 Specifies whether the system should send TCP keepalive messages to the
1481 If they are sent, death of the connection or crash of one
1482 of the machines will be properly noticed.
1483 However, this means that
1484 connections will die if the route is down temporarily, and some people
1486 On the other hand, if TCP keepalives are not sent,
1487 sessions may hang indefinitely on the server, leaving
1489 users and consuming server resources.
1493 (to send TCP keepalive messages), and the server will notice
1494 if the network goes down or the client host crashes.
1495 This avoids infinitely hanging sessions.
1497 To disable TCP keepalive messages, the value should be set to
1499 .It Cm TrustedUserCAKeys
1500 Specifies a file containing public keys of certificate authorities that are
1501 trusted to sign user certificates for authentication, or
1504 Keys are listed one per line; empty lines and comments starting with
1507 If a certificate is presented for authentication and has its signing CA key
1508 listed in this file, then it may be used for authentication for any user
1509 listed in the certificate's principals list.
1510 Note that certificates that lack a list of principals will not be permitted
1511 for authentication using
1512 .Cm TrustedUserCAKeys .
1513 For more details on certificates, see the CERTIFICATES section in
1518 attempts to send authentication success and failure messages
1527 should look up the remote host name, and to check that
1528 the resolved host name for the remote IP address maps back to the
1529 very same IP address.
1531 If this option is set to
1533 then only addresses and not host names may be used in
1534 .Pa ~/.ssh/authorized_keys
1544 Enables the Pluggable Authentication Module interface.
1547 this will enable PAM authentication using
1548 .Cm ChallengeResponseAuthentication
1550 .Cm PasswordAuthentication
1551 in addition to PAM account and session module processing for all
1552 authentication types.
1554 Because PAM challenge-response authentication usually serves an equivalent
1555 role to password authentication, you should disable either
1556 .Cm PasswordAuthentication
1558 .Cm ChallengeResponseAuthentication.
1562 is enabled, you will not be able to run
1567 .It Cm VersionAddendum
1568 Optionally specifies additional text to append to the SSH protocol banner
1569 sent by the server upon connection.
1571 .Qq FreeBSD-20180510 .
1574 may be used to disable this.
1575 .It Cm X11DisplayOffset
1576 Specifies the first display number available for
1579 This prevents sshd from interfering with real X11 servers.
1581 .It Cm X11Forwarding
1582 Specifies whether X11 forwarding is permitted.
1583 The argument must be
1590 When X11 forwarding is enabled, there may be additional exposure to
1591 the server and to client displays if the
1593 proxy display is configured to listen on the wildcard address (see
1594 .Cm X11UseLocalhost ) ,
1595 though this is not the default.
1596 Additionally, the authentication spoofing and authentication data
1597 verification and substitution occur on the client side.
1598 The security risk of using X11 forwarding is that the client's X11
1599 display server may be exposed to attack when the SSH client requests
1600 forwarding (see the warnings for
1603 .Xr ssh_config 5 ) .
1604 A system administrator may have a stance in which they want to
1605 protect clients that may expose themselves to attack by unwittingly
1606 requesting X11 forwarding, which can warrant a
1610 Note that disabling X11 forwarding does not prevent users from
1611 forwarding X11 traffic, as users can always install their own forwarders.
1612 .It Cm X11UseLocalhost
1615 should bind the X11 forwarding server to the loopback address or to
1616 the wildcard address.
1618 sshd binds the forwarding server to the loopback address and sets the
1619 hostname part of the
1621 environment variable to
1623 This prevents remote hosts from connecting to the proxy display.
1624 However, some older X11 clients may not function with this
1629 to specify that the forwarding server should be bound to the wildcard
1631 The argument must be
1637 .It Cm XAuthLocation
1638 Specifies the full pathname of the
1644 .Pa /usr/local/bin/xauth .
1648 command-line arguments and configuration file options that specify time
1649 may be expressed using a sequence of the form:
1651 .Ar time Op Ar qualifier ,
1655 is a positive integer value and
1657 is one of the following:
1659 .Bl -tag -width Ds -compact -offset indent
1674 Each member of the sequence is added together to calculate
1675 the total time value.
1677 Time format examples:
1679 .Bl -tag -width Ds -compact -offset indent
1681 600 seconds (10 minutes)
1685 1 hour 30 minutes (90 minutes)
1688 Arguments to some keywords can make use of tokens,
1689 which are expanded at runtime:
1691 .Bl -tag -width XXXX -offset indent -compact
1696 The routing domain in which the incoming connection was received.
1698 The fingerprint of the CA key.
1700 The fingerprint of the key or certificate.
1702 The home directory of the user.
1704 The key ID in the certificate.
1706 The base64-encoded CA key.
1708 The base64-encoded key or certificate for authentication.
1710 The serial number of the certificate.
1712 The type of the CA key.
1714 The key or certificate type.
1719 .Cm AuthorizedKeysCommand
1720 accepts the tokens %%, %f, %h, %k, %t, and %u.
1722 .Cm AuthorizedKeysFile
1723 accepts the tokens %%, %h, and %u.
1725 .Cm AuthorizedPrincipalsCommand
1726 accepts the tokens %%, %F, %f, %h, %i, %K, %k, %s, %T, %t, and %u.
1728 .Cm AuthorizedPrincipalsFile
1729 accepts the tokens %%, %h, and %u.
1732 accepts the tokens %%, %h, and %u.
1735 accepts the token %D.
1738 .It Pa /etc/ssh/sshd_config
1739 Contains configuration data for
1741 This file should be writable by root only, but it is recommended
1742 (though not necessary) that it be world-readable.
1749 OpenSSH is a derivative of the original and free
1750 ssh 1.2.12 release by
1752 .An Aaron Campbell , Bob Beck , Markus Friedl , Niels Provos ,
1756 removed many bugs, re-added newer features and
1759 contributed the support for SSH protocol versions 1.5 and 2.0.
1763 contributed support for privilege separation.