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.243 2017/03/14 07:19:07 djm Exp $
38 .Dd $Mdocdate: March 14 2017 $
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.
441 If the specified value begins with a
443 character, then the specified ciphers (including wildcards) will be removed
444 from the default set instead of replacing them.
446 The supported ciphers are:
448 .Bl -item -compact -offset indent
464 aes128-gcm@openssh.com
466 aes256-gcm@openssh.com
478 chacha20-poly1305@openssh.com
482 .Bd -literal -offset indent
483 chacha20-poly1305@openssh.com,
484 aes128-ctr,aes192-ctr,aes256-ctr,
485 aes128-gcm@openssh.com,aes256-gcm@openssh.com,
486 aes128-cbc,aes192-cbc,aes256-cbc
489 The list of available ciphers may also be obtained using
491 .It Cm ClientAliveCountMax
492 Sets the number of client alive messages which may be sent without
494 receiving any messages back from the client.
495 If this threshold is reached while client alive messages are being sent,
496 sshd will disconnect the client, terminating the session.
497 It is important to note that the use of client alive messages is very
500 The client alive messages are sent through the encrypted channel
501 and therefore will not be spoofable.
502 The TCP keepalive option enabled by
505 The client alive mechanism is valuable when the client or
506 server depend on knowing when a connection has become inactive.
508 The default value is 3.
510 .Cm ClientAliveInterval
512 .Cm ClientAliveCountMax
513 is left at the default, unresponsive SSH clients
514 will be disconnected after approximately 45 seconds.
515 .It Cm ClientAliveInterval
516 Sets a timeout interval in seconds after which if no data has been received
519 will send a message through the encrypted
520 channel to request a response from the client.
522 is 0, indicating that these messages will not be sent to the client.
524 Specifies whether compression is enabled after
525 the user has authenticated successfully.
529 (a legacy synonym for
536 This keyword can be followed by a list of group name patterns, separated
538 Login is disallowed for users whose primary group or supplementary
539 group list matches one of the patterns.
540 Only group names are valid; a numerical group ID is not recognized.
541 By default, login is allowed for all groups.
542 The allow/deny directives are processed in the following order:
551 for more information on patterns.
553 This keyword can be followed by a list of user name patterns, separated
555 Login is disallowed for user names that match one of the patterns.
556 Only user names are valid; a numerical user ID is not recognized.
557 By default, login is allowed for all users.
558 If the pattern takes the form USER@HOST then USER and HOST
559 are separately checked, restricting logins to particular
560 users from particular hosts.
561 HOST criteria may additionally contain addresses to match in CIDR
562 address/masklen format.
563 The allow/deny directives are processed in the following order:
572 for more information on patterns.
573 .It Cm DisableForwarding
574 Disables all forwarding features, including X11,
577 This option overrides all other forwarding-related options and may
578 simplify restricted configurations.
579 .It Cm FingerprintHash
580 Specifies the hash algorithm used when logging key fingerprints.
588 Forces the execution of the command specified by
590 ignoring any command supplied by the client and
593 The command is invoked by using the user's login shell with the -c option.
594 This applies to shell, command, or subsystem execution.
595 It is most useful inside a
598 The command originally supplied by the client is available in the
599 .Ev SSH_ORIGINAL_COMMAND
600 environment variable.
601 Specifying a command of
603 will force the use of an in-process SFTP server that requires no support
605 .Cm ChrootDirectory .
609 Specifies whether remote hosts are allowed to connect to ports
610 forwarded for the client.
613 binds remote port forwardings to the loopback address.
614 This prevents other remote hosts from connecting to forwarded ports.
616 can be used to specify that sshd
617 should allow remote port forwardings to bind to non-loopback addresses, thus
618 allowing other hosts to connect.
621 to force remote port forwardings to be available to the local host only,
623 to force remote port forwardings to bind to the wildcard address, or
625 to allow the client to select the address to which the forwarding is bound.
628 .It Cm GSSAPIAuthentication
629 Specifies whether user authentication based on GSSAPI is allowed.
632 .It Cm GSSAPICleanupCredentials
633 Specifies whether to automatically destroy the user's credentials cache
637 .It Cm GSSAPIStrictAcceptorCheck
638 Determines whether to be strict about the identity of the GSSAPI acceptor
639 a client authenticates against.
642 then the client must authenticate against the host
643 service on the current hostname.
646 then the client may authenticate against any service key stored in the
647 machine's default store.
648 This facility is provided to assist with operation on multi homed machines.
651 .It Cm HostbasedAcceptedKeyTypes
652 Specifies the key types that will be accepted for hostbased authentication
653 as a comma-separated pattern list.
654 Alternately if the specified value begins with a
656 character, then the specified key types will be appended to the default set
657 instead of replacing them.
658 If the specified value begins with a
660 character, then the specified key types (including wildcards) will be removed
661 from the default set instead of replacing them.
662 The default for this option is:
663 .Bd -literal -offset 3n
664 ecdsa-sha2-nistp256-cert-v01@openssh.com,
665 ecdsa-sha2-nistp384-cert-v01@openssh.com,
666 ecdsa-sha2-nistp521-cert-v01@openssh.com,
667 ssh-ed25519-cert-v01@openssh.com,
668 ssh-rsa-cert-v01@openssh.com,
669 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
673 The list of available key types may also be obtained using
675 .It Cm HostbasedAuthentication
676 Specifies whether rhosts or /etc/hosts.equiv authentication together
677 with successful public key client host authentication is allowed
678 (host-based authentication).
681 .It Cm HostbasedUsesNameFromPacketOnly
682 Specifies whether or not the server will attempt to perform a reverse
683 name lookup when matching the name in the
689 .Cm HostbasedAuthentication .
694 uses the name supplied by the client rather than
695 attempting to resolve the name from the TCP connection itself.
698 .It Cm HostCertificate
699 Specifies a file containing a public host certificate.
700 The certificate's public key must match a private host key already specified
703 The default behaviour of
705 is not to load any certificates.
707 Specifies a file containing a private host key
710 .Pa /etc/ssh/ssh_host_dsa_key ,
711 .Pa /etc/ssh/ssh_host_ecdsa_key ,
712 .Pa /etc/ssh/ssh_host_ed25519_key
714 .Pa /etc/ssh/ssh_host_rsa_key .
718 will refuse to use a file if it is group/world-accessible
720 .Cm HostKeyAlgorithms
721 option restricts which of the keys are actually used by
724 It is possible to have multiple host key files.
725 It is also possible to specify public host key files instead.
726 In this case operations on the private key will be delegated
730 Identifies the UNIX-domain socket used to communicate
731 with an agent that has access to the private host keys.
734 is specified, the location of the socket will be read from the
736 environment variable.
737 .It Cm HostKeyAlgorithms
738 Specifies the host key algorithms
739 that the server offers.
740 The default for this option is:
741 .Bd -literal -offset 3n
742 ecdsa-sha2-nistp256-cert-v01@openssh.com,
743 ecdsa-sha2-nistp384-cert-v01@openssh.com,
744 ecdsa-sha2-nistp521-cert-v01@openssh.com,
745 ssh-ed25519-cert-v01@openssh.com,
746 ssh-rsa-cert-v01@openssh.com,
747 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
751 The list of available key types may also be obtained using
758 files will not be used in
759 .Cm HostbasedAuthentication .
763 .Pa /etc/ssh/shosts.equiv
767 .It Cm IgnoreUserKnownHosts
770 should ignore the user's
771 .Pa ~/.ssh/known_hosts
773 .Cm HostbasedAuthentication .
777 Specifies the IPv4 type-of-service or DSCP class for the connection.
804 This option may take one or two arguments, separated by whitespace.
805 If one argument is specified, it is used as the packet class unconditionally.
806 If two values are specified, the first is automatically selected for
807 interactive sessions and the second for non-interactive sessions.
810 for interactive sessions and
812 for non-interactive sessions.
813 .It Cm KbdInteractiveAuthentication
814 Specifies whether to allow keyboard-interactive authentication.
815 The argument to this keyword must be
819 The default is to use whatever value
820 .Cm ChallengeResponseAuthentication
824 .It Cm KerberosAuthentication
825 Specifies whether the password provided by the user for
826 .Cm PasswordAuthentication
827 will be validated through the Kerberos KDC.
828 To use this option, the server needs a
829 Kerberos servtab which allows the verification of the KDC's identity.
832 .It Cm KerberosGetAFSToken
833 If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
834 an AFS token before accessing the user's home directory.
837 .It Cm KerberosOrLocalPasswd
838 If password authentication through Kerberos fails then
839 the password will be validated via any additional local mechanism
844 .It Cm KerberosTicketCleanup
845 Specifies whether to automatically destroy the user's ticket cache
850 Specifies the available KEX (Key Exchange) algorithms.
851 Multiple algorithms must be comma-separated.
852 Alternately if the specified value begins with a
854 character, then the specified methods will be appended to the default set
855 instead of replacing them.
856 If the specified value begins with a
858 character, then the specified methods (including wildcards) will be removed
859 from the default set instead of replacing them.
860 The supported algorithms are:
862 .Bl -item -compact -offset indent
866 curve25519-sha256@libssh.org
868 diffie-hellman-group1-sha1
870 diffie-hellman-group14-sha1
872 diffie-hellman-group-exchange-sha1
874 diffie-hellman-group-exchange-sha256
884 .Bd -literal -offset indent
885 curve25519-sha256,curve25519-sha256@libssh.org,
886 ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
887 diffie-hellman-group-exchange-sha256,
888 diffie-hellman-group14-sha1
891 The list of available key exchange algorithms may also be obtained using
894 Specifies the local addresses
897 The following forms may be used:
899 .Bl -item -offset indent -compact
903 .Ar host | Ar IPv4_addr | Ar IPv6_addr
908 .Ar host | Ar IPv4_addr : Ar port
914 .Ar host | Ar IPv6_addr Oc : Ar port
921 sshd will listen on the address and all
924 The default is to listen on all local addresses.
927 options are permitted.
928 .It Cm LoginGraceTime
929 The server disconnects after this time if the user has not
930 successfully logged in.
931 If the value is 0, there is no time limit.
932 The default is 120 seconds.
934 Gives the verbosity level that is used when logging messages from
936 The possible values are:
937 QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
939 DEBUG and DEBUG1 are equivalent.
940 DEBUG2 and DEBUG3 each specify higher levels of debugging output.
941 Logging with a DEBUG level violates the privacy of users and is not recommended.
943 Specifies the available MAC (message authentication code) algorithms.
944 The MAC algorithm is used for data integrity protection.
945 Multiple algorithms must be comma-separated.
946 If the specified value begins with a
948 character, then the specified algorithms will be appended to the default set
949 instead of replacing them.
950 If the specified value begins with a
952 character, then the specified algorithms (including wildcards) will be removed
953 from the default set instead of replacing them.
955 The algorithms that contain
957 calculate the MAC after encryption (encrypt-then-mac).
958 These are considered safer and their use recommended.
959 The supported MACs are:
961 .Bl -item -compact -offset indent
981 hmac-md5-etm@openssh.com
983 hmac-md5-96-etm@openssh.com
985 hmac-ripemd160-etm@openssh.com
987 hmac-sha1-etm@openssh.com
989 hmac-sha1-96-etm@openssh.com
991 hmac-sha2-256-etm@openssh.com
993 hmac-sha2-512-etm@openssh.com
995 umac-64-etm@openssh.com
997 umac-128-etm@openssh.com
1001 .Bd -literal -offset indent
1002 umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1003 hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
1004 hmac-sha1-etm@openssh.com,
1005 umac-64@openssh.com,umac-128@openssh.com,
1006 hmac-sha2-256,hmac-sha2-512,hmac-sha1
1009 The list of available MAC algorithms may also be obtained using
1012 Introduces a conditional block.
1013 If all of the criteria on the
1015 line are satisfied, the keywords on the following lines override those
1016 set in the global section of the config file, until either another
1018 line or the end of the file.
1019 If a keyword appears in multiple
1021 blocks that are satisfied, only the first instance of the keyword is
1026 are one or more criteria-pattern pairs or the single token
1028 which matches all criteria.
1029 The available criteria are
1037 The match patterns may consist of single entries or comma-separated
1038 lists and may use the wildcard and negation operators described in the
1045 criteria may additionally contain addresses to match in CIDR
1046 address/masklen format,
1047 such as 192.0.2.0/24 or 2001:db8::/32.
1048 Note that the mask length provided must be consistent with the address -
1049 it is an error to specify a mask length that is too long for the address
1050 or one with bits set in this host portion of the address.
1051 For example, 192.0.2.0/33 and 192.0.2.0/8, respectively.
1053 Only a subset of keywords may be used on the lines following a
1056 Available keywords are
1058 .Cm AllowAgentForwarding ,
1060 .Cm AllowStreamLocalForwarding ,
1061 .Cm AllowTcpForwarding ,
1063 .Cm AuthenticationMethods ,
1064 .Cm AuthorizedKeysCommand ,
1065 .Cm AuthorizedKeysCommandUser ,
1066 .Cm AuthorizedKeysFile ,
1067 .Cm AuthorizedPrincipalsCommand ,
1068 .Cm AuthorizedPrincipalsCommandUser ,
1069 .Cm AuthorizedPrincipalsFile ,
1071 .Cm ChrootDirectory ,
1072 .Cm ClientAliveCountMax ,
1073 .Cm ClientAliveInterval ,
1078 .Cm GSSAPIAuthentication ,
1079 .Cm HostbasedAcceptedKeyTypes ,
1080 .Cm HostbasedAuthentication ,
1081 .Cm HostbasedUsesNameFromPacketOnly ,
1083 .Cm KbdInteractiveAuthentication ,
1084 .Cm KerberosAuthentication ,
1087 .Cm PasswordAuthentication ,
1088 .Cm PermitEmptyPasswords ,
1090 .Cm PermitRootLogin ,
1094 .Cm PubkeyAcceptedKeyTypes ,
1095 .Cm PubkeyAuthentication ,
1098 .Cm StreamLocalBindMask ,
1099 .Cm StreamLocalBindUnlink ,
1100 .Cm TrustedUserCAKeys ,
1101 .Cm X11DisplayOffset ,
1104 .Cm X11UseLocalHost .
1106 Specifies the maximum number of authentication attempts permitted per
1108 Once the number of failures reaches half this value,
1109 additional failures are logged.
1112 Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1113 sessions permitted per network connection.
1114 Multiple sessions may be established by clients that support connection
1118 to 1 will effectively disable session multiplexing, whereas setting it to 0
1119 will prevent all shell, login and subsystem sessions while still permitting
1123 Specifies the maximum number of concurrent unauthenticated connections to the
1125 Additional connections will be dropped until authentication succeeds or the
1127 expires for a connection.
1128 The default is 10:30:100.
1130 Alternatively, random early drop can be enabled by specifying
1131 the three colon separated values
1132 start:rate:full (e.g. "10:30:60").
1134 will refuse connection attempts with a probability of rate/100 (30%)
1135 if there are currently start (10) unauthenticated connections.
1136 The probability increases linearly and all connection attempts
1137 are refused if the number of unauthenticated connections reaches full (60).
1138 .It Cm PasswordAuthentication
1139 Specifies whether password authentication is allowed.
1144 .It Cm PermitEmptyPasswords
1145 When password authentication is allowed, it specifies whether the
1146 server allows login to accounts with empty password strings.
1150 Specifies the destinations to which TCP port forwarding is permitted.
1151 The forwarding specification must be one of the following forms:
1153 .Bl -item -offset indent -compact
1162 .Ar IPv4_addr : port
1167 .Ar \&[ IPv6_addr \&] : port
1171 Multiple forwards may be specified by separating them with whitespace.
1174 can be used to remove all restrictions and permit any forwarding requests.
1177 can be used to prohibit all forwarding requests.
1180 can be used for host or port to allow all hosts or ports, respectively.
1181 By default all port forwarding requests are permitted.
1182 .It Cm PermitRootLogin
1183 Specifies whether root can log in using
1185 The argument must be
1187 .Cm prohibit-password ,
1188 .Cm without-password ,
1189 .Cm forced-commands-only ,
1195 .Cm ChallengeResponseAuthentication
1200 this setting may be overridden by the PAM policy.
1202 If this option is set to
1203 .Cm prohibit-password
1205 .Cm without-password ,
1206 password and keyboard-interactive authentication are disabled for root.
1208 If this option is set to
1209 .Cm forced-commands-only ,
1210 root login with public key authentication will be allowed,
1213 option has been specified
1214 (which may be useful for taking remote backups even if root login is
1215 normally not allowed).
1216 All other authentication methods are disabled for root.
1218 If this option is set to
1220 root is not allowed to log in.
1224 allocation is permitted.
1230 device forwarding is allowed.
1231 The argument must be
1247 Independent of this setting, the permissions of the selected
1249 device must allow access to the user.
1250 .It Cm PermitUserEnvironment
1252 .Pa ~/.ssh/environment
1256 .Pa ~/.ssh/authorized_keys
1261 Enabling environment processing may enable users to bypass access
1262 restrictions in some configurations using mechanisms such as
1265 Specifies whether any
1271 Specifies the file that contains the process ID of the
1276 .Pa /var/run/sshd.pid .
1278 Specifies the port number that
1282 Multiple options of this type are permitted.
1288 should print the date and time of the last user login when a user logs
1297 when a user logs in interactively.
1298 (On some systems it is also printed by the shell,
1303 .It Cm PubkeyAcceptedKeyTypes
1304 Specifies the key types that will be accepted for public key authentication
1305 as a comma-separated pattern list.
1306 Alternately if the specified value begins with a
1308 character, then the specified key types will be appended to the default set
1309 instead of replacing them.
1310 If the specified value begins with a
1312 character, then the specified key types (including wildcards) will be removed
1313 from the default set instead of replacing them.
1314 The default for this option is:
1315 .Bd -literal -offset 3n
1316 ecdsa-sha2-nistp256-cert-v01@openssh.com,
1317 ecdsa-sha2-nistp384-cert-v01@openssh.com,
1318 ecdsa-sha2-nistp521-cert-v01@openssh.com,
1319 ssh-ed25519-cert-v01@openssh.com,
1320 ssh-rsa-cert-v01@openssh.com,
1321 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1325 The list of available key types may also be obtained using
1327 .It Cm PubkeyAuthentication
1328 Specifies whether public key authentication is allowed.
1332 Specifies the maximum amount of data that may be transmitted before the
1333 session key is renegotiated, optionally followed a maximum amount of
1334 time that may pass before the session key is renegotiated.
1335 The first argument is specified in bytes and may have a suffix of
1340 to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1341 The default is between
1345 depending on the cipher.
1346 The optional second value is specified in seconds and may use any of the
1347 units documented in the
1350 The default value for
1354 which means that rekeying is performed after the cipher's default amount
1355 of data has been sent or received and no time based rekeying is done.
1357 Specifies revoked public keys file, or
1360 Keys listed in this file will be refused for public key authentication.
1361 Note that if this file is not readable, then public key authentication will
1362 be refused for all users.
1363 Keys may be specified as a text file, listing one public key per line, or as
1364 an OpenSSH Key Revocation List (KRL) as generated by
1366 For more information on KRLs, see the KEY REVOCATION LISTS section in
1368 .It Cm StreamLocalBindMask
1369 Sets the octal file creation mode mask
1371 used when creating a Unix-domain socket file for local or remote
1373 This option is only used for port forwarding to a Unix-domain socket file.
1375 The default value is 0177, which creates a Unix-domain socket file that is
1376 readable and writable only by the owner.
1377 Note that not all operating systems honor the file mode on Unix-domain
1379 .It Cm StreamLocalBindUnlink
1380 Specifies whether to remove an existing Unix-domain socket file for local
1381 or remote port forwarding before creating a new one.
1382 If the socket file already exists and
1383 .Cm StreamLocalBindUnlink
1386 will be unable to forward the port to the Unix-domain socket file.
1387 This option is only used for port forwarding to a Unix-domain socket file.
1389 The argument must be
1398 should check file modes and ownership of the
1399 user's files and home directory before accepting login.
1400 This is normally desirable because novices sometimes accidentally leave their
1401 directory or files world-writable.
1404 Note that this does not apply to
1405 .Cm ChrootDirectory ,
1406 whose permissions and ownership are checked unconditionally.
1408 Configures an external subsystem (e.g. file transfer daemon).
1409 Arguments should be a subsystem name and a command (with optional arguments)
1410 to execute upon subsystem request.
1414 implements the SFTP file transfer subsystem.
1416 Alternately the name
1418 implements an in-process SFTP server.
1419 This may simplify configurations using
1421 to force a different filesystem root on clients.
1423 By default no subsystems are defined.
1424 .It Cm SyslogFacility
1425 Gives the facility code that is used when logging messages from
1427 The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1428 LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1429 The default is AUTH.
1431 Specifies whether the system should send TCP keepalive messages to the
1433 If they are sent, death of the connection or crash of one
1434 of the machines will be properly noticed.
1435 However, this means that
1436 connections will die if the route is down temporarily, and some people
1438 On the other hand, if TCP keepalives are not sent,
1439 sessions may hang indefinitely on the server, leaving
1441 users and consuming server resources.
1445 (to send TCP keepalive messages), and the server will notice
1446 if the network goes down or the client host crashes.
1447 This avoids infinitely hanging sessions.
1449 To disable TCP keepalive messages, the value should be set to
1451 .It Cm TrustedUserCAKeys
1452 Specifies a file containing public keys of certificate authorities that are
1453 trusted to sign user certificates for authentication, or
1456 Keys are listed one per line; empty lines and comments starting with
1459 If a certificate is presented for authentication and has its signing CA key
1460 listed in this file, then it may be used for authentication for any user
1461 listed in the certificate's principals list.
1462 Note that certificates that lack a list of principals will not be permitted
1463 for authentication using
1464 .Cm TrustedUserCAKeys .
1465 For more details on certificates, see the CERTIFICATES section in
1470 attempts to send authentication success and failure messages
1479 should look up the remote host name, and to check that
1480 the resolved host name for the remote IP address maps back to the
1481 very same IP address.
1483 If this option is set to
1485 then only addresses and not host names may be used in
1486 .Pa ~/.ssh/authorized_keys
1496 Enables the Pluggable Authentication Module interface.
1499 this will enable PAM authentication using
1500 .Cm ChallengeResponseAuthentication
1502 .Cm PasswordAuthentication
1503 in addition to PAM account and session module processing for all
1504 authentication types.
1506 Because PAM challenge-response authentication usually serves an equivalent
1507 role to password authentication, you should disable either
1508 .Cm PasswordAuthentication
1510 .Cm ChallengeResponseAuthentication.
1514 is enabled, you will not be able to run
1519 .It Cm VersionAddendum
1520 Optionally specifies additional text to append to the SSH protocol banner
1521 sent by the server upon connection.
1523 .Qq FreeBSD-20170804 .
1526 may be used to disable this.
1527 .It Cm X11DisplayOffset
1528 Specifies the first display number available for
1531 This prevents sshd from interfering with real X11 servers.
1533 .It Cm X11Forwarding
1534 Specifies whether X11 forwarding is permitted.
1535 The argument must be
1542 When X11 forwarding is enabled, there may be additional exposure to
1543 the server and to client displays if the
1545 proxy display is configured to listen on the wildcard address (see
1546 .Cm X11UseLocalhost ) ,
1547 though this is not the default.
1548 Additionally, the authentication spoofing and authentication data
1549 verification and substitution occur on the client side.
1550 The security risk of using X11 forwarding is that the client's X11
1551 display server may be exposed to attack when the SSH client requests
1552 forwarding (see the warnings for
1555 .Xr ssh_config 5 ) .
1556 A system administrator may have a stance in which they want to
1557 protect clients that may expose themselves to attack by unwittingly
1558 requesting X11 forwarding, which can warrant a
1562 Note that disabling X11 forwarding does not prevent users from
1563 forwarding X11 traffic, as users can always install their own forwarders.
1564 .It Cm X11UseLocalhost
1567 should bind the X11 forwarding server to the loopback address or to
1568 the wildcard address.
1570 sshd binds the forwarding server to the loopback address and sets the
1571 hostname part of the
1573 environment variable to
1575 This prevents remote hosts from connecting to the proxy display.
1576 However, some older X11 clients may not function with this
1581 to specify that the forwarding server should be bound to the wildcard
1583 The argument must be
1589 .It Cm XAuthLocation
1590 Specifies the full pathname of the
1596 .Pa /usr/local/bin/xauth .
1600 command-line arguments and configuration file options that specify time
1601 may be expressed using a sequence of the form:
1603 .Ar time Op Ar qualifier ,
1607 is a positive integer value and
1609 is one of the following:
1611 .Bl -tag -width Ds -compact -offset indent
1626 Each member of the sequence is added together to calculate
1627 the total time value.
1629 Time format examples:
1631 .Bl -tag -width Ds -compact -offset indent
1633 600 seconds (10 minutes)
1637 1 hour 30 minutes (90 minutes)
1640 Arguments to some keywords can make use of tokens,
1641 which are expanded at runtime:
1643 .Bl -tag -width XXXX -offset indent -compact
1648 The fingerprint of the CA key.
1650 The fingerprint of the key or certificate.
1652 The home directory of the user.
1654 The key ID in the certificate.
1656 The base64-encoded CA key.
1658 The base64-encoded key or certificate for authentication.
1660 The serial number of the certificate.
1662 The type of the CA key.
1664 The key or certificate type.
1669 .Cm AuthorizedKeysCommand
1670 accepts the tokens %%, %f, %h, %k, %t, and %u.
1672 .Cm AuthorizedKeysFile
1673 accepts the tokens %%, %h, and %u.
1675 .Cm AuthorizedPrincipalsCommand
1676 accepts the tokens %%, %F, %f, %h, %i, %K, %k, %s, %T, %t, and %u.
1678 .Cm AuthorizedPrincipalsFile
1679 accepts the tokens %%, %h, and %u.
1682 accepts the tokens %%, %h, and %u.
1685 .It Pa /etc/ssh/sshd_config
1686 Contains configuration data for
1688 This file should be writable by root only, but it is recommended
1689 (though not necessary) that it be world-readable.
1696 OpenSSH is a derivative of the original and free
1697 ssh 1.2.12 release by
1699 .An Aaron Campbell , Bob Beck , Markus Friedl , Niels Provos ,
1703 removed many bugs, re-added newer features and
1706 contributed the support for SSH protocol versions 1.5 and 2.0.
1710 contributed support for privilege separation.