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.239 2016/11/30 03:00:05 djm Exp $
38 .Dd $Mdocdate: November 30 2016 $
43 .Nd OpenSSH SSH daemon configuration file
45 .Nm /etc/ssh/sshd_config
48 reads configuration data from
49 .Pa /etc/ssh/sshd_config
50 (or the file specified with
53 The file contains keyword-argument pairs, one per line.
56 and empty lines are interpreted as comments.
57 Arguments may optionally be enclosed in double quotes
59 in order to represent arguments containing spaces.
62 keywords and their meanings are as follows (note that
63 keywords are case-insensitive and arguments are case-sensitive):
66 Specifies what environment variables sent by the client will be copied into
73 for how to configure the client.
76 environment variable is always sent whenever the client
77 requests a pseudo-terminal as it is required by the protocol.
78 Variables are specified by name, which may contain the wildcard characters
82 Multiple environment variables may be separated by whitespace or spread
86 Be warned that some environment variables could be used to bypass restricted
88 For this reason, care should be taken in the use of this directive.
89 The default is not to accept any environment variables.
91 Specifies which address family should be used by
100 .It Cm AllowAgentForwarding
103 forwarding is permitted.
106 Note that disabling agent forwarding does not improve security
107 unless users are also denied shell access, as they can always install
108 their own forwarders.
110 This keyword can be followed by a list of group name patterns, separated
112 If specified, login is allowed only for users whose primary
113 group or supplementary group list matches one of the patterns.
114 Only group names are valid; a numerical group ID is not recognized.
115 By default, login is allowed for all groups.
116 The allow/deny directives are processed in the following order:
125 for more information on patterns.
126 .It Cm AllowStreamLocalForwarding
127 Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
128 The available options are
133 to allow StreamLocal forwarding,
135 to prevent all StreamLocal forwarding,
137 to allow local (from the perspective of
141 to allow remote forwarding only.
142 Note that disabling StreamLocal forwarding does not improve security unless
143 users are also denied shell access, as they can always install their
145 .It Cm AllowTcpForwarding
146 Specifies whether TCP forwarding is permitted.
147 The available options are
152 to allow TCP forwarding,
154 to prevent all TCP forwarding,
156 to allow local (from the perspective of
160 to allow remote forwarding only.
161 Note that disabling TCP forwarding does not improve security unless
162 users are also denied shell access, as they can always install their
165 This keyword can be followed by a list of user name patterns, separated
167 If specified, login is allowed only for user names that
168 match one of the patterns.
169 Only user names are valid; a numerical user ID is not recognized.
170 By default, login is allowed for all users.
171 If the pattern takes the form USER@HOST then USER and HOST
172 are separately checked, restricting logins to particular
173 users from particular hosts.
174 HOST criteria may additionally contain addresses to match in CIDR
175 address/masklen format.
176 The allow/deny directives are processed in the following order:
185 for more information on patterns.
186 .It Cm AuthenticationMethods
187 Specifies the authentication methods that must be successfully completed
188 for a user to be granted access.
189 This option must be followed by one or more comma-separated lists of
190 authentication method names, or by the single string
192 to indicate the default behaviour of accepting any single authentication
194 If the default is overridden, then successful authentication requires
195 completion of every method in at least one of these lists.
198 .Qq publickey,password publickey,keyboard-interactive
199 would require the user to complete public key authentication, followed by
200 either password or keyboard interactive authentication.
201 Only methods that are next in one or more lists are offered at each stage,
202 so for this example it would not be possible to attempt password or
203 keyboard-interactive authentication before public key.
205 For keyboard interactive authentication it is also possible to
206 restrict authentication to a specific device by appending a
207 colon followed by the device identifier
212 depending on the server configuration.
214 .Qq keyboard-interactive:bsdauth
215 would restrict keyboard interactive authentication to the
219 If the publickey method is listed more than once,
221 verifies that keys that have been used successfully are not reused for
222 subsequent authentications.
224 .Qq publickey,publickey
225 requires successful authentication using two different public keys.
227 Note that each authentication method listed should also be explicitly enabled
228 in the configuration.
229 .It Cm AuthorizedKeysCommand
230 Specifies a program to be used to look up the user's public keys.
231 The program must be owned by root, not writable by group or others and
232 specified by an absolute path.
234 .Cm AuthorizedKeysCommand
235 accept the tokens described in the
238 If no arguments are specified then the username of the target user is used.
240 The program should produce on standard output zero or
241 more lines of authorized_keys output (see
246 .Cm AuthorizedKeysCommand
247 does not successfully authenticate
248 and authorize the user then public key authentication continues using the usual
249 .Cm AuthorizedKeysFile
252 .Cm AuthorizedKeysCommand
254 .It Cm AuthorizedKeysCommandUser
255 Specifies the user under whose account the
256 .Cm AuthorizedKeysCommand
258 It is recommended to use a dedicated user that has no other role on the host
259 than running authorized keys commands.
261 .Cm AuthorizedKeysCommand
263 .Cm AuthorizedKeysCommandUser
266 will refuse to start.
267 .It Cm AuthorizedKeysFile
268 Specifies the file that contains the public keys used for user authentication.
269 The format is described in the
270 .Sx AUTHORIZED_KEYS FILE FORMAT
274 .Cm AuthorizedKeysFile
275 accept the tokens described in the
279 .Cm AuthorizedKeysFile
280 is taken to be an absolute path or one relative to the user's home
282 Multiple files may be listed, separated by whitespace.
283 Alternately this option may be set to
285 to skip checking for user keys in files.
287 .Qq .ssh/authorized_keys .ssh/authorized_keys2 .
288 .It Cm AuthorizedPrincipalsCommand
289 Specifies a program to be used to generate the list of allowed
290 certificate principals as per
291 .Cm AuthorizedPrincipalsFile .
292 The program must be owned by root, not writable by group or others and
293 specified by an absolute path.
295 .Cm AuthorizedPrincipalsCommand
296 accept the tokens described in the
299 If no arguments are specified then the username of the target user is used.
301 The program should produce on standard output zero or
303 .Cm AuthorizedPrincipalsFile
306 .Cm AuthorizedPrincipalsCommand
308 .Cm AuthorizedPrincipalsFile
309 is specified, then certificates offered by the client for authentication
310 must contain a principal that is listed.
312 .Cm AuthorizedPrincipalsCommand
314 .It Cm AuthorizedPrincipalsCommandUser
315 Specifies the user under whose account the
316 .Cm AuthorizedPrincipalsCommand
318 It is recommended to use a dedicated user that has no other role on the host
319 than running authorized principals commands.
321 .Cm AuthorizedPrincipalsCommand
323 .Cm AuthorizedPrincipalsCommandUser
326 will refuse to start.
327 .It Cm AuthorizedPrincipalsFile
328 Specifies a file that lists principal names that are accepted for
329 certificate authentication.
330 When using certificates signed by a key listed in
331 .Cm TrustedUserCAKeys ,
332 this file lists names, one of which must appear in the certificate for it
333 to be accepted for authentication.
334 Names are listed one per line preceded by key options (as described in
335 .Sx AUTHORIZED_KEYS FILE FORMAT
338 Empty lines and comments starting with
343 .Cm AuthorizedPrincipalsFile
344 accept the tokens described in the
348 .Cm AuthorizedPrincipalsFile
349 is taken to be an absolute path or one relative to the user's home directory.
352 i.e. not to use a principals file \(en in this case, the username
353 of the user must appear in a certificate's principals list for it to be
357 .Cm AuthorizedPrincipalsFile
358 is only used when authentication proceeds using a CA listed in
359 .Cm TrustedUserCAKeys
360 and is not consulted for certification authorities trusted via
361 .Pa ~/.ssh/authorized_keys ,
364 key option offers a similar facility (see
368 The contents of the specified file are sent to the remote user before
369 authentication is allowed.
372 then no banner is displayed.
373 By default, no banner is displayed.
374 .It Cm ChallengeResponseAuthentication
375 Specifies whether challenge-response authentication is allowed (e.g. via
376 PAM or through authentication styles supported in
380 .It Cm ChrootDirectory
381 Specifies the pathname of a directory to
383 to after authentication.
386 checks that all components of the pathname are root-owned directories
387 which are not writable by any other user or group.
390 changes the working directory to the user's home directory.
393 accept the tokens described in the
399 must contain the necessary files and directories to support the
401 For an interactive session this requires at least a shell, typically
414 For file transfer sessions using SFTP
415 no additional configuration of the environment is necessary if the in-process
417 though sessions which use logging may require
419 inside the chroot directory on some operating systems (see
423 For safety, it is very important that the directory hierarchy be
424 prevented from modification by other processes on the system (especially
425 those outside the jail).
426 Misconfiguration can lead to unsafe environments which
435 Specifies the ciphers allowed.
436 Multiple ciphers must be comma-separated.
437 If the specified value begins with a
439 character, then the specified ciphers will be appended to the default set
440 instead of replacing them.
442 The supported ciphers are:
444 .Bl -item -compact -offset indent
460 aes128-gcm@openssh.com
462 aes256-gcm@openssh.com
474 chacha20-poly1305@openssh.com
478 .Bd -literal -offset indent
479 chacha20-poly1305@openssh.com,
480 aes128-ctr,aes192-ctr,aes256-ctr,
481 aes128-gcm@openssh.com,aes256-gcm@openssh.com,
482 aes128-cbc,aes192-cbc,aes256-cbc
485 The list of available ciphers may also be obtained using
487 .It Cm ClientAliveCountMax
488 Sets the number of client alive messages which may be sent without
490 receiving any messages back from the client.
491 If this threshold is reached while client alive messages are being sent,
492 sshd will disconnect the client, terminating the session.
493 It is important to note that the use of client alive messages is very
496 The client alive messages are sent through the encrypted channel
497 and therefore will not be spoofable.
498 The TCP keepalive option enabled by
501 The client alive mechanism is valuable when the client or
502 server depend on knowing when a connection has become inactive.
504 The default value is 3.
506 .Cm ClientAliveInterval
508 .Cm ClientAliveCountMax
509 is left at the default, unresponsive SSH clients
510 will be disconnected after approximately 45 seconds.
511 .It Cm ClientAliveInterval
512 Sets a timeout interval in seconds after which if no data has been received
515 will send a message through the encrypted
516 channel to request a response from the client.
518 is 0, indicating that these messages will not be sent to the client.
520 Specifies whether compression is enabled after
521 the user has authenticated successfully.
525 (a legacy synonym for
532 This keyword can be followed by a list of group name patterns, separated
534 Login is disallowed for users whose primary group or supplementary
535 group list matches one of the patterns.
536 Only group names are valid; a numerical group ID is not recognized.
537 By default, login is allowed for all groups.
538 The allow/deny directives are processed in the following order:
547 for more information on patterns.
549 This keyword can be followed by a list of user name patterns, separated
551 Login is disallowed for user names that match one of the patterns.
552 Only user names are valid; a numerical user ID is not recognized.
553 By default, login is allowed for all users.
554 If the pattern takes the form USER@HOST then USER and HOST
555 are separately checked, restricting logins to particular
556 users from particular hosts.
557 HOST criteria may additionally contain addresses to match in CIDR
558 address/masklen format.
559 The allow/deny directives are processed in the following order:
568 for more information on patterns.
569 .It Cm DisableForwarding
570 Disables all forwarding features, including X11,
573 This option overrides all other forwarding-related options and may
574 simplify restricted configurations.
575 .It Cm FingerprintHash
576 Specifies the hash algorithm used when logging key fingerprints.
584 Forces the execution of the command specified by
586 ignoring any command supplied by the client and
589 The command is invoked by using the user's login shell with the -c option.
590 This applies to shell, command, or subsystem execution.
591 It is most useful inside a
594 The command originally supplied by the client is available in the
595 .Ev SSH_ORIGINAL_COMMAND
596 environment variable.
597 Specifying a command of
599 will force the use of an in-process SFTP server that requires no support
601 .Cm ChrootDirectory .
605 Specifies whether remote hosts are allowed to connect to ports
606 forwarded for the client.
609 binds remote port forwardings to the loopback address.
610 This prevents other remote hosts from connecting to forwarded ports.
612 can be used to specify that sshd
613 should allow remote port forwardings to bind to non-loopback addresses, thus
614 allowing other hosts to connect.
617 to force remote port forwardings to be available to the local host only,
619 to force remote port forwardings to bind to the wildcard address, or
621 to allow the client to select the address to which the forwarding is bound.
624 .It Cm GSSAPIAuthentication
625 Specifies whether user authentication based on GSSAPI is allowed.
628 .It Cm GSSAPICleanupCredentials
629 Specifies whether to automatically destroy the user's credentials cache
633 .It Cm GSSAPIStrictAcceptorCheck
634 Determines whether to be strict about the identity of the GSSAPI acceptor
635 a client authenticates against.
638 then the client must authenticate against the host
639 service on the current hostname.
642 then the client may authenticate against any service key stored in the
643 machine's default store.
644 This facility is provided to assist with operation on multi homed machines.
647 .It Cm HostbasedAcceptedKeyTypes
648 Specifies the key types that will be accepted for hostbased authentication
649 as a comma-separated pattern list.
650 Alternately if the specified value begins with a
652 character, then the specified key types will be appended to the default set
653 instead of replacing them.
654 The default for this option is:
655 .Bd -literal -offset 3n
656 ecdsa-sha2-nistp256-cert-v01@openssh.com,
657 ecdsa-sha2-nistp384-cert-v01@openssh.com,
658 ecdsa-sha2-nistp521-cert-v01@openssh.com,
659 ssh-ed25519-cert-v01@openssh.com,
660 ssh-rsa-cert-v01@openssh.com,
661 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
665 The list of available key types may also be obtained using
667 .It Cm HostbasedAuthentication
668 Specifies whether rhosts or /etc/hosts.equiv authentication together
669 with successful public key client host authentication is allowed
670 (host-based authentication).
673 .It Cm HostbasedUsesNameFromPacketOnly
674 Specifies whether or not the server will attempt to perform a reverse
675 name lookup when matching the name in the
681 .Cm HostbasedAuthentication .
686 uses the name supplied by the client rather than
687 attempting to resolve the name from the TCP connection itself.
690 .It Cm HostCertificate
691 Specifies a file containing a public host certificate.
692 The certificate's public key must match a private host key already specified
695 The default behaviour of
697 is not to load any certificates.
699 Specifies a file containing a private host key
702 .Pa /etc/ssh/ssh_host_dsa_key ,
703 .Pa /etc/ssh/ssh_host_ecdsa_key ,
704 .Pa /etc/ssh/ssh_host_ed25519_key
706 .Pa /etc/ssh/ssh_host_rsa_key .
710 will refuse to use a file if it is group/world-accessible
712 .Cm HostKeyAlgorithms
713 option restricts which of the keys are actually used by
716 It is possible to have multiple host key files.
717 It is also possible to specify public host key files instead.
718 In this case operations on the private key will be delegated
722 Identifies the UNIX-domain socket used to communicate
723 with an agent that has access to the private host keys.
726 is specified, the location of the socket will be read from the
728 environment variable.
729 .It Cm HostKeyAlgorithms
730 Specifies the host key algorithms
731 that the server offers.
732 The default for this option is:
733 .Bd -literal -offset 3n
734 ecdsa-sha2-nistp256-cert-v01@openssh.com,
735 ecdsa-sha2-nistp384-cert-v01@openssh.com,
736 ecdsa-sha2-nistp521-cert-v01@openssh.com,
737 ssh-ed25519-cert-v01@openssh.com,
738 ssh-rsa-cert-v01@openssh.com,
739 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
743 The list of available key types may also be obtained using
750 files will not be used in
751 .Cm HostbasedAuthentication .
755 .Pa /etc/ssh/shosts.equiv
759 .It Cm IgnoreUserKnownHosts
762 should ignore the user's
763 .Pa ~/.ssh/known_hosts
765 .Cm HostbasedAuthentication .
769 Specifies the IPv4 type-of-service or DSCP class for the connection.
796 This option may take one or two arguments, separated by whitespace.
797 If one argument is specified, it is used as the packet class unconditionally.
798 If two values are specified, the first is automatically selected for
799 interactive sessions and the second for non-interactive sessions.
802 for interactive sessions and
804 for non-interactive sessions.
805 .It Cm KbdInteractiveAuthentication
806 Specifies whether to allow keyboard-interactive authentication.
807 The argument to this keyword must be
811 The default is to use whatever value
812 .Cm ChallengeResponseAuthentication
816 .It Cm KerberosAuthentication
817 Specifies whether the password provided by the user for
818 .Cm PasswordAuthentication
819 will be validated through the Kerberos KDC.
820 To use this option, the server needs a
821 Kerberos servtab which allows the verification of the KDC's identity.
824 .It Cm KerberosGetAFSToken
825 If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
826 an AFS token before accessing the user's home directory.
829 .It Cm KerberosOrLocalPasswd
830 If password authentication through Kerberos fails then
831 the password will be validated via any additional local mechanism
836 .It Cm KerberosTicketCleanup
837 Specifies whether to automatically destroy the user's ticket cache
842 Specifies the available KEX (Key Exchange) algorithms.
843 Multiple algorithms must be comma-separated.
844 Alternately if the specified value begins with a
846 character, then the specified methods will be appended to the default set
847 instead of replacing them.
848 The supported algorithms are:
850 .Bl -item -compact -offset indent
854 curve25519-sha256@libssh.org
856 diffie-hellman-group1-sha1
858 diffie-hellman-group14-sha1
860 diffie-hellman-group-exchange-sha1
862 diffie-hellman-group-exchange-sha256
872 .Bd -literal -offset indent
873 curve25519-sha256,curve25519-sha256@libssh.org,
874 ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
875 diffie-hellman-group-exchange-sha256,
876 diffie-hellman-group14-sha1
879 The list of available key exchange algorithms may also be obtained using
882 Specifies the local addresses
885 The following forms may be used:
887 .Bl -item -offset indent -compact
891 .Ar host | Ar IPv4_addr | Ar IPv6_addr
896 .Ar host | Ar IPv4_addr : Ar port
902 .Ar host | Ar IPv6_addr Oc : Ar port
909 sshd will listen on the address and all
912 The default is to listen on all local addresses.
915 options are permitted.
916 .It Cm LoginGraceTime
917 The server disconnects after this time if the user has not
918 successfully logged in.
919 If the value is 0, there is no time limit.
920 The default is 120 seconds.
922 Gives the verbosity level that is used when logging messages from
924 The possible values are:
925 QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
927 DEBUG and DEBUG1 are equivalent.
928 DEBUG2 and DEBUG3 each specify higher levels of debugging output.
929 Logging with a DEBUG level violates the privacy of users and is not recommended.
931 Specifies the available MAC (message authentication code) algorithms.
932 The MAC algorithm is used for data integrity protection.
933 Multiple algorithms must be comma-separated.
934 If the specified value begins with a
936 character, then the specified algorithms will be appended to the default set
937 instead of replacing them.
939 The algorithms that contain
941 calculate the MAC after encryption (encrypt-then-mac).
942 These are considered safer and their use recommended.
943 The supported MACs are:
945 .Bl -item -compact -offset indent
965 hmac-md5-etm@openssh.com
967 hmac-md5-96-etm@openssh.com
969 hmac-ripemd160-etm@openssh.com
971 hmac-sha1-etm@openssh.com
973 hmac-sha1-96-etm@openssh.com
975 hmac-sha2-256-etm@openssh.com
977 hmac-sha2-512-etm@openssh.com
979 umac-64-etm@openssh.com
981 umac-128-etm@openssh.com
985 .Bd -literal -offset indent
986 umac-64-etm@openssh.com,umac-128-etm@openssh.com,
987 hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
988 hmac-sha1-etm@openssh.com,
989 umac-64@openssh.com,umac-128@openssh.com,
990 hmac-sha2-256,hmac-sha2-512,hmac-sha1
993 The list of available MAC algorithms may also be obtained using
996 Introduces a conditional block.
997 If all of the criteria on the
999 line are satisfied, the keywords on the following lines override those
1000 set in the global section of the config file, until either another
1002 line or the end of the file.
1003 If a keyword appears in multiple
1005 blocks that are satisfied, only the first instance of the keyword is
1010 are one or more criteria-pattern pairs or the single token
1012 which matches all criteria.
1013 The available criteria are
1021 The match patterns may consist of single entries or comma-separated
1022 lists and may use the wildcard and negation operators described in the
1029 criteria may additionally contain addresses to match in CIDR
1030 address/masklen format,
1031 such as 192.0.2.0/24 or 2001:db8::/32.
1032 Note that the mask length provided must be consistent with the address -
1033 it is an error to specify a mask length that is too long for the address
1034 or one with bits set in this host portion of the address.
1035 For example, 192.0.2.0/33 and 192.0.2.0/8, respectively.
1037 Only a subset of keywords may be used on the lines following a
1040 Available keywords are
1042 .Cm AllowAgentForwarding ,
1044 .Cm AllowStreamLocalForwarding ,
1045 .Cm AllowTcpForwarding ,
1047 .Cm AuthenticationMethods ,
1048 .Cm AuthorizedKeysCommand ,
1049 .Cm AuthorizedKeysCommandUser ,
1050 .Cm AuthorizedKeysFile ,
1051 .Cm AuthorizedPrincipalsCommand ,
1052 .Cm AuthorizedPrincipalsCommandUser ,
1053 .Cm AuthorizedPrincipalsFile ,
1055 .Cm ChrootDirectory ,
1056 .Cm ClientAliveCountMax ,
1057 .Cm ClientAliveInterval ,
1062 .Cm GSSAPIAuthentication ,
1063 .Cm HostbasedAcceptedKeyTypes ,
1064 .Cm HostbasedAuthentication ,
1065 .Cm HostbasedUsesNameFromPacketOnly ,
1067 .Cm KbdInteractiveAuthentication ,
1068 .Cm KerberosAuthentication ,
1071 .Cm PasswordAuthentication ,
1072 .Cm PermitEmptyPasswords ,
1074 .Cm PermitRootLogin ,
1078 .Cm PubkeyAcceptedKeyTypes ,
1079 .Cm PubkeyAuthentication ,
1082 .Cm StreamLocalBindMask ,
1083 .Cm StreamLocalBindUnlink ,
1084 .Cm TrustedUserCAKeys ,
1085 .Cm X11DisplayOffset ,
1088 .Cm X11UseLocalHost .
1090 Specifies the maximum number of authentication attempts permitted per
1092 Once the number of failures reaches half this value,
1093 additional failures are logged.
1096 Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1097 sessions permitted per network connection.
1098 Multiple sessions may be established by clients that support connection
1102 to 1 will effectively disable session multiplexing, whereas setting it to 0
1103 will prevent all shell, login and subsystem sessions while still permitting
1107 Specifies the maximum number of concurrent unauthenticated connections to the
1109 Additional connections will be dropped until authentication succeeds or the
1111 expires for a connection.
1112 The default is 10:30:100.
1114 Alternatively, random early drop can be enabled by specifying
1115 the three colon separated values
1116 start:rate:full (e.g. "10:30:60").
1118 will refuse connection attempts with a probability of rate/100 (30%)
1119 if there are currently start (10) unauthenticated connections.
1120 The probability increases linearly and all connection attempts
1121 are refused if the number of unauthenticated connections reaches full (60).
1122 .It Cm PasswordAuthentication
1123 Specifies whether password authentication is allowed.
1128 .It Cm PermitEmptyPasswords
1129 When password authentication is allowed, it specifies whether the
1130 server allows login to accounts with empty password strings.
1134 Specifies the destinations to which TCP port forwarding is permitted.
1135 The forwarding specification must be one of the following forms:
1137 .Bl -item -offset indent -compact
1146 .Ar IPv4_addr : port
1151 .Ar \&[ IPv6_addr \&] : port
1155 Multiple forwards may be specified by separating them with whitespace.
1158 can be used to remove all restrictions and permit any forwarding requests.
1161 can be used to prohibit all forwarding requests.
1164 can be used for host or port to allow all hosts or ports, respectively.
1165 By default all port forwarding requests are permitted.
1166 .It Cm PermitRootLogin
1167 Specifies whether root can log in using
1169 The argument must be
1171 .Cm prohibit-password ,
1172 .Cm without-password ,
1173 .Cm forced-commands-only ,
1179 .Cm ChallengeResponseAuthentication
1184 this setting may be overridden by the PAM policy.
1186 If this option is set to
1187 .Cm prohibit-password
1189 .Cm without-password ,
1190 password and keyboard-interactive authentication are disabled for root.
1192 If this option is set to
1193 .Cm forced-commands-only ,
1194 root login with public key authentication will be allowed,
1197 option has been specified
1198 (which may be useful for taking remote backups even if root login is
1199 normally not allowed).
1200 All other authentication methods are disabled for root.
1202 If this option is set to
1204 root is not allowed to log in.
1208 allocation is permitted.
1214 device forwarding is allowed.
1215 The argument must be
1231 Independent of this setting, the permissions of the selected
1233 device must allow access to the user.
1234 .It Cm PermitUserEnvironment
1236 .Pa ~/.ssh/environment
1240 .Pa ~/.ssh/authorized_keys
1245 Enabling environment processing may enable users to bypass access
1246 restrictions in some configurations using mechanisms such as
1249 Specifies whether any
1255 Specifies the file that contains the process ID of the
1260 .Pa /var/run/sshd.pid .
1262 Specifies the port number that
1266 Multiple options of this type are permitted.
1272 should print the date and time of the last user login when a user logs
1281 when a user logs in interactively.
1282 (On some systems it is also printed by the shell,
1287 .It Cm PubkeyAcceptedKeyTypes
1288 Specifies the key types that will be accepted for public key authentication
1289 as a comma-separated pattern list.
1290 Alternately if the specified value begins with a
1292 character, then the specified key types will be appended to the default set
1293 instead of replacing them.
1294 The default for this option is:
1295 .Bd -literal -offset 3n
1296 ecdsa-sha2-nistp256-cert-v01@openssh.com,
1297 ecdsa-sha2-nistp384-cert-v01@openssh.com,
1298 ecdsa-sha2-nistp521-cert-v01@openssh.com,
1299 ssh-ed25519-cert-v01@openssh.com,
1300 ssh-rsa-cert-v01@openssh.com,
1301 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1305 The list of available key types may also be obtained using
1307 .It Cm PubkeyAuthentication
1308 Specifies whether public key authentication is allowed.
1312 Specifies the maximum amount of data that may be transmitted before the
1313 session key is renegotiated, optionally followed a maximum amount of
1314 time that may pass before the session key is renegotiated.
1315 The first argument is specified in bytes and may have a suffix of
1320 to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1321 The default is between
1325 depending on the cipher.
1326 The optional second value is specified in seconds and may use any of the
1327 units documented in the
1330 The default value for
1334 which means that rekeying is performed after the cipher's default amount
1335 of data has been sent or received and no time based rekeying is done.
1337 Specifies revoked public keys file, or
1340 Keys listed in this file will be refused for public key authentication.
1341 Note that if this file is not readable, then public key authentication will
1342 be refused for all users.
1343 Keys may be specified as a text file, listing one public key per line, or as
1344 an OpenSSH Key Revocation List (KRL) as generated by
1346 For more information on KRLs, see the KEY REVOCATION LISTS section in
1348 .It Cm StreamLocalBindMask
1349 Sets the octal file creation mode mask
1351 used when creating a Unix-domain socket file for local or remote
1353 This option is only used for port forwarding to a Unix-domain socket file.
1355 The default value is 0177, which creates a Unix-domain socket file that is
1356 readable and writable only by the owner.
1357 Note that not all operating systems honor the file mode on Unix-domain
1359 .It Cm StreamLocalBindUnlink
1360 Specifies whether to remove an existing Unix-domain socket file for local
1361 or remote port forwarding before creating a new one.
1362 If the socket file already exists and
1363 .Cm StreamLocalBindUnlink
1366 will be unable to forward the port to the Unix-domain socket file.
1367 This option is only used for port forwarding to a Unix-domain socket file.
1369 The argument must be
1378 should check file modes and ownership of the
1379 user's files and home directory before accepting login.
1380 This is normally desirable because novices sometimes accidentally leave their
1381 directory or files world-writable.
1384 Note that this does not apply to
1385 .Cm ChrootDirectory ,
1386 whose permissions and ownership are checked unconditionally.
1388 Configures an external subsystem (e.g. file transfer daemon).
1389 Arguments should be a subsystem name and a command (with optional arguments)
1390 to execute upon subsystem request.
1394 implements the SFTP file transfer subsystem.
1396 Alternately the name
1398 implements an in-process SFTP server.
1399 This may simplify configurations using
1401 to force a different filesystem root on clients.
1403 By default no subsystems are defined.
1404 .It Cm SyslogFacility
1405 Gives the facility code that is used when logging messages from
1407 The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1408 LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1409 The default is AUTH.
1411 Specifies whether the system should send TCP keepalive messages to the
1413 If they are sent, death of the connection or crash of one
1414 of the machines will be properly noticed.
1415 However, this means that
1416 connections will die if the route is down temporarily, and some people
1418 On the other hand, if TCP keepalives are not sent,
1419 sessions may hang indefinitely on the server, leaving
1421 users and consuming server resources.
1425 (to send TCP keepalive messages), and the server will notice
1426 if the network goes down or the client host crashes.
1427 This avoids infinitely hanging sessions.
1429 To disable TCP keepalive messages, the value should be set to
1431 .It Cm TrustedUserCAKeys
1432 Specifies a file containing public keys of certificate authorities that are
1433 trusted to sign user certificates for authentication, or
1436 Keys are listed one per line; empty lines and comments starting with
1439 If a certificate is presented for authentication and has its signing CA key
1440 listed in this file, then it may be used for authentication for any user
1441 listed in the certificate's principals list.
1442 Note that certificates that lack a list of principals will not be permitted
1443 for authentication using
1444 .Cm TrustedUserCAKeys .
1445 For more details on certificates, see the CERTIFICATES section in
1450 attempts to send authentication success and failure messages
1459 should look up the remote host name, and to check that
1460 the resolved host name for the remote IP address maps back to the
1461 very same IP address.
1463 If this option is set to
1465 then only addresses and not host names may be used in
1466 .Pa ~/.ssh/authorized_keys
1476 Enables the Pluggable Authentication Module interface.
1479 this will enable PAM authentication using
1480 .Cm ChallengeResponseAuthentication
1482 .Cm PasswordAuthentication
1483 in addition to PAM account and session module processing for all
1484 authentication types.
1486 Because PAM challenge-response authentication usually serves an equivalent
1487 role to password authentication, you should disable either
1488 .Cm PasswordAuthentication
1490 .Cm ChallengeResponseAuthentication.
1494 is enabled, you will not be able to run
1499 .It Cm UsePrivilegeSeparation
1502 separates privileges by creating an unprivileged child process
1503 to deal with incoming network traffic.
1504 After successful authentication, another process will be created that has
1505 the privilege of the authenticated user.
1506 The goal of privilege separation is to prevent privilege
1507 escalation by containing any corruption within the unprivileged processes.
1508 The argument must be
1514 .Cm UsePrivilegeSeparation
1517 then the pre-authentication unprivileged process is subject to additional
1521 .It Cm VersionAddendum
1522 Optionally specifies additional text to append to the SSH protocol banner
1523 sent by the server upon connection.
1525 .Qq FreeBSD-20170305 .
1528 may be used to disable this.
1529 .It Cm X11DisplayOffset
1530 Specifies the first display number available for
1533 This prevents sshd from interfering with real X11 servers.
1535 .It Cm X11Forwarding
1536 Specifies whether X11 forwarding is permitted.
1537 The argument must be
1544 When X11 forwarding is enabled, there may be additional exposure to
1545 the server and to client displays if the
1547 proxy display is configured to listen on the wildcard address (see
1548 .Cm X11UseLocalhost ) ,
1549 though this is not the default.
1550 Additionally, the authentication spoofing and authentication data
1551 verification and substitution occur on the client side.
1552 The security risk of using X11 forwarding is that the client's X11
1553 display server may be exposed to attack when the SSH client requests
1554 forwarding (see the warnings for
1557 .Xr ssh_config 5 ) .
1558 A system administrator may have a stance in which they want to
1559 protect clients that may expose themselves to attack by unwittingly
1560 requesting X11 forwarding, which can warrant a
1564 Note that disabling X11 forwarding does not prevent users from
1565 forwarding X11 traffic, as users can always install their own forwarders.
1566 .It Cm X11UseLocalhost
1569 should bind the X11 forwarding server to the loopback address or to
1570 the wildcard address.
1572 sshd binds the forwarding server to the loopback address and sets the
1573 hostname part of the
1575 environment variable to
1577 This prevents remote hosts from connecting to the proxy display.
1578 However, some older X11 clients may not function with this
1583 to specify that the forwarding server should be bound to the wildcard
1585 The argument must be
1591 .It Cm XAuthLocation
1592 Specifies the full pathname of the
1598 .Pa /usr/local/bin/xauth .
1602 command-line arguments and configuration file options that specify time
1603 may be expressed using a sequence of the form:
1605 .Ar time Op Ar qualifier ,
1609 is a positive integer value and
1611 is one of the following:
1613 .Bl -tag -width Ds -compact -offset indent
1628 Each member of the sequence is added together to calculate
1629 the total time value.
1631 Time format examples:
1633 .Bl -tag -width Ds -compact -offset indent
1635 600 seconds (10 minutes)
1639 1 hour 30 minutes (90 minutes)
1642 Arguments to some keywords can make use of tokens,
1643 which are expanded at runtime:
1645 .Bl -tag -width XXXX -offset indent -compact
1650 The fingerprint of the CA key.
1652 The fingerprint of the key or certificate.
1654 The home directory of the user.
1656 The key ID in the certificate.
1658 The base64-encoded CA key.
1660 The base64-encoded key or certificate for authentication.
1662 The serial number of the certificate.
1664 The type of the CA key.
1666 The key or certificate type.
1671 .Cm AuthorizedKeysCommand
1672 accepts the tokens %%, %f, %h, %t, and %u.
1674 .Cm AuthorizedKeysFile
1675 accepts the tokens %%, %h, and %u.
1677 .Cm AuthorizedPrincipalsCommand
1678 accepts the tokens %%, %F, %f, %K, %k, %h, %i, %s, %T, %t, and %u.
1680 .Cm AuthorizedPrincipalsFile
1681 accepts the tokens %%, %h, and %u.
1684 accepts the tokens %%, %h, and %u.
1687 .It Pa /etc/ssh/sshd_config
1688 Contains configuration data for
1690 This file should be writable by root only, but it is recommended
1691 (though not necessary) that it be world-readable.
1698 OpenSSH is a derivative of the original and free
1699 ssh 1.2.12 release by
1701 .An Aaron Campbell , Bob Beck , Markus Friedl , Niels Provos ,
1705 removed many bugs, re-added newer features and
1708 contributed the support for SSH protocol versions 1.5 and 2.0.
1712 contributed support for privilege separation.