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.227 2016/07/19 12:59:16 jmc Exp $
38 .Dd $Mdocdate: July 19 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 HOST criteria may additionally contain addresses to match in CIDR
178 address/masklen format.
179 The allow/deny directives are processed in the following order:
188 for more information on patterns.
189 .It Cm AuthenticationMethods
190 Specifies the authentication methods that must be successfully completed
191 for a user to be granted access.
192 This option must be followed by one or more comma-separated lists of
193 authentication method names, or by the single string
195 to indicate the default behaviour of accepting any single authentication
197 if the default is overridden, then successful authentication requires
198 completion of every method in at least one of these lists.
200 For example, an argument of
201 .Dq publickey,password publickey,keyboard-interactive
202 would require the user to complete public key authentication, followed by
203 either password or keyboard interactive authentication.
204 Only methods that are next in one or more lists are offered at each stage,
205 so for this example, it would not be possible to attempt password or
206 keyboard-interactive authentication before public key.
208 For keyboard interactive authentication it is also possible to
209 restrict authentication to a specific device by appending a
210 colon followed by the device identifier
215 depending on the server configuration.
217 .Dq keyboard-interactive:bsdauth
218 would restrict keyboard interactive authentication to the
224 method is listed more than once,
226 verifies that keys that have been used successfully are not reused for
227 subsequent authentications.
229 .Cm AuthenticationMethods
231 .Dq publickey,publickey
232 will require successful authentication using two different public keys.
234 This option will yield a fatal
235 error if enabled if protocol 1 is also enabled.
236 Note that each authentication method listed should also be explicitly enabled
237 in the configuration.
240 is not to require multiple authentication; successful completion
241 of a single authentication method is sufficient.
242 .It Cm AuthorizedKeysCommand
243 Specifies a program to be used to look up the user's public keys.
244 The program must be owned by root, not writable by group or others and
245 specified by an absolute path.
248 .Cm AuthorizedKeysCommand
249 may be provided using the following tokens, which will be expanded
250 at runtime: %% is replaced by a literal '%', %u is replaced by the
251 username being authenticated, %h is replaced by the home directory
252 of the user being authenticated, %t is replaced with the key type
253 offered for authentication, %f is replaced with the fingerprint of
254 the key, and %k is replaced with the key being offered for authentication.
255 If no arguments are specified then the username of the target user
258 The program should produce on standard output zero or
259 more lines of authorized_keys output (see AUTHORIZED_KEYS in
261 If a key supplied by AuthorizedKeysCommand does not successfully authenticate
262 and authorize the user then public key authentication continues using the usual
263 .Cm AuthorizedKeysFile
265 By default, no AuthorizedKeysCommand is run.
266 .It Cm AuthorizedKeysCommandUser
267 Specifies the user under whose account the AuthorizedKeysCommand is run.
268 It is recommended to use a dedicated user that has no other role on the host
269 than running authorized keys commands.
271 .Cm AuthorizedKeysCommand
273 .Cm AuthorizedKeysCommandUser
276 will refuse to start.
277 .It Cm AuthorizedKeysFile
278 Specifies the file that contains the public keys that can be used
279 for user authentication.
280 The format is described in the
281 AUTHORIZED_KEYS FILE FORMAT
284 .Cm AuthorizedKeysFile
285 may contain tokens of the form %T which are substituted during connection
287 The following tokens are defined: %% is replaced by a literal '%',
288 %h is replaced by the home directory of the user being authenticated, and
289 %u is replaced by the username of that user.
291 .Cm AuthorizedKeysFile
292 is taken to be an absolute path or one relative to the user's home
294 Multiple files may be listed, separated by whitespace.
295 Alternately this option may be set to
297 to skip checking for user keys in files.
299 .Dq .ssh/authorized_keys .ssh/authorized_keys2 .
300 .It Cm AuthorizedPrincipalsCommand
301 Specifies a program to be used to generate the list of allowed
302 certificate principals as per
303 .Cm AuthorizedPrincipalsFile .
304 The program must be owned by root, not writable by group or others and
305 specified by an absolute path.
308 .Cm AuthorizedPrincipalsCommand
309 may be provided using the following tokens, which will be expanded
310 at runtime: %% is replaced by a literal '%', %u is replaced by the
311 username being authenticated and %h is replaced by the home directory
312 of the user being authenticated.
314 The program should produce on standard output zero or
316 .Cm AuthorizedPrincipalsFile
319 .Cm AuthorizedPrincipalsCommand
321 .Cm AuthorizedPrincipalsFile
322 is specified, then certificates offered by the client for authentication
323 must contain a principal that is listed.
324 By default, no AuthorizedPrincipalsCommand is run.
325 .It Cm AuthorizedPrincipalsCommandUser
326 Specifies the user under whose account the AuthorizedPrincipalsCommand is run.
327 It is recommended to use a dedicated user that has no other role on the host
328 than running authorized principals commands.
330 .Cm AuthorizedPrincipalsCommand
332 .Cm AuthorizedPrincipalsCommandUser
335 will refuse to start.
336 .It Cm AuthorizedPrincipalsFile
337 Specifies a file that lists principal names that are accepted for
338 certificate authentication.
339 When using certificates signed by a key listed in
340 .Cm TrustedUserCAKeys ,
341 this file lists names, one of which must appear in the certificate for it
342 to be accepted for authentication.
343 Names are listed one per line preceded by key options (as described
344 in AUTHORIZED_KEYS FILE FORMAT in
346 Empty lines and comments starting with
350 .Cm AuthorizedPrincipalsFile
351 may contain tokens of the form %T which are substituted during connection
353 The following tokens are defined: %% is replaced by a literal '%',
354 %h is replaced by the home directory of the user being authenticated, and
355 %u is replaced by the username of that user.
357 .Cm AuthorizedPrincipalsFile
358 is taken to be an absolute path or one relative to the user's home
363 i.e. not to use a principals file \(en in this case, the username
364 of the user must appear in a certificate's principals list for it to be
367 .Cm AuthorizedPrincipalsFile
368 is only used when authentication proceeds using a CA listed in
369 .Cm TrustedUserCAKeys
370 and is not consulted for certification authorities trusted via
371 .Pa ~/.ssh/authorized_keys ,
374 key option offers a similar facility (see
378 The contents of the specified file are sent to the remote user before
379 authentication is allowed.
382 then no banner is displayed.
383 By default, no banner is displayed.
384 .It Cm ChallengeResponseAuthentication
385 Specifies whether challenge-response authentication is allowed (e.g. via
386 PAM or through authentication styles supported in
390 .It Cm ChrootDirectory
391 Specifies the pathname of a directory to
393 to after authentication.
396 checks that all components of the pathname are root-owned directories
397 which are not writable by any other user or group.
400 changes the working directory to the user's home directory.
402 The pathname may contain the following tokens that are expanded at runtime once
403 the connecting user has been authenticated: %% is replaced by a literal '%',
404 %h is replaced by the home directory of the user being authenticated, and
405 %u is replaced by the username of that user.
409 must contain the necessary files and directories to support the
411 For an interactive session this requires at least a shell, typically
424 For file transfer sessions using
426 no additional configuration of the environment is necessary if the
427 in-process sftp server is used,
428 though sessions which use logging may require
430 inside the chroot directory on some operating systems (see
434 For safety, it is very important that the directory hierarchy be
435 prevented from modification by other processes on the system (especially
436 those outside the jail).
437 Misconfiguration can lead to unsafe environments which
446 Specifies the ciphers allowed.
447 Multiple ciphers must be comma-separated.
448 If the specified value begins with a
450 character, then the specified ciphers will be appended to the default set
451 instead of replacing them.
453 The supported ciphers are:
455 .Bl -item -compact -offset indent
471 aes128-gcm@openssh.com
473 aes256-gcm@openssh.com
485 chacha20-poly1305@openssh.com
489 .Bd -literal -offset indent
490 chacha20-poly1305@openssh.com,
491 aes128-ctr,aes192-ctr,aes256-ctr,
492 aes128-gcm@openssh.com,aes256-gcm@openssh.com,
493 aes128-cbc,aes192-cbc,aes256-cbc
496 The list of available ciphers may also be obtained using the
502 .It Cm ClientAliveCountMax
503 Sets the number of client alive messages (see below) which may be
506 receiving any messages back from the client.
507 If this threshold is reached while client alive messages are being sent,
508 sshd will disconnect the client, terminating the session.
509 It is important to note that the use of client alive messages is very
513 The client alive messages are sent through the encrypted channel
514 and therefore will not be spoofable.
515 The TCP keepalive option enabled by
518 The client alive mechanism is valuable when the client or
519 server depend on knowing when a connection has become inactive.
521 The default value is 3.
523 .Cm ClientAliveInterval
524 (see below) is set to 15, and
525 .Cm ClientAliveCountMax
526 is left at the default, unresponsive SSH clients
527 will be disconnected after approximately 45 seconds.
528 .It Cm ClientAliveInterval
529 Sets a timeout interval in seconds after which if no data has been received
532 will send a message through the encrypted
533 channel to request a response from the client.
535 is 0, indicating that these messages will not be sent to the client.
537 Specifies whether compression is allowed, or delayed until
538 the user has authenticated successfully.
547 This keyword can be followed by a list of group name patterns, separated
549 Login is disallowed for users whose primary group or supplementary
550 group list matches one of the patterns.
551 Only group names are valid; a numerical group ID is not recognized.
552 By default, login is allowed for all groups.
553 The allow/deny directives are processed in the following order:
562 for more information on patterns.
564 This keyword can be followed by a list of user name patterns, separated
566 Login is disallowed for user names that match one of the patterns.
567 Only user names are valid; a numerical user ID is not recognized.
568 By default, login is allowed for all users.
569 If the pattern takes the form USER@HOST then USER and HOST
570 are separately checked, restricting logins to particular
571 users from particular hosts.
572 HOST criteria may additionally contain addresses to match in CIDR
573 address/masklen format.
574 The allow/deny directives are processed in the following order:
583 for more information on patterns.
584 .It Cm FingerprintHash
585 Specifies the hash algorithm used when logging key fingerprints.
593 Forces the execution of the command specified by
595 ignoring any command supplied by the client and
598 The command is invoked by using the user's login shell with the -c option.
599 This applies to shell, command, or subsystem execution.
600 It is most useful inside a
603 The command originally supplied by the client is available in the
604 .Ev SSH_ORIGINAL_COMMAND
605 environment variable.
606 Specifying a command of
608 will force the use of an in-process sftp server that requires no support
610 .Cm ChrootDirectory .
614 Specifies whether remote hosts are allowed to connect to ports
615 forwarded for the client.
618 binds remote port forwardings to the loopback address.
619 This prevents other remote hosts from connecting to forwarded ports.
621 can be used to specify that sshd
622 should allow remote port forwardings to bind to non-loopback addresses, thus
623 allowing other hosts to connect.
626 to force remote port forwardings to be available to the local host only,
628 to force remote port forwardings to bind to the wildcard address, or
630 to allow the client to select the address to which the forwarding is bound.
633 .It Cm GSSAPIAuthentication
634 Specifies whether user authentication based on GSSAPI is allowed.
637 .It Cm GSSAPICleanupCredentials
638 Specifies whether to automatically destroy the user's credentials cache
642 .It Cm GSSAPIStrictAcceptorCheck
643 Determines whether to be strict about the identity of the GSSAPI acceptor
644 a client authenticates against.
647 then the client must authenticate against the
649 service on the current hostname.
652 then the client may authenticate against any service key stored in the
653 machine's default store.
654 This facility is provided to assist with operation on multi homed machines.
657 .It Cm HostbasedAcceptedKeyTypes
658 Specifies the key types that will be accepted for hostbased authentication
659 as a comma-separated pattern list.
660 Alternately if the specified value begins with a
662 character, then the specified key types will be appended to the default set
663 instead of replacing them.
664 The default for this option is:
665 .Bd -literal -offset 3n
666 ecdsa-sha2-nistp256-cert-v01@openssh.com,
667 ecdsa-sha2-nistp384-cert-v01@openssh.com,
668 ecdsa-sha2-nistp521-cert-v01@openssh.com,
669 ssh-ed25519-cert-v01@openssh.com,
670 ssh-rsa-cert-v01@openssh.com,
671 ssh-dss-cert-v01@openssh.com,
672 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,
673 ecdsa-sha2-nistp521,ssh-ed25519,
681 may be used to list supported key types.
682 .It Cm HostbasedAuthentication
683 Specifies whether rhosts or /etc/hosts.equiv authentication together
684 with successful public key client host authentication is allowed
685 (host-based authentication).
688 .It Cm HostbasedUsesNameFromPacketOnly
689 Specifies whether or not the server will attempt to perform a reverse
690 name lookup when matching the name in the
696 .Cm HostbasedAuthentication .
701 uses the name supplied by the client rather than
702 attempting to resolve the name from the TCP connection itself.
705 .It Cm HostCertificate
706 Specifies a file containing a public host certificate.
707 The certificate's public key must match a private host key already specified
710 The default behaviour of
712 is not to load any certificates.
714 Specifies a file containing a private host key
717 .Pa /etc/ssh/ssh_host_key
718 for protocol version 1, and
719 .Pa /etc/ssh/ssh_host_dsa_key ,
720 .Pa /etc/ssh/ssh_host_ecdsa_key ,
721 .Pa /etc/ssh/ssh_host_ed25519_key
723 .Pa /etc/ssh/ssh_host_rsa_key
724 for protocol version 2.
728 will refuse to use a file if it is group/world-accessible
730 .Cm HostKeyAlgorithms
731 option restricts which of the keys are actually used by
734 It is possible to have multiple host key files.
736 keys are used for version 1 and
742 are used for version 2 of the SSH protocol.
743 It is also possible to specify public host key files instead.
744 In this case operations on the private key will be delegated
748 Identifies the UNIX-domain socket used to communicate
749 with an agent that has access to the private host keys.
752 is specified, the location of the socket will be read from the
754 environment variable.
755 .It Cm HostKeyAlgorithms
756 Specifies the host key algorithms
757 that the server offers.
758 The default for this option is:
759 .Bd -literal -offset 3n
760 ecdsa-sha2-nistp256-cert-v01@openssh.com,
761 ecdsa-sha2-nistp384-cert-v01@openssh.com,
762 ecdsa-sha2-nistp521-cert-v01@openssh.com,
763 ssh-ed25519-cert-v01@openssh.com,
764 ssh-rsa-cert-v01@openssh.com,
765 ssh-dss-cert-v01@openssh.com,
766 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,
767 ecdsa-sha2-nistp521,ssh-ed25519,
771 The list of available key types may also be obtained using the
782 files will not be used in
783 .Cm RhostsRSAAuthentication
785 .Cm HostbasedAuthentication .
789 .Pa /etc/ssh/shosts.equiv
793 .It Cm IgnoreUserKnownHosts
796 should ignore the user's
797 .Pa ~/.ssh/known_hosts
799 .Cm RhostsRSAAuthentication
801 .Cm HostbasedAuthentication .
805 Specifies the IPv4 type-of-service or DSCP class for the connection.
832 This option may take one or two arguments, separated by whitespace.
833 If one argument is specified, it is used as the packet class unconditionally.
834 If two values are specified, the first is automatically selected for
835 interactive sessions and the second for non-interactive sessions.
838 for interactive sessions and
840 for non-interactive sessions.
841 .It Cm KbdInteractiveAuthentication
842 Specifies whether to allow keyboard-interactive authentication.
843 The argument to this keyword must be
847 The default is to use whatever value
848 .Cm ChallengeResponseAuthentication
852 .It Cm KerberosAuthentication
853 Specifies whether the password provided by the user for
854 .Cm PasswordAuthentication
855 will be validated through the Kerberos KDC.
856 To use this option, the server needs a
857 Kerberos servtab which allows the verification of the KDC's identity.
860 .It Cm KerberosGetAFSToken
861 If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
862 an AFS token before accessing the user's home directory.
865 .It Cm KerberosOrLocalPasswd
866 If password authentication through Kerberos fails then
867 the password will be validated via any additional local mechanism
872 .It Cm KerberosTicketCleanup
873 Specifies whether to automatically destroy the user's ticket cache
878 Specifies the available KEX (Key Exchange) algorithms.
879 Multiple algorithms must be comma-separated.
880 Alternately if the specified value begins with a
882 character, then the specified methods will be appended to the default set
883 instead of replacing them.
884 The supported algorithms are:
886 .Bl -item -compact -offset indent
888 curve25519-sha256@libssh.org
890 diffie-hellman-group1-sha1
892 diffie-hellman-group14-sha1
894 diffie-hellman-group-exchange-sha1
896 diffie-hellman-group-exchange-sha256
906 .Bd -literal -offset indent
907 curve25519-sha256@libssh.org,
908 ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
909 diffie-hellman-group-exchange-sha256,
910 diffie-hellman-group14-sha1
913 The list of available key exchange algorithms may also be obtained using the
919 .It Cm KeyRegenerationInterval
920 In protocol version 1, the ephemeral server key is automatically regenerated
921 after this many seconds (if it has been used).
922 The purpose of regeneration is to prevent
923 decrypting captured sessions by later breaking into the machine and
925 The key is never stored anywhere.
926 If the value is 0, the key is never regenerated.
927 The default is 3600 (seconds).
929 Specifies the local addresses
932 The following forms may be used:
934 .Bl -item -offset indent -compact
938 .Ar host | Ar IPv4_addr | Ar IPv6_addr
943 .Ar host | Ar IPv4_addr : Ar port
949 .Ar host | Ar IPv6_addr Oc : Ar port
956 sshd will listen on the address and all
959 The default is to listen on all local addresses.
962 options are permitted.
963 .It Cm LoginGraceTime
964 The server disconnects after this time if the user has not
965 successfully logged in.
966 If the value is 0, there is no time limit.
967 The default is 120 seconds.
969 Gives the verbosity level that is used when logging messages from
971 The possible values are:
972 QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
974 DEBUG and DEBUG1 are equivalent.
975 DEBUG2 and DEBUG3 each specify higher levels of debugging output.
976 Logging with a DEBUG level violates the privacy of users and is not recommended.
978 Specifies the available MAC (message authentication code) algorithms.
979 The MAC algorithm is used for data integrity protection.
980 Multiple algorithms must be comma-separated.
981 If the specified value begins with a
983 character, then the specified algorithms will be appended to the default set
984 instead of replacing them.
986 The algorithms that contain
988 calculate the MAC after encryption (encrypt-then-mac).
989 These are considered safer and their use recommended.
990 The supported MACs are:
992 .Bl -item -compact -offset indent
1010 umac-128@openssh.com
1012 hmac-md5-etm@openssh.com
1014 hmac-md5-96-etm@openssh.com
1016 hmac-ripemd160-etm@openssh.com
1018 hmac-sha1-etm@openssh.com
1020 hmac-sha1-96-etm@openssh.com
1022 hmac-sha2-256-etm@openssh.com
1024 hmac-sha2-512-etm@openssh.com
1026 umac-64-etm@openssh.com
1028 umac-128-etm@openssh.com
1032 .Bd -literal -offset indent
1033 umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1034 hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
1035 hmac-sha1-etm@openssh.com,
1036 umac-64@openssh.com,umac-128@openssh.com,
1037 hmac-sha2-256,hmac-sha2-512,hmac-sha1
1040 The list of available MAC algorithms may also be obtained using the
1047 Introduces a conditional block.
1048 If all of the criteria on the
1050 line are satisfied, the keywords on the following lines override those
1051 set in the global section of the config file, until either another
1053 line or the end of the file.
1054 If a keyword appears in multiple
1056 blocks that are satisfied, only the first instance of the keyword is
1061 are one or more criteria-pattern pairs or the single token
1063 which matches all criteria.
1064 The available criteria are
1072 The match patterns may consist of single entries or comma-separated
1073 lists and may use the wildcard and negation operators described in the
1079 criteria may additionally contain addresses to match in CIDR
1080 address/masklen format, e.g.\&
1083 .Dq 3ffe:ffff::/32 .
1084 Note that the mask length provided must be consistent with the address -
1085 it is an error to specify a mask length that is too long for the address
1086 or one with bits set in this host portion of the address.
1093 Only a subset of keywords may be used on the lines following a
1096 Available keywords are
1098 .Cm AllowAgentForwarding ,
1100 .Cm AllowStreamLocalForwarding ,
1101 .Cm AllowTcpForwarding ,
1103 .Cm AuthenticationMethods ,
1104 .Cm AuthorizedKeysCommand ,
1105 .Cm AuthorizedKeysCommandUser ,
1106 .Cm AuthorizedKeysFile ,
1107 .Cm AuthorizedPrincipalsCommand ,
1108 .Cm AuthorizedPrincipalsCommandUser ,
1109 .Cm AuthorizedPrincipalsFile ,
1111 .Cm ChrootDirectory ,
1116 .Cm GSSAPIAuthentication ,
1117 .Cm HostbasedAcceptedKeyTypes ,
1118 .Cm HostbasedAuthentication ,
1119 .Cm HostbasedUsesNameFromPacketOnly ,
1121 .Cm KbdInteractiveAuthentication ,
1122 .Cm KerberosAuthentication ,
1125 .Cm PasswordAuthentication ,
1126 .Cm PermitEmptyPasswords ,
1128 .Cm PermitRootLogin ,
1132 .Cm PubkeyAcceptedKeyTypes ,
1133 .Cm PubkeyAuthentication ,
1136 .Cm RhostsRSAAuthentication ,
1137 .Cm RSAAuthentication ,
1138 .Cm StreamLocalBindMask ,
1139 .Cm StreamLocalBindUnlink ,
1140 .Cm TrustedUserCAKeys ,
1141 .Cm X11DisplayOffset ,
1144 .Cm X11UseLocalHost .
1146 Specifies the maximum number of authentication attempts permitted per
1148 Once the number of failures reaches half this value,
1149 additional failures are logged.
1152 Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1153 sessions permitted per network connection.
1154 Multiple sessions may be established by clients that support connection
1158 to 1 will effectively disable session multiplexing, whereas setting it to 0
1159 will prevent all shell, login and subsystem sessions while still permitting
1163 Specifies the maximum number of concurrent unauthenticated connections to the
1165 Additional connections will be dropped until authentication succeeds or the
1167 expires for a connection.
1168 The default is 10:30:100.
1170 Alternatively, random early drop can be enabled by specifying
1171 the three colon separated values
1175 will refuse connection attempts with a probability of
1178 if there are currently
1181 unauthenticated connections.
1182 The probability increases linearly and all connection attempts
1183 are refused if the number of unauthenticated connections reaches
1186 .It Cm PasswordAuthentication
1187 Specifies whether password authentication is allowed.
1192 .It Cm PermitEmptyPasswords
1193 When password authentication is allowed, it specifies whether the
1194 server allows login to accounts with empty password strings.
1198 Specifies the destinations to which TCP port forwarding is permitted.
1199 The forwarding specification must be one of the following forms:
1201 .Bl -item -offset indent -compact
1210 .Ar IPv4_addr : port
1215 .Ar \&[ IPv6_addr \&] : port
1219 Multiple forwards may be specified by separating them with whitespace.
1222 can be used to remove all restrictions and permit any forwarding requests.
1225 can be used to prohibit all forwarding requests.
1228 can be used for host or port to allow all hosts or ports, respectively.
1229 By default all port forwarding requests are permitted.
1230 .It Cm PermitRootLogin
1231 Specifies whether root can log in using
1233 The argument must be
1235 .Dq prohibit-password ,
1236 .Dq without-password ,
1237 .Dq forced-commands-only ,
1243 .Cm ChallengeResponseAuthentication
1246 the root user may be allowed in with its password even if
1247 .Cm PermitRootLogin is set to
1248 .Dq without-password .
1250 If this option is set to
1251 .Dq prohibit-password
1253 .Dq without-password ,
1254 password and keyboard-interactive authentication are disabled for root.
1256 If this option is set to
1257 .Dq forced-commands-only ,
1258 root login with public key authentication will be allowed,
1261 option has been specified
1262 (which may be useful for taking remote backups even if root login is
1263 normally not allowed).
1264 All other authentication methods are disabled for root.
1266 If this option is set to
1268 root is not allowed to log in.
1272 device forwarding is allowed.
1273 The argument must be
1289 Independent of this setting, the permissions of the selected
1291 device must allow access to the user.
1295 allocation is permitted.
1298 .It Cm PermitUserEnvironment
1300 .Pa ~/.ssh/environment
1304 .Pa ~/.ssh/authorized_keys
1309 Enabling environment processing may enable users to bypass access
1310 restrictions in some configurations using mechanisms such as
1313 Specifies whether any
1319 Specifies the file that contains the process ID of the
1324 .Pa /var/run/sshd.pid .
1326 Specifies the port number that
1330 Multiple options of this type are permitted.
1336 should print the date and time of the last user login when a user logs
1345 when a user logs in interactively.
1346 (On some systems it is also printed by the shell,
1352 Specifies the protocol versions
1355 The possible values are
1359 Multiple versions must be comma-separated.
1362 Protocol 1 suffers from a number of cryptographic weaknesses and should
1364 It is only offered to support legacy devices.
1366 Note that the order of the protocol list does not indicate preference,
1367 because the client selects among multiple protocol versions offered
1373 .It Cm PubkeyAcceptedKeyTypes
1374 Specifies the key types that will be accepted for public key authentication
1375 as a comma-separated pattern list.
1376 Alternately if the specified value begins with a
1378 character, then the specified key types will be appended to the default set
1379 instead of replacing them.
1380 The default for this option is:
1381 .Bd -literal -offset 3n
1382 ecdsa-sha2-nistp256-cert-v01@openssh.com,
1383 ecdsa-sha2-nistp384-cert-v01@openssh.com,
1384 ecdsa-sha2-nistp521-cert-v01@openssh.com,
1385 ssh-ed25519-cert-v01@openssh.com,
1386 ssh-rsa-cert-v01@openssh.com,
1387 ssh-dss-cert-v01@openssh.com,
1388 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,
1389 ecdsa-sha2-nistp521,ssh-ed25519,
1397 may be used to list supported key types.
1398 .It Cm PubkeyAuthentication
1399 Specifies whether public key authentication is allowed.
1403 Specifies the maximum amount of data that may be transmitted before the
1404 session key is renegotiated, optionally followed a maximum amount of
1405 time that may pass before the session key is renegotiated.
1406 The first argument is specified in bytes and may have a suffix of
1411 to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1412 The default is between
1416 depending on the cipher.
1417 The optional second value is specified in seconds and may use any of the
1418 units documented in the
1421 The default value for
1425 which means that rekeying is performed after the cipher's default amount
1426 of data has been sent or received and no time based rekeying is done.
1428 Specifies revoked public keys file, or
1431 Keys listed in this file will be refused for public key authentication.
1432 Note that if this file is not readable, then public key authentication will
1433 be refused for all users.
1434 Keys may be specified as a text file, listing one public key per line, or as
1435 an OpenSSH Key Revocation List (KRL) as generated by
1437 For more information on KRLs, see the KEY REVOCATION LISTS section in
1439 .It Cm RhostsRSAAuthentication
1440 Specifies whether rhosts or
1441 .Pa /etc/hosts.equiv
1442 authentication together
1443 with successful RSA host authentication is allowed.
1446 This option applies to protocol version 1 only.
1447 .It Cm RSAAuthentication
1448 Specifies whether pure RSA authentication is allowed.
1451 This option applies to protocol version 1 only.
1452 .It Cm ServerKeyBits
1453 Defines the number of bits in the ephemeral protocol version 1 server key.
1454 The default and minimum value is 1024.
1455 .It Cm StreamLocalBindMask
1456 Sets the octal file creation mode mask
1458 used when creating a Unix-domain socket file for local or remote
1460 This option is only used for port forwarding to a Unix-domain socket file.
1462 The default value is 0177, which creates a Unix-domain socket file that is
1463 readable and writable only by the owner.
1464 Note that not all operating systems honor the file mode on Unix-domain
1466 .It Cm StreamLocalBindUnlink
1467 Specifies whether to remove an existing Unix-domain socket file for local
1468 or remote port forwarding before creating a new one.
1469 If the socket file already exists and
1470 .Cm StreamLocalBindUnlink
1473 will be unable to forward the port to the Unix-domain socket file.
1474 This option is only used for port forwarding to a Unix-domain socket file.
1476 The argument must be
1485 should check file modes and ownership of the
1486 user's files and home directory before accepting login.
1487 This is normally desirable because novices sometimes accidentally leave their
1488 directory or files world-writable.
1491 Note that this does not apply to
1492 .Cm ChrootDirectory ,
1493 whose permissions and ownership are checked unconditionally.
1495 Configures an external subsystem (e.g. file transfer daemon).
1496 Arguments should be a subsystem name and a command (with optional arguments)
1497 to execute upon subsystem request.
1503 file transfer subsystem.
1505 Alternately the name
1507 implements an in-process
1510 This may simplify configurations using
1512 to force a different filesystem root on clients.
1514 By default no subsystems are defined.
1515 .It Cm SyslogFacility
1516 Gives the facility code that is used when logging messages from
1518 The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1519 LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1520 The default is AUTH.
1522 Specifies whether the system should send TCP keepalive messages to the
1524 If they are sent, death of the connection or crash of one
1525 of the machines will be properly noticed.
1526 However, this means that
1527 connections will die if the route is down temporarily, and some people
1529 On the other hand, if TCP keepalives are not sent,
1530 sessions may hang indefinitely on the server, leaving
1532 users and consuming server resources.
1536 (to send TCP keepalive messages), and the server will notice
1537 if the network goes down or the client host crashes.
1538 This avoids infinitely hanging sessions.
1540 To disable TCP keepalive messages, the value should be set to
1542 .It Cm TrustedUserCAKeys
1543 Specifies a file containing public keys of certificate authorities that are
1544 trusted to sign user certificates for authentication, or
1547 Keys are listed one per line; empty lines and comments starting with
1550 If a certificate is presented for authentication and has its signing CA key
1551 listed in this file, then it may be used for authentication for any user
1552 listed in the certificate's principals list.
1553 Note that certificates that lack a list of principals will not be permitted
1554 for authentication using
1555 .Cm TrustedUserCAKeys .
1556 For more details on certificates, see the CERTIFICATES section in
1561 should look up the remote host name, and to check that
1562 the resolved host name for the remote IP address maps back to the
1563 very same IP address.
1565 If this option is set to
1567 then only addresses and not host names may be used in
1568 .Pa ~/.ssh/authorized_keys
1580 is used for interactive login sessions.
1585 is never used for remote command execution.
1586 Note also, that if this is enabled,
1588 will be disabled because
1590 does not know how to handle
1594 .Cm UsePrivilegeSeparation
1595 is specified, it will be disabled after authentication.
1597 Enables the Pluggable Authentication Module interface.
1600 this will enable PAM authentication using
1601 .Cm ChallengeResponseAuthentication
1603 .Cm PasswordAuthentication
1604 in addition to PAM account and session module processing for all
1605 authentication types.
1607 Because PAM challenge-response authentication usually serves an equivalent
1608 role to password authentication, you should disable either
1609 .Cm PasswordAuthentication
1611 .Cm ChallengeResponseAuthentication.
1615 is enabled, you will not be able to run
1620 .It Cm UsePrivilegeSeparation
1623 separates privileges by creating an unprivileged child process
1624 to deal with incoming network traffic.
1625 After successful authentication, another process will be created that has
1626 the privilege of the authenticated user.
1627 The goal of privilege separation is to prevent privilege
1628 escalation by containing any corruption within the unprivileged processes.
1629 The argument must be
1635 .Cm UsePrivilegeSeparation
1638 then the pre-authentication unprivileged process is subject to additional
1642 .It Cm VersionAddendum
1643 Optionally specifies additional text to append to the SSH protocol banner
1644 sent by the server upon connection.
1646 .Dq FreeBSD-20170902 .
1649 may be used to disable this.
1650 .It Cm X11DisplayOffset
1651 Specifies the first display number available for
1654 This prevents sshd from interfering with real X11 servers.
1656 .It Cm X11Forwarding
1657 Specifies whether X11 forwarding is permitted.
1658 The argument must be
1665 When X11 forwarding is enabled, there may be additional exposure to
1666 the server and to client displays if the
1668 proxy display is configured to listen on the wildcard address (see
1670 below), though this is not the default.
1671 Additionally, the authentication spoofing and authentication data
1672 verification and substitution occur on the client side.
1673 The security risk of using X11 forwarding is that the client's X11
1674 display server may be exposed to attack when the SSH client requests
1675 forwarding (see the warnings for
1678 .Xr ssh_config 5 ) .
1679 A system administrator may have a stance in which they want to
1680 protect clients that may expose themselves to attack by unwittingly
1681 requesting X11 forwarding, which can warrant a
1685 Note that disabling X11 forwarding does not prevent users from
1686 forwarding X11 traffic, as users can always install their own forwarders.
1687 X11 forwarding is automatically disabled if
1690 .It Cm X11UseLocalhost
1693 should bind the X11 forwarding server to the loopback address or to
1694 the wildcard address.
1696 sshd binds the forwarding server to the loopback address and sets the
1697 hostname part of the
1699 environment variable to
1701 This prevents remote hosts from connecting to the proxy display.
1702 However, some older X11 clients may not function with this
1707 to specify that the forwarding server should be bound to the wildcard
1709 The argument must be
1715 .It Cm XAuthLocation
1716 Specifies the full pathname of the
1722 .Pa /usr/local/bin/xauth .
1726 command-line arguments and configuration file options that specify time
1727 may be expressed using a sequence of the form:
1729 .Ar time Op Ar qualifier ,
1733 is a positive integer value and
1735 is one of the following:
1737 .Bl -tag -width Ds -compact -offset indent
1752 Each member of the sequence is added together to calculate
1753 the total time value.
1755 Time format examples:
1757 .Bl -tag -width Ds -compact -offset indent
1759 600 seconds (10 minutes)
1763 1 hour 30 minutes (90 minutes)
1767 .It Pa /etc/ssh/sshd_config
1768 Contains configuration data for
1770 This file should be writable by root only, but it is recommended
1771 (though not necessary) that it be world-readable.
1776 OpenSSH is a derivative of the original and free
1777 ssh 1.2.12 release by Tatu Ylonen.
1778 Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1779 Theo de Raadt and Dug Song
1780 removed many bugs, re-added newer features and
1782 Markus Friedl contributed the support for SSH
1783 protocol versions 1.5 and 2.0.
1784 Niels Provos and Markus Friedl contributed support
1785 for privilege separation.