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.220 2016/02/17 08:57:34 djm Exp $
38 .Dd $Mdocdate: February 17 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
101 .It Cm AllowAgentForwarding
104 forwarding is permitted.
107 Note that disabling agent forwarding does not improve security
108 unless users are also denied shell access, as they can always install
109 their own forwarders.
111 This keyword can be followed by a list of group name patterns, separated
113 If specified, login is allowed only for users whose primary
114 group or supplementary group list matches one of the patterns.
115 Only group names are valid; a numerical group ID is not recognized.
116 By default, login is allowed for all groups.
117 The allow/deny directives are processed in the following order:
126 for more information on patterns.
127 .It Cm AllowTcpForwarding
128 Specifies whether TCP forwarding is permitted.
129 The available options are
133 to allow TCP forwarding,
135 to prevent all TCP forwarding,
137 to allow local (from the perspective of
141 to allow remote forwarding only.
144 Note that disabling TCP forwarding does not improve security unless
145 users are also denied shell access, as they can always install their
147 .It Cm AllowStreamLocalForwarding
148 Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
149 The available options are
153 to allow StreamLocal forwarding,
155 to prevent all StreamLocal forwarding,
157 to allow local (from the perspective of
161 to allow remote forwarding only.
164 Note that disabling StreamLocal forwarding does not improve security unless
165 users are also denied shell access, as they can always install their
168 This keyword can be followed by a list of user name patterns, separated
170 If specified, login is allowed only for user names that
171 match one of the patterns.
172 Only user names are valid; a numerical user ID is not recognized.
173 By default, login is allowed for all users.
174 If the pattern takes the form USER@HOST then USER and HOST
175 are separately checked, restricting logins to particular
176 users from particular hosts.
177 The allow/deny directives are processed in the following order:
186 for more information on patterns.
187 .It Cm AuthenticationMethods
188 Specifies the authentication methods that must be successfully completed
189 for a user to be granted access.
190 This option must be followed by one or more comma-separated lists of
191 authentication method names.
192 Successful authentication requires completion of every method in at least
195 For example, an argument of
196 .Dq publickey,password publickey,keyboard-interactive
197 would require the user to complete public key authentication, followed by
198 either password or keyboard interactive authentication.
199 Only methods that are next in one or more lists are offered at each stage,
200 so for this example, it would not be possible to attempt password or
201 keyboard-interactive authentication before public key.
203 For keyboard interactive authentication it is also possible to
204 restrict authentication to a specific device by appending a
205 colon followed by the device identifier
210 depending on the server configuration.
212 .Dq keyboard-interactive:bsdauth
213 would restrict keyboard interactive authentication to the
219 method is listed more than once,
221 verifies that keys that have been used successfully are not reused for
222 subsequent authentications.
224 .Cm AuthenticationMethods
226 .Dq publickey,publickey
227 will require successful authentication using two different public keys.
229 This option will yield a fatal
230 error if enabled if protocol 1 is also enabled.
231 Note that each authentication method listed should also be explicitly enabled
232 in the configuration.
233 The default is not to require multiple authentication; successful completion
234 of a single authentication method is sufficient.
235 .It Cm AuthorizedKeysCommand
236 Specifies a program to be used to look up the user's public keys.
237 The program must be owned by root, not writable by group or others and
238 specified by an absolute path.
241 .Cm AuthorizedKeysCommand
242 may be provided using the following tokens, which will be expanded
243 at runtime: %% is replaced by a literal '%', %u is replaced by the
244 username being authenticated, %h is replaced by the home directory
245 of the user being authenticated, %t is replaced with the key type
246 offered for authentication, %f is replaced with the fingerprint of
247 the key, and %k is replaced with the key being offered for authentication.
248 If no arguments are specified then the username of the target user
251 The program should produce on standard output zero or
252 more lines of authorized_keys output (see AUTHORIZED_KEYS in
254 If a key supplied by AuthorizedKeysCommand does not successfully authenticate
255 and authorize the user then public key authentication continues using the usual
256 .Cm AuthorizedKeysFile
258 By default, no AuthorizedKeysCommand is run.
259 .It Cm AuthorizedKeysCommandUser
260 Specifies the user under whose account the AuthorizedKeysCommand is run.
261 It is recommended to use a dedicated user that has no other role on the host
262 than running authorized keys commands.
264 .Cm AuthorizedKeysCommand
266 .Cm AuthorizedKeysCommandUser
269 will refuse to start.
270 .It Cm AuthorizedKeysFile
271 Specifies the file that contains the public keys that can be used
272 for user authentication.
273 The format is described in the
274 AUTHORIZED_KEYS FILE FORMAT
277 .Cm AuthorizedKeysFile
278 may contain tokens of the form %T which are substituted during connection
280 The following tokens are defined: %% is replaced by a literal '%',
281 %h is replaced by the home directory of the user being authenticated, and
282 %u is replaced by the username of that user.
284 .Cm AuthorizedKeysFile
285 is taken to be an absolute path or one relative to the user's home
287 Multiple files may be listed, separated by whitespace.
288 Alternately this option may be set to
290 to skip checking for user keys in files.
292 .Dq .ssh/authorized_keys .ssh/authorized_keys2 .
293 .It Cm AuthorizedPrincipalsCommand
294 Specifies a program to be used to generate the list of allowed
295 certificate principals as per
296 .Cm AuthorizedPrincipalsFile .
297 The program must be owned by root, not writable by group or others and
298 specified by an absolute path.
301 .Cm AuthorizedPrincipalsCommand
302 may be provided using the following tokens, which will be expanded
303 at runtime: %% is replaced by a literal '%', %u is replaced by the
304 username being authenticated and %h is replaced by the home directory
305 of the user being authenticated.
307 The program should produce on standard output zero or
309 .Cm AuthorizedPrincipalsFile
312 .Cm AuthorizedPrincipalsCommand
314 .Cm AuthorizedPrincipalsFile
315 is specified, then certificates offered by the client for authentication
316 must contain a principal that is listed.
317 By default, no AuthorizedPrincipalsCommand is run.
318 .It Cm AuthorizedPrincipalsCommandUser
319 Specifies the user under whose account the AuthorizedPrincipalsCommand is run.
320 It is recommended to use a dedicated user that has no other role on the host
321 than running authorized principals commands.
323 .Cm AuthorizedPrincipalsCommand
325 .Cm AuthorizedPrincipalsCommandUser
328 will refuse to start.
329 .It Cm AuthorizedPrincipalsFile
330 Specifies a file that lists principal names that are accepted for
331 certificate authentication.
332 When using certificates signed by a key listed in
333 .Cm TrustedUserCAKeys ,
334 this file lists names, one of which must appear in the certificate for it
335 to be accepted for authentication.
336 Names are listed one per line preceded by key options (as described
337 in AUTHORIZED_KEYS FILE FORMAT in
339 Empty lines and comments starting with
343 .Cm AuthorizedPrincipalsFile
344 may contain tokens of the form %T which are substituted during connection
346 The following tokens are defined: %% is replaced by a literal '%',
347 %h is replaced by the home directory of the user being authenticated, and
348 %u is replaced by the username of that user.
350 .Cm AuthorizedPrincipalsFile
351 is taken to be an absolute path or one relative to the user's home
356 i.e. not to use a principals file \(en in this case, the username
357 of the user must appear in a certificate's principals list for it to be
360 .Cm AuthorizedPrincipalsFile
361 is only used when authentication proceeds using a CA listed in
362 .Cm TrustedUserCAKeys
363 and is not consulted for certification authorities trusted via
364 .Pa ~/.ssh/authorized_keys ,
367 key option offers a similar facility (see
371 The contents of the specified file are sent to the remote user before
372 authentication is allowed.
375 then no banner is displayed.
376 By default, no banner is displayed.
377 .It Cm ChallengeResponseAuthentication
378 Specifies whether challenge-response authentication is allowed (e.g. via
379 PAM or through authentication styles supported in
383 .It Cm ChrootDirectory
384 Specifies the pathname of a directory to
386 to after authentication.
389 checks that all components of the pathname are root-owned directories
390 which are not writable by any other user or group.
393 changes the working directory to the user's home directory.
395 The pathname may contain the following tokens that are expanded at runtime once
396 the connecting user has been authenticated: %% is replaced by a literal '%',
397 %h is replaced by the home directory of the user being authenticated, and
398 %u is replaced by the username of that user.
402 must contain the necessary files and directories to support the
404 For an interactive session this requires at least a shell, typically
417 For file transfer sessions using
419 no additional configuration of the environment is necessary if the
420 in-process sftp server is used,
421 though sessions which use logging may require
423 inside the chroot directory on some operating systems (see
427 For safety, it is very important that the directory hierarchy be
428 prevented from modification by other processes on the system (especially
429 those outside the jail).
430 Misconfiguration can lead to unsafe environments which
439 Specifies the ciphers allowed.
440 Multiple ciphers must be comma-separated.
441 If the specified value begins with a
443 character, then the specified ciphers will be appended to the default set
444 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 the
495 .It Cm ClientAliveCountMax
496 Sets the number of client alive messages (see below) which may be
499 receiving any messages back from the client.
500 If this threshold is reached while client alive messages are being sent,
501 sshd will disconnect the client, terminating the session.
502 It is important to note that the use of client alive messages is very
506 The client alive messages are sent through the encrypted channel
507 and therefore will not be spoofable.
508 The TCP keepalive option enabled by
511 The client alive mechanism is valuable when the client or
512 server depend on knowing when a connection has become inactive.
514 The default value is 3.
516 .Cm ClientAliveInterval
517 (see below) is set to 15, and
518 .Cm ClientAliveCountMax
519 is left at the default, unresponsive SSH clients
520 will be disconnected after approximately 45 seconds.
521 .It Cm ClientAliveInterval
522 Sets a timeout interval in seconds after which if no data has been received
525 will send a message through the encrypted
526 channel to request a response from the client.
528 is 0, indicating that these messages will not be sent to the client.
530 Specifies whether compression is allowed, or delayed until
531 the user has authenticated successfully.
540 This keyword can be followed by a list of group name patterns, separated
542 Login is disallowed for users whose primary group or supplementary
543 group list matches one of the patterns.
544 Only group names are valid; a numerical group ID is not recognized.
545 By default, login is allowed for all groups.
546 The allow/deny directives are processed in the following order:
555 for more information on patterns.
557 This keyword can be followed by a list of user name patterns, separated
559 Login is disallowed for user names that match one of the patterns.
560 Only user names are valid; a numerical user ID is not recognized.
561 By default, login is allowed for all users.
562 If the pattern takes the form USER@HOST then USER and HOST
563 are separately checked, restricting logins to particular
564 users from particular hosts.
565 The allow/deny directives are processed in the following order:
574 for more information on patterns.
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
640 service on the current hostname.
643 then the client may authenticate against any service key stored in the
644 machine's default store.
645 This facility is provided to assist with operation on multi homed machines.
648 .It Cm HostbasedAcceptedKeyTypes
649 Specifies the key types that will be accepted for hostbased authentication
650 as a comma-separated pattern list.
651 Alternately if the specified value begins with a
653 character, then the specified key types will be appended to the default set
654 instead of replacing them.
655 The default for this option is:
656 .Bd -literal -offset 3n
657 ecdsa-sha2-nistp256-cert-v01@openssh.com,
658 ecdsa-sha2-nistp384-cert-v01@openssh.com,
659 ecdsa-sha2-nistp521-cert-v01@openssh.com,
660 ssh-ed25519-cert-v01@openssh.com,
661 ssh-rsa-cert-v01@openssh.com,
662 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
670 may be used to list supported key types.
671 .It Cm HostbasedAuthentication
672 Specifies whether rhosts or /etc/hosts.equiv authentication together
673 with successful public key client host authentication is allowed
674 (host-based authentication).
677 .It Cm HostbasedUsesNameFromPacketOnly
678 Specifies whether or not the server will attempt to perform a reverse
679 name lookup when matching the name in the
685 .Cm HostbasedAuthentication .
690 uses the name supplied by the client rather than
691 attempting to resolve the name from the TCP connection itself.
694 .It Cm HostCertificate
695 Specifies a file containing a public host certificate.
696 The certificate's public key must match a private host key already specified
699 The default behaviour of
701 is not to load any certificates.
703 Specifies a file containing a private host key
706 .Pa /etc/ssh/ssh_host_key
707 for protocol version 1, and
708 .Pa /etc/ssh/ssh_host_dsa_key ,
709 .Pa /etc/ssh/ssh_host_ecdsa_key ,
710 .Pa /etc/ssh/ssh_host_ed25519_key
712 .Pa /etc/ssh/ssh_host_rsa_key
713 for protocol version 2.
717 will refuse to use a file if it is group/world-accessible
719 .Cm HostKeyAlgorithms
720 option restricts which of the keys are actually used by
723 It is possible to have multiple host key files.
725 keys are used for version 1 and
731 are used for version 2 of the SSH protocol.
732 It is also possible to specify public host key files instead.
733 In this case operations on the private key will be delegated
737 Identifies the UNIX-domain socket used to communicate
738 with an agent that has access to the private host keys.
741 is specified, the location of the socket will be read from the
743 environment variable.
744 .It Cm HostKeyAlgorithms
745 Specifies the host key algorithms
746 that the server offers.
747 The default for this option is:
748 .Bd -literal -offset 3n
749 ecdsa-sha2-nistp256-cert-v01@openssh.com,
750 ecdsa-sha2-nistp384-cert-v01@openssh.com,
751 ecdsa-sha2-nistp521-cert-v01@openssh.com,
752 ssh-ed25519-cert-v01@openssh.com,
753 ssh-rsa-cert-v01@openssh.com,
754 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
758 The list of available key types may also be obtained using the
769 files will not be used in
770 .Cm RhostsRSAAuthentication
772 .Cm HostbasedAuthentication .
776 .Pa /etc/ssh/shosts.equiv
780 .It Cm IgnoreUserKnownHosts
783 should ignore the user's
784 .Pa ~/.ssh/known_hosts
786 .Cm RhostsRSAAuthentication
788 .Cm HostbasedAuthentication .
792 Specifies the IPv4 type-of-service or DSCP class for the connection.
819 This option may take one or two arguments, separated by whitespace.
820 If one argument is specified, it is used as the packet class unconditionally.
821 If two values are specified, the first is automatically selected for
822 interactive sessions and the second for non-interactive sessions.
825 for interactive sessions and
827 for non-interactive sessions.
828 .It Cm KbdInteractiveAuthentication
829 Specifies whether to allow keyboard-interactive authentication.
830 The argument to this keyword must be
834 The default is to use whatever value
835 .Cm ChallengeResponseAuthentication
839 .It Cm KerberosAuthentication
840 Specifies whether the password provided by the user for
841 .Cm PasswordAuthentication
842 will be validated through the Kerberos KDC.
843 To use this option, the server needs a
844 Kerberos servtab which allows the verification of the KDC's identity.
847 .It Cm KerberosGetAFSToken
848 If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
849 an AFS token before accessing the user's home directory.
852 .It Cm KerberosOrLocalPasswd
853 If password authentication through Kerberos fails then
854 the password will be validated via any additional local mechanism
859 .It Cm KerberosTicketCleanup
860 Specifies whether to automatically destroy the user's ticket cache
865 Specifies the available KEX (Key Exchange) algorithms.
866 Multiple algorithms must be comma-separated.
867 Alternately if the specified value begins with a
869 character, then the specified methods will be appended to the default set
870 instead of replacing them.
871 The supported algorithms are:
873 .Bl -item -compact -offset indent
875 curve25519-sha256@libssh.org
877 diffie-hellman-group1-sha1
879 diffie-hellman-group14-sha1
881 diffie-hellman-group-exchange-sha1
883 diffie-hellman-group-exchange-sha256
893 .Bd -literal -offset indent
894 curve25519-sha256@libssh.org,
895 ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
896 diffie-hellman-group-exchange-sha256,
897 diffie-hellman-group14-sha1
900 The list of available key exchange algorithms may also be obtained using the
906 .It Cm KeyRegenerationInterval
907 In protocol version 1, the ephemeral server key is automatically regenerated
908 after this many seconds (if it has been used).
909 The purpose of regeneration is to prevent
910 decrypting captured sessions by later breaking into the machine and
912 The key is never stored anywhere.
913 If the value is 0, the key is never regenerated.
914 The default is 3600 (seconds).
916 Specifies the local addresses
919 The following forms may be used:
921 .Bl -item -offset indent -compact
925 .Ar host | Ar IPv4_addr | Ar IPv6_addr
930 .Ar host | Ar IPv4_addr : Ar port
936 .Ar host | Ar IPv6_addr Oc : Ar port
943 sshd will listen on the address and all
946 The default is to listen on all local addresses.
949 options are permitted.
950 .It Cm LoginGraceTime
951 The server disconnects after this time if the user has not
952 successfully logged in.
953 If the value is 0, there is no time limit.
954 The default is 120 seconds.
956 Gives the verbosity level that is used when logging messages from
958 The possible values are:
959 QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
961 DEBUG and DEBUG1 are equivalent.
962 DEBUG2 and DEBUG3 each specify higher levels of debugging output.
963 Logging with a DEBUG level violates the privacy of users and is not recommended.
965 Specifies the available MAC (message authentication code) algorithms.
966 The MAC algorithm is used for data integrity protection.
967 Multiple algorithms must be comma-separated.
968 If the specified value begins with a
970 character, then the specified algorithms will be appended to the default set
971 instead of replacing them.
973 The algorithms that contain
975 calculate the MAC after encryption (encrypt-then-mac).
976 These are considered safer and their use recommended.
977 The supported MACs are:
979 .Bl -item -compact -offset indent
999 hmac-md5-etm@openssh.com
1001 hmac-md5-96-etm@openssh.com
1003 hmac-ripemd160-etm@openssh.com
1005 hmac-sha1-etm@openssh.com
1007 hmac-sha1-96-etm@openssh.com
1009 hmac-sha2-256-etm@openssh.com
1011 hmac-sha2-512-etm@openssh.com
1013 umac-64-etm@openssh.com
1015 umac-128-etm@openssh.com
1019 .Bd -literal -offset indent
1020 umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1021 hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
1022 hmac-sha1-etm@openssh.com,
1023 umac-64@openssh.com,umac-128@openssh.com,
1024 hmac-sha2-256,hmac-sha2-512,hmac-sha1
1027 The list of available MAC algorithms may also be obtained using the
1034 Introduces a conditional block.
1035 If all of the criteria on the
1037 line are satisfied, the keywords on the following lines override those
1038 set in the global section of the config file, until either another
1040 line or the end of the file.
1041 If a keyword appears in multiple
1043 blocks that are satisfied, only the first instance of the keyword is
1048 are one or more criteria-pattern pairs or the single token
1050 which matches all criteria.
1051 The available criteria are
1059 The match patterns may consist of single entries or comma-separated
1060 lists and may use the wildcard and negation operators described in the
1066 criteria may additionally contain addresses to match in CIDR
1067 address/masklen format, e.g.\&
1070 .Dq 3ffe:ffff::/32 .
1071 Note that the mask length provided must be consistent with the address -
1072 it is an error to specify a mask length that is too long for the address
1073 or one with bits set in this host portion of the address.
1080 Only a subset of keywords may be used on the lines following a
1083 Available keywords are
1085 .Cm AllowAgentForwarding ,
1087 .Cm AllowStreamLocalForwarding ,
1088 .Cm AllowTcpForwarding ,
1090 .Cm AuthenticationMethods ,
1091 .Cm AuthorizedKeysCommand ,
1092 .Cm AuthorizedKeysCommandUser ,
1093 .Cm AuthorizedKeysFile ,
1094 .Cm AuthorizedPrincipalsCommand ,
1095 .Cm AuthorizedPrincipalsCommandUser ,
1096 .Cm AuthorizedPrincipalsFile ,
1098 .Cm ChrootDirectory ,
1103 .Cm GSSAPIAuthentication ,
1104 .Cm HostbasedAcceptedKeyTypes ,
1105 .Cm HostbasedAuthentication ,
1106 .Cm HostbasedUsesNameFromPacketOnly ,
1108 .Cm KbdInteractiveAuthentication ,
1109 .Cm KerberosAuthentication ,
1112 .Cm PasswordAuthentication ,
1113 .Cm PermitEmptyPasswords ,
1115 .Cm PermitRootLogin ,
1119 .Cm PubkeyAcceptedKeyTypes ,
1120 .Cm PubkeyAuthentication ,
1123 .Cm RhostsRSAAuthentication ,
1124 .Cm RSAAuthentication ,
1125 .Cm StreamLocalBindMask ,
1126 .Cm StreamLocalBindUnlink ,
1127 .Cm TrustedUserCAKeys ,
1128 .Cm X11DisplayOffset ,
1131 .Cm X11UseLocalHost .
1133 Specifies the maximum number of authentication attempts permitted per
1135 Once the number of failures reaches half this value,
1136 additional failures are logged.
1139 Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1140 sessions permitted per network connection.
1141 Multiple sessions may be established by clients that support connection
1145 to 1 will effectively disable session multiplexing, whereas setting it to 0
1146 will prevent all shell, login and subsystem sessions while still permitting
1150 Specifies the maximum number of concurrent unauthenticated connections to the
1152 Additional connections will be dropped until authentication succeeds or the
1154 expires for a connection.
1155 The default is 10:30:100.
1157 Alternatively, random early drop can be enabled by specifying
1158 the three colon separated values
1162 will refuse connection attempts with a probability of
1165 if there are currently
1168 unauthenticated connections.
1169 The probability increases linearly and all connection attempts
1170 are refused if the number of unauthenticated connections reaches
1173 .It Cm PasswordAuthentication
1174 Specifies whether password authentication is allowed.
1179 .It Cm PermitEmptyPasswords
1180 When password authentication is allowed, it specifies whether the
1181 server allows login to accounts with empty password strings.
1185 Specifies the destinations to which TCP port forwarding is permitted.
1186 The forwarding specification must be one of the following forms:
1188 .Bl -item -offset indent -compact
1197 .Ar IPv4_addr : port
1202 .Ar \&[ IPv6_addr \&] : port
1206 Multiple forwards may be specified by separating them with whitespace.
1209 can be used to remove all restrictions and permit any forwarding requests.
1212 can be used to prohibit all forwarding requests.
1213 By default all port forwarding requests are permitted.
1214 .It Cm PermitRootLogin
1215 Specifies whether root can log in using
1217 The argument must be
1219 .Dq prohibit-password ,
1220 .Dq without-password ,
1221 .Dq forced-commands-only ,
1227 .Cm ChallengeResponseAuthentication
1230 the root user may be allowed in with its password even if
1231 .Cm PermitRootLogin is set to
1232 .Dq without-password .
1234 If this option is set to
1235 .Dq prohibit-password
1237 .Dq without-password ,
1238 password and keyboard-interactive authentication are disabled for root.
1240 If this option is set to
1241 .Dq forced-commands-only ,
1242 root login with public key authentication will be allowed,
1245 option has been specified
1246 (which may be useful for taking remote backups even if root login is
1247 normally not allowed).
1248 All other authentication methods are disabled for root.
1250 If this option is set to
1252 root is not allowed to log in.
1256 device forwarding is allowed.
1257 The argument must be
1273 Independent of this setting, the permissions of the selected
1275 device must allow access to the user.
1279 allocation is permitted.
1282 .It Cm PermitUserEnvironment
1284 .Pa ~/.ssh/environment
1288 .Pa ~/.ssh/authorized_keys
1293 Enabling environment processing may enable users to bypass access
1294 restrictions in some configurations using mechanisms such as
1297 Specifies whether any
1303 Specifies the file that contains the process ID of the
1308 .Pa /var/run/sshd.pid .
1310 Specifies the port number that
1314 Multiple options of this type are permitted.
1320 should print the date and time of the last user login when a user logs
1329 when a user logs in interactively.
1330 (On some systems it is also printed by the shell,
1336 Specifies the protocol versions
1339 The possible values are
1343 Multiple versions must be comma-separated.
1346 Protocol 1 suffers from a number of cryptographic weaknesses and should
1348 It is only offered to support legacy devices.
1350 Note that the order of the protocol list does not indicate preference,
1351 because the client selects among multiple protocol versions offered
1357 .It Cm PubkeyAcceptedKeyTypes
1358 Specifies the key types that will be accepted for public key authentication
1359 as a comma-separated pattern list.
1360 Alternately if the specified value begins with a
1362 character, then the specified key types will be appended to the default set
1363 instead of replacing them.
1364 The default for this option is:
1365 .Bd -literal -offset 3n
1366 ecdsa-sha2-nistp256-cert-v01@openssh.com,
1367 ecdsa-sha2-nistp384-cert-v01@openssh.com,
1368 ecdsa-sha2-nistp521-cert-v01@openssh.com,
1369 ssh-ed25519-cert-v01@openssh.com,
1370 ssh-rsa-cert-v01@openssh.com,
1371 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1379 may be used to list supported key types.
1380 .It Cm PubkeyAuthentication
1381 Specifies whether public key authentication is allowed.
1385 Specifies the maximum amount of data that may be transmitted before the
1386 session key is renegotiated, optionally followed a maximum amount of
1387 time that may pass before the session key is renegotiated.
1388 The first argument is specified in bytes and may have a suffix of
1393 to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1394 The default is between
1398 depending on the cipher.
1399 The optional second value is specified in seconds and may use any of the
1400 units documented in the
1403 The default value for
1407 which means that rekeying is performed after the cipher's default amount
1408 of data has been sent or received and no time based rekeying is done.
1410 Specifies revoked public keys file, or
1413 Keys listed in this file will be refused for public key authentication.
1414 Note that if this file is not readable, then public key authentication will
1415 be refused for all users.
1416 Keys may be specified as a text file, listing one public key per line, or as
1417 an OpenSSH Key Revocation List (KRL) as generated by
1419 For more information on KRLs, see the KEY REVOCATION LISTS section in
1421 .It Cm RhostsRSAAuthentication
1422 Specifies whether rhosts or
1423 .Pa /etc/hosts.equiv
1424 authentication together
1425 with successful RSA host authentication is allowed.
1428 This option applies to protocol version 1 only.
1429 .It Cm RSAAuthentication
1430 Specifies whether pure RSA authentication is allowed.
1433 This option applies to protocol version 1 only.
1434 .It Cm ServerKeyBits
1435 Defines the number of bits in the ephemeral protocol version 1 server key.
1436 The default and minimum value is 1024.
1437 .It Cm StreamLocalBindMask
1438 Sets the octal file creation mode mask
1440 used when creating a Unix-domain socket file for local or remote
1442 This option is only used for port forwarding to a Unix-domain socket file.
1444 The default value is 0177, which creates a Unix-domain socket file that is
1445 readable and writable only by the owner.
1446 Note that not all operating systems honor the file mode on Unix-domain
1448 .It Cm StreamLocalBindUnlink
1449 Specifies whether to remove an existing Unix-domain socket file for local
1450 or remote port forwarding before creating a new one.
1451 If the socket file already exists and
1452 .Cm StreamLocalBindUnlink
1455 will be unable to forward the port to the Unix-domain socket file.
1456 This option is only used for port forwarding to a Unix-domain socket file.
1458 The argument must be
1467 should check file modes and ownership of the
1468 user's files and home directory before accepting login.
1469 This is normally desirable because novices sometimes accidentally leave their
1470 directory or files world-writable.
1473 Note that this does not apply to
1474 .Cm ChrootDirectory ,
1475 whose permissions and ownership are checked unconditionally.
1477 Configures an external subsystem (e.g. file transfer daemon).
1478 Arguments should be a subsystem name and a command (with optional arguments)
1479 to execute upon subsystem request.
1485 file transfer subsystem.
1487 Alternately the name
1489 implements an in-process
1492 This may simplify configurations using
1494 to force a different filesystem root on clients.
1496 By default no subsystems are defined.
1497 .It Cm SyslogFacility
1498 Gives the facility code that is used when logging messages from
1500 The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1501 LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1502 The default is AUTH.
1504 Specifies whether the system should send TCP keepalive messages to the
1506 If they are sent, death of the connection or crash of one
1507 of the machines will be properly noticed.
1508 However, this means that
1509 connections will die if the route is down temporarily, and some people
1511 On the other hand, if TCP keepalives are not sent,
1512 sessions may hang indefinitely on the server, leaving
1514 users and consuming server resources.
1518 (to send TCP keepalive messages), and the server will notice
1519 if the network goes down or the client host crashes.
1520 This avoids infinitely hanging sessions.
1522 To disable TCP keepalive messages, the value should be set to
1524 .It Cm TrustedUserCAKeys
1525 Specifies a file containing public keys of certificate authorities that are
1526 trusted to sign user certificates for authentication, or
1529 Keys are listed one per line; empty lines and comments starting with
1532 If a certificate is presented for authentication and has its signing CA key
1533 listed in this file, then it may be used for authentication for any user
1534 listed in the certificate's principals list.
1535 Note that certificates that lack a list of principals will not be permitted
1536 for authentication using
1537 .Cm TrustedUserCAKeys .
1538 For more details on certificates, see the CERTIFICATES section in
1543 attempts to send authentication success and failure messages
1552 should look up the remote host name, and to check that
1553 the resolved host name for the remote IP address maps back to the
1554 very same IP address.
1556 If this option is set to
1558 then only addresses and not host names may be used in
1559 .Pa ~/.ssh/known_hosts
1571 is used for interactive login sessions.
1576 is never used for remote command execution.
1577 Note also, that if this is enabled,
1579 will be disabled because
1581 does not know how to handle
1585 .Cm UsePrivilegeSeparation
1586 is specified, it will be disabled after authentication.
1588 Enables the Pluggable Authentication Module interface.
1591 this will enable PAM authentication using
1592 .Cm ChallengeResponseAuthentication
1594 .Cm PasswordAuthentication
1595 in addition to PAM account and session module processing for all
1596 authentication types.
1598 Because PAM challenge-response authentication usually serves an equivalent
1599 role to password authentication, you should disable either
1600 .Cm PasswordAuthentication
1602 .Cm ChallengeResponseAuthentication.
1606 is enabled, you will not be able to run
1611 .It Cm UsePrivilegeSeparation
1614 separates privileges by creating an unprivileged child process
1615 to deal with incoming network traffic.
1616 After successful authentication, another process will be created that has
1617 the privilege of the authenticated user.
1618 The goal of privilege separation is to prevent privilege
1619 escalation by containing any corruption within the unprivileged processes.
1620 The argument must be
1626 .Cm UsePrivilegeSeparation
1629 then the pre-authentication unprivileged process is subject to additional
1633 .It Cm VersionAddendum
1634 Optionally specifies additional text to append to the SSH protocol banner
1635 sent by the server upon connection.
1637 .Dq FreeBSD-20161230 .
1640 may be used to disable this.
1641 .It Cm X11DisplayOffset
1642 Specifies the first display number available for
1645 This prevents sshd from interfering with real X11 servers.
1647 .It Cm X11Forwarding
1648 Specifies whether X11 forwarding is permitted.
1649 The argument must be
1656 When X11 forwarding is enabled, there may be additional exposure to
1657 the server and to client displays if the
1659 proxy display is configured to listen on the wildcard address (see
1661 below), though this is not the default.
1662 Additionally, the authentication spoofing and authentication data
1663 verification and substitution occur on the client side.
1664 The security risk of using X11 forwarding is that the client's X11
1665 display server may be exposed to attack when the SSH client requests
1666 forwarding (see the warnings for
1669 .Xr ssh_config 5 ) .
1670 A system administrator may have a stance in which they want to
1671 protect clients that may expose themselves to attack by unwittingly
1672 requesting X11 forwarding, which can warrant a
1676 Note that disabling X11 forwarding does not prevent users from
1677 forwarding X11 traffic, as users can always install their own forwarders.
1678 X11 forwarding is automatically disabled if
1681 .It Cm X11UseLocalhost
1684 should bind the X11 forwarding server to the loopback address or to
1685 the wildcard address.
1687 sshd binds the forwarding server to the loopback address and sets the
1688 hostname part of the
1690 environment variable to
1692 This prevents remote hosts from connecting to the proxy display.
1693 However, some older X11 clients may not function with this
1698 to specify that the forwarding server should be bound to the wildcard
1700 The argument must be
1706 .It Cm XAuthLocation
1707 Specifies the full pathname of the
1713 .Pa /usr/local/bin/xauth .
1717 command-line arguments and configuration file options that specify time
1718 may be expressed using a sequence of the form:
1720 .Ar time Op Ar qualifier ,
1724 is a positive integer value and
1726 is one of the following:
1728 .Bl -tag -width Ds -compact -offset indent
1743 Each member of the sequence is added together to calculate
1744 the total time value.
1746 Time format examples:
1748 .Bl -tag -width Ds -compact -offset indent
1750 600 seconds (10 minutes)
1754 1 hour 30 minutes (90 minutes)
1758 .It Pa /etc/ssh/sshd_config
1759 Contains configuration data for
1761 This file should be writable by root only, but it is recommended
1762 (though not necessary) that it be world-readable.
1767 OpenSSH is a derivative of the original and free
1768 ssh 1.2.12 release by Tatu Ylonen.
1769 Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1770 Theo de Raadt and Dug Song
1771 removed many bugs, re-added newer features and
1773 Markus Friedl contributed the support for SSH
1774 protocol versions 1.5 and 2.0.
1775 Niels Provos and Markus Friedl contributed support
1776 for privilege separation.