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.211 2015/08/14 15:32:41 jmc Exp $
38 .Dd $Mdocdate: August 14 2015 $
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.
74 Note that environment passing is only supported for protocol 2, and
77 environment variable is always sent whenever the client
78 requests a pseudo-terminal as it is required by the protocol.
79 Variables are specified by name, which may contain the wildcard characters
83 Multiple environment variables may be separated by whitespace or spread
87 Be warned that some environment variables could be used to bypass restricted
89 For this reason, care should be taken in the use of this directive.
90 The default is not to accept any environment variables.
92 Specifies which address family should be used by
102 .It Cm AllowAgentForwarding
105 forwarding is permitted.
108 Note that disabling agent forwarding does not improve security
109 unless users are also denied shell access, as they can always install
110 their own forwarders.
112 This keyword can be followed by a list of group name patterns, separated
114 If specified, login is allowed only for users whose primary
115 group or supplementary group list matches one of the patterns.
116 Only group names are valid; a numerical group ID is not recognized.
117 By default, login is allowed for all groups.
118 The allow/deny directives are processed in the following order:
127 for more information on patterns.
128 .It Cm AllowTcpForwarding
129 Specifies whether TCP forwarding is permitted.
130 The available options are
134 to allow TCP forwarding,
136 to prevent all TCP forwarding,
138 to allow local (from the perspective of
142 to allow remote forwarding only.
145 Note that disabling TCP forwarding does not improve security unless
146 users are also denied shell access, as they can always install their
148 .It Cm AllowStreamLocalForwarding
149 Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
150 The available options are
154 to allow StreamLocal forwarding,
156 to prevent all StreamLocal forwarding,
158 to allow local (from the perspective of
162 to allow remote forwarding only.
165 Note that disabling StreamLocal forwarding does not improve security unless
166 users are also denied shell access, as they can always install their
169 This keyword can be followed by a list of user name patterns, separated
171 If specified, login is allowed only for user names that
172 match one of the patterns.
173 Only user names are valid; a numerical user ID is not recognized.
174 By default, login is allowed for all users.
175 If the pattern takes the form USER@HOST then USER and HOST
176 are separately checked, restricting logins to particular
177 users from particular hosts.
178 The allow/deny directives are processed in the following order:
187 for more information on patterns.
188 .It Cm AuthenticationMethods
189 Specifies the authentication methods that must be successfully completed
190 for a user to be granted access.
191 This option must be followed by one or more comma-separated lists of
192 authentication method names.
193 Successful authentication requires completion of every method in at least
196 For example, an argument of
197 .Dq publickey,password publickey,keyboard-interactive
198 would require the user to complete public key authentication, followed by
199 either password or keyboard interactive authentication.
200 Only methods that are next in one or more lists are offered at each stage,
201 so for this example, it would not be possible to attempt password or
202 keyboard-interactive authentication before public key.
204 For keyboard interactive authentication it is also possible to
205 restrict authentication to a specific device by appending a
206 colon followed by the device identifier
211 depending on the server configuration.
213 .Dq keyboard-interactive:bsdauth
214 would restrict keyboard interactive authentication to the
220 method is listed more than once,
222 verifies that keys that have been used successfully are not reused for
223 subsequent authentications.
225 .Cm AuthenticationMethods
227 .Dq publickey,publickey
228 will require successful authentication using two different public keys.
230 This option is only available for SSH protocol 2 and will yield a fatal
231 error if enabled if protocol 1 is also enabled.
232 Note that each authentication method listed should also be explicitly enabled
233 in the configuration.
234 The default is not to require multiple authentication; successful completion
235 of a single authentication method is sufficient.
236 .It Cm AuthorizedKeysCommand
237 Specifies a program to be used to look up the user's public keys.
238 The program must be owned by root, not writable by group or others and
239 specified by an absolute path.
242 .Cm AuthorizedKeysCommand
243 may be provided using the following tokens, which will be expanded
244 at runtime: %% is replaced by a literal '%', %u is replaced by the
245 username being authenticated, %h is replaced by the home directory
246 of the user being authenticated, %t is replaced with the key type
247 offered for authentication, %f is replaced with the fingerprint of
248 the key, and %k is replaced with the key being offered for authentication.
249 If no arguments are specified then the username of the target user
252 The program should produce on standard output zero or
253 more lines of authorized_keys output (see AUTHORIZED_KEYS in
255 If a key supplied by AuthorizedKeysCommand does not successfully authenticate
256 and authorize the user then public key authentication continues using the usual
257 .Cm AuthorizedKeysFile
259 By default, no AuthorizedKeysCommand is run.
260 .It Cm AuthorizedKeysCommandUser
261 Specifies the user under whose account the AuthorizedKeysCommand is run.
262 It is recommended to use a dedicated user that has no other role on the host
263 than running authorized keys commands.
265 .Cm AuthorizedKeysCommand
267 .Cm AuthorizedKeysCommandUser
270 will refuse to start.
271 .It Cm AuthorizedKeysFile
272 Specifies the file that contains the public keys that can be used
273 for user authentication.
274 The format is described in the
275 AUTHORIZED_KEYS FILE FORMAT
278 .Cm AuthorizedKeysFile
279 may contain tokens of the form %T which are substituted during connection
281 The following tokens are defined: %% is replaced by a literal '%',
282 %h is replaced by the home directory of the user being authenticated, and
283 %u is replaced by the username of that user.
285 .Cm AuthorizedKeysFile
286 is taken to be an absolute path or one relative to the user's home
288 Multiple files may be listed, separated by whitespace.
290 .Dq .ssh/authorized_keys .ssh/authorized_keys2 .
291 .It Cm AuthorizedPrincipalsCommand
292 Specifies a program to be used to generate the list of allowed
293 certificate principals as per
294 .Cm AuthorizedPrincipalsFile .
295 The program must be owned by root, not writable by group or others and
296 specified by an absolute path.
299 .Cm AuthorizedPrincipalsCommand
300 may be provided using the following tokens, which will be expanded
301 at runtime: %% is replaced by a literal '%', %u is replaced by the
302 username being authenticated and %h is replaced by the home directory
303 of the user being authenticated.
305 The program should produce on standard output zero or
307 .Cm AuthorizedPrincipalsFile
310 .Cm AuthorizedPrincipalsCommand
312 .Cm AuthorizedPrincipalsFile
313 is specified, then certificates offered by the client for authentication
314 must contain a principal that is listed.
315 By default, no AuthorizedPrincipalsCommand is run.
316 .It Cm AuthorizedPrincipalsCommandUser
317 Specifies the user under whose account the AuthorizedPrincipalsCommand is run.
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
335 in AUTHORIZED_KEYS FILE FORMAT in
337 Empty lines and comments starting with
341 .Cm AuthorizedPrincipalsFile
342 may contain tokens of the form %T which are substituted during connection
344 The following tokens are defined: %% is replaced by a literal '%',
345 %h is replaced by the home directory of the user being authenticated, and
346 %u is replaced by the username of that user.
348 .Cm AuthorizedPrincipalsFile
349 is taken to be an absolute path or one relative to the user's home
354 i.e. not to use a principals file \(en in this case, the username
355 of the user must appear in a certificate's principals list for it to be
358 .Cm AuthorizedPrincipalsFile
359 is only used when authentication proceeds using a CA listed in
360 .Cm TrustedUserCAKeys
361 and is not consulted for certification authorities trusted via
362 .Pa ~/.ssh/authorized_keys ,
365 key option offers a similar facility (see
369 The contents of the specified file are sent to the remote user before
370 authentication is allowed.
373 then no banner is displayed.
374 This option is only available for protocol version 2.
375 By default, no banner is displayed.
376 .It Cm ChallengeResponseAuthentication
377 Specifies whether challenge-response authentication is allowed (e.g. via
378 PAM or through authentication styles supported in
382 .It Cm ChrootDirectory
383 Specifies the pathname of a directory to
385 to after authentication.
388 checks that all components of the pathname are root-owned directories
389 which are not writable by any other user or group.
392 changes the working directory to the user's home directory.
394 The pathname may contain the following tokens that are expanded at runtime once
395 the connecting user has been authenticated: %% is replaced by a literal '%',
396 %h is replaced by the home directory of the user being authenticated, and
397 %u is replaced by the username of that user.
401 must contain the necessary files and directories to support the
403 For an interactive session this requires at least a shell, typically
416 For file transfer sessions using
418 no additional configuration of the environment is necessary if the
419 in-process sftp server is used,
420 though sessions which use logging may require
422 inside the chroot directory on some operating systems (see
426 For safety, it is very important that the directory hierarchy be
427 prevented from modification by other processes on the system (especially
428 those outside the jail).
429 Misconfiguration can lead to unsafe environments which
433 The default is not to
436 Specifies the ciphers allowed for protocol version 2.
437 Multiple ciphers must be comma-separated.
438 If the specified value begins with a
440 character, then the specified ciphers will be appended to the default set
441 instead of replacing them.
443 The supported ciphers are:
445 .Bl -item -compact -offset indent
461 aes128-gcm@openssh.com
463 aes256-gcm@openssh.com
475 chacha20-poly1305@openssh.com
479 .Bd -literal -offset indent
480 chacha20-poly1305@openssh.com,
481 aes128-ctr,aes192-ctr,aes256-ctr,
482 aes128-gcm@openssh.com,aes256-gcm@openssh.com
485 The list of available ciphers may also be obtained using the
491 .It Cm ClientAliveCountMax
492 Sets the number of client alive messages (see below) which may be
495 receiving any messages back from the client.
496 If this threshold is reached while client alive messages are being sent,
497 sshd will disconnect the client, terminating the session.
498 It is important to note that the use of client alive messages is very
502 The client alive messages are sent through the encrypted channel
503 and therefore will not be spoofable.
504 The TCP keepalive option enabled by
507 The client alive mechanism is valuable when the client or
508 server depend on knowing when a connection has become inactive.
510 The default value is 3.
512 .Cm ClientAliveInterval
513 (see below) is set to 15, and
514 .Cm ClientAliveCountMax
515 is left at the default, unresponsive SSH clients
516 will be disconnected after approximately 45 seconds.
517 This option applies to protocol version 2 only.
518 .It Cm ClientAliveInterval
519 Sets a timeout interval in seconds after which if no data has been received
522 will send a message through the encrypted
523 channel to request a response from the client.
525 is 0, indicating that these messages will not be sent to the client.
526 This option applies to protocol version 2 only.
528 Specifies whether compression is allowed, or delayed until
529 the user has authenticated successfully.
538 This keyword can be followed by a list of group name patterns, separated
540 Login is disallowed for users whose primary group or supplementary
541 group list matches one of the patterns.
542 Only group names are valid; a numerical group ID is not recognized.
543 By default, login is allowed for all groups.
544 The allow/deny directives are processed in the following order:
553 for more information on patterns.
555 This keyword can be followed by a list of user name patterns, separated
557 Login is disallowed for user names that match one of the patterns.
558 Only user names are valid; a numerical user ID is not recognized.
559 By default, login is allowed for all users.
560 If the pattern takes the form USER@HOST then USER and HOST
561 are separately checked, restricting logins to particular
562 users from particular hosts.
563 The allow/deny directives are processed in the following order:
572 for more information on patterns.
573 .It Cm FingerprintHash
574 Specifies the hash algorithm used when logging key fingerprints.
582 Forces the execution of the command specified by
584 ignoring any command supplied by the client and
587 The command is invoked by using the user's login shell with the -c option.
588 This applies to shell, command, or subsystem execution.
589 It is most useful inside a
592 The command originally supplied by the client is available in the
593 .Ev SSH_ORIGINAL_COMMAND
594 environment variable.
595 Specifying a command of
597 will force the use of an in-process sftp server that requires no support
599 .Cm ChrootDirectory .
601 Specifies whether remote hosts are allowed to connect to ports
602 forwarded for the client.
605 binds remote port forwardings to the loopback address.
606 This prevents other remote hosts from connecting to forwarded ports.
608 can be used to specify that sshd
609 should allow remote port forwardings to bind to non-loopback addresses, thus
610 allowing other hosts to connect.
613 to force remote port forwardings to be available to the local host only,
615 to force remote port forwardings to bind to the wildcard address, or
617 to allow the client to select the address to which the forwarding is bound.
620 .It Cm GSSAPIAuthentication
621 Specifies whether user authentication based on GSSAPI is allowed.
624 Note that this option applies to protocol version 2 only.
625 .It Cm GSSAPICleanupCredentials
626 Specifies whether to automatically destroy the user's credentials cache
630 Note that this option applies to protocol version 2 only.
631 .It Cm GSSAPIStrictAcceptorCheck
632 Determines whether to be strict about the identity of the GSSAPI acceptor
633 a client authenticates against.
636 then the client must authenticate against the
638 service on the current hostname.
641 then the client may authenticate against any service key stored in the
642 machine's default store.
643 This facility is provided to assist with operation on multi homed machines.
646 .It Cm HostbasedAcceptedKeyTypes
647 Specifies the key types that will be accepted for hostbased authentication
648 as a comma-separated pattern list.
649 Alternately if the specified value begins with a
651 character, then the specified key types will be appended to the default set
652 instead of replacing them.
653 The default for this option is:
654 .Bd -literal -offset 3n
655 ecdsa-sha2-nistp256-cert-v01@openssh.com,
656 ecdsa-sha2-nistp384-cert-v01@openssh.com,
657 ecdsa-sha2-nistp521-cert-v01@openssh.com,
658 ssh-ed25519-cert-v01@openssh.com,
659 ssh-rsa-cert-v01@openssh.com,
660 ssh-dss-cert-v01@openssh.com,
661 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,
662 ecdsa-sha2-nistp521,ssh-ed25519,
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).
675 This option is similar to
676 .Cm RhostsRSAAuthentication
677 and applies to protocol version 2 only.
680 .It Cm HostbasedUsesNameFromPacketOnly
681 Specifies whether or not the server will attempt to perform a reverse
682 name lookup when matching the name in the
688 .Cm HostbasedAuthentication .
693 uses the name supplied by the client rather than
694 attempting to resolve the name from the TCP connection itself.
697 .It Cm HostCertificate
698 Specifies a file containing a public host certificate.
699 The certificate's public key must match a private host key already specified
702 The default behaviour of
704 is not to load any certificates.
706 Specifies a file containing a private host key
709 .Pa /etc/ssh/ssh_host_key
710 for protocol version 1, and
711 .Pa /etc/ssh/ssh_host_dsa_key ,
712 .Pa /etc/ssh/ssh_host_ecdsa_key ,
713 .Pa /etc/ssh/ssh_host_ed25519_key
715 .Pa /etc/ssh/ssh_host_rsa_key
716 for protocol version 2.
720 will refuse to use a file if it is group/world-accessible
722 .Cm HostKeyAlgorithms
723 option restricts which of the keys are actually used by
726 It is possible to have multiple host key files.
728 keys are used for version 1 and
734 are used for version 2 of the SSH protocol.
735 It is also possible to specify public host key files instead.
736 In this case operations on the private key will be delegated
740 Identifies the UNIX-domain socket used to communicate
741 with an agent that has access to the private host keys.
744 is specified, the location of the socket will be read from the
746 environment variable.
747 .It Cm HostKeyAlgorithms
748 Specifies the protocol version 2 host key algorithms
749 that the server offers.
750 The default for this option is:
751 .Bd -literal -offset 3n
752 ecdsa-sha2-nistp256-cert-v01@openssh.com,
753 ecdsa-sha2-nistp384-cert-v01@openssh.com,
754 ecdsa-sha2-nistp521-cert-v01@openssh.com,
755 ssh-ed25519-cert-v01@openssh.com,
756 ssh-rsa-cert-v01@openssh.com,
757 ssh-dss-cert-v01@openssh.com,
758 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,
759 ecdsa-sha2-nistp521,ssh-ed25519,
763 The list of available key types may also be obtained using the
774 files will not be used in
775 .Cm RhostsRSAAuthentication
777 .Cm HostbasedAuthentication .
781 .Pa /etc/ssh/shosts.equiv
785 .It Cm IgnoreUserKnownHosts
788 should ignore the user's
789 .Pa ~/.ssh/known_hosts
791 .Cm RhostsRSAAuthentication
793 .Cm HostbasedAuthentication .
797 Specifies the IPv4 type-of-service or DSCP class for the connection.
824 This option may take one or two arguments, separated by whitespace.
825 If one argument is specified, it is used as the packet class unconditionally.
826 If two values are specified, the first is automatically selected for
827 interactive sessions and the second for non-interactive sessions.
830 for interactive sessions and
832 for non-interactive sessions.
833 .It Cm KbdInteractiveAuthentication
834 Specifies whether to allow keyboard-interactive authentication.
835 The argument to this keyword must be
839 The default is to use whatever value
840 .Cm ChallengeResponseAuthentication
844 .It Cm KerberosAuthentication
845 Specifies whether the password provided by the user for
846 .Cm PasswordAuthentication
847 will be validated through the Kerberos KDC.
848 To use this option, the server needs a
849 Kerberos servtab which allows the verification of the KDC's identity.
852 .It Cm KerberosGetAFSToken
853 If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
854 an AFS token before accessing the user's home directory.
857 .It Cm KerberosOrLocalPasswd
858 If password authentication through Kerberos fails then
859 the password will be validated via any additional local mechanism
864 .It Cm KerberosTicketCleanup
865 Specifies whether to automatically destroy the user's ticket cache
870 Specifies the available KEX (Key Exchange) algorithms.
871 Multiple algorithms must be comma-separated.
872 Alternately if the specified value begins with a
874 character, then the specified methods will be appended to the default set
875 instead of replacing them.
876 The supported algorithms are:
878 .Bl -item -compact -offset indent
880 curve25519-sha256@libssh.org
882 diffie-hellman-group1-sha1
884 diffie-hellman-group14-sha1
886 diffie-hellman-group-exchange-sha1
888 diffie-hellman-group-exchange-sha256
898 .Bd -literal -offset indent
899 curve25519-sha256@libssh.org,
900 ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
901 diffie-hellman-group-exchange-sha256,
902 diffie-hellman-group14-sha1
905 The list of available key exchange algorithms may also be obtained using the
911 .It Cm KeyRegenerationInterval
912 In protocol version 1, the ephemeral server key is automatically regenerated
913 after this many seconds (if it has been used).
914 The purpose of regeneration is to prevent
915 decrypting captured sessions by later breaking into the machine and
917 The key is never stored anywhere.
918 If the value is 0, the key is never regenerated.
919 The default is 3600 (seconds).
921 Specifies the local addresses
924 The following forms may be used:
926 .Bl -item -offset indent -compact
930 .Ar host | Ar IPv4_addr | Ar IPv6_addr
935 .Ar host | Ar IPv4_addr : Ar port
941 .Ar host | Ar IPv6_addr Oc : Ar port
948 sshd will listen on the address and all
951 The default is to listen on all local addresses.
954 options are permitted.
955 .It Cm LoginGraceTime
956 The server disconnects after this time if the user has not
957 successfully logged in.
958 If the value is 0, there is no time limit.
959 The default is 120 seconds.
961 Gives the verbosity level that is used when logging messages from
963 The possible values are:
964 QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
966 DEBUG and DEBUG1 are equivalent.
967 DEBUG2 and DEBUG3 each specify higher levels of debugging output.
968 Logging with a DEBUG level violates the privacy of users and is not recommended.
970 Specifies the available MAC (message authentication code) algorithms.
971 The MAC algorithm is used in protocol version 2
972 for data integrity protection.
973 Multiple algorithms must be comma-separated.
974 If the specified value begins with a
976 character, then the specified algorithms will be appended to the default set
977 instead of replacing them.
979 The algorithms that contain
981 calculate the MAC after encryption (encrypt-then-mac).
982 These are considered safer and their use recommended.
983 The supported MACs are:
985 .Bl -item -compact -offset indent
1003 umac-128@openssh.com
1005 hmac-md5-etm@openssh.com
1007 hmac-md5-96-etm@openssh.com
1009 hmac-ripemd160-etm@openssh.com
1011 hmac-sha1-etm@openssh.com
1013 hmac-sha1-96-etm@openssh.com
1015 hmac-sha2-256-etm@openssh.com
1017 hmac-sha2-512-etm@openssh.com
1019 umac-64-etm@openssh.com
1021 umac-128-etm@openssh.com
1025 .Bd -literal -offset indent
1026 umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1027 hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
1028 umac-64@openssh.com,umac-128@openssh.com,
1029 hmac-sha2-256,hmac-sha2-512
1032 The list of available MAC algorithms may also be obtained using the
1039 Introduces a conditional block.
1040 If all of the criteria on the
1042 line are satisfied, the keywords on the following lines override those
1043 set in the global section of the config file, until either another
1045 line or the end of the file.
1046 If a keyword appears in multiple
1048 blocks that are satisfied, only the first instance of the keyword is
1053 are one or more criteria-pattern pairs or the single token
1055 which matches all criteria.
1056 The available criteria are
1064 The match patterns may consist of single entries or comma-separated
1065 lists and may use the wildcard and negation operators described in the
1071 criteria may additionally contain addresses to match in CIDR
1072 address/masklen format, e.g.\&
1075 .Dq 3ffe:ffff::/32 .
1076 Note that the mask length provided must be consistent with the address -
1077 it is an error to specify a mask length that is too long for the address
1078 or one with bits set in this host portion of the address.
1085 Only a subset of keywords may be used on the lines following a
1088 Available keywords are
1090 .Cm AllowAgentForwarding ,
1092 .Cm AllowStreamLocalForwarding ,
1093 .Cm AllowTcpForwarding ,
1095 .Cm AuthenticationMethods ,
1096 .Cm AuthorizedKeysCommand ,
1097 .Cm AuthorizedKeysCommandUser ,
1098 .Cm AuthorizedKeysFile ,
1099 .Cm AuthorizedPrincipalsFile ,
1101 .Cm ChrootDirectory ,
1106 .Cm GSSAPIAuthentication ,
1107 .Cm HostbasedAcceptedKeyTypes ,
1108 .Cm HostbasedAuthentication ,
1109 .Cm HostbasedUsesNameFromPacketOnly ,
1111 .Cm KbdInteractiveAuthentication ,
1112 .Cm KerberosAuthentication ,
1115 .Cm PasswordAuthentication ,
1116 .Cm PermitEmptyPasswords ,
1118 .Cm PermitRootLogin ,
1122 .Cm PubkeyAcceptedKeyTypes ,
1123 .Cm PubkeyAuthentication ,
1126 .Cm RhostsRSAAuthentication ,
1127 .Cm RSAAuthentication ,
1128 .Cm StreamLocalBindMask ,
1129 .Cm StreamLocalBindUnlink ,
1130 .Cm TrustedUserCAKeys ,
1131 .Cm X11DisplayOffset ,
1134 .Cm X11UseLocalHost .
1136 Specifies the maximum number of authentication attempts permitted per
1138 Once the number of failures reaches half this value,
1139 additional failures are logged.
1142 Specifies the maximum number of open sessions permitted per network connection.
1145 Specifies the maximum number of concurrent unauthenticated connections to the
1147 Additional connections will be dropped until authentication succeeds or the
1149 expires for a connection.
1150 The default is 10:30:100.
1152 Alternatively, random early drop can be enabled by specifying
1153 the three colon separated values
1157 will refuse connection attempts with a probability of
1160 if there are currently
1163 unauthenticated connections.
1164 The probability increases linearly and all connection attempts
1165 are refused if the number of unauthenticated connections reaches
1168 .It Cm PasswordAuthentication
1169 Specifies whether password authentication is allowed.
1174 .It Cm PermitEmptyPasswords
1175 When password authentication is allowed, it specifies whether the
1176 server allows login to accounts with empty password strings.
1180 Specifies the destinations to which TCP port forwarding is permitted.
1181 The forwarding specification must be one of the following forms:
1183 .Bl -item -offset indent -compact
1192 .Ar IPv4_addr : port
1197 .Ar \&[ IPv6_addr \&] : port
1201 Multiple forwards may be specified by separating them with whitespace.
1204 can be used to remove all restrictions and permit any forwarding requests.
1207 can be used to prohibit all forwarding requests.
1208 By default all port forwarding requests are permitted.
1209 .It Cm PermitRootLogin
1210 Specifies whether root can log in using
1212 The argument must be
1214 .Dq prohibit-password ,
1215 .Dq without-password ,
1216 .Dq forced-commands-only ,
1222 .Cm ChallengeResponseAuthentication
1225 the root user may be allowed in with its password even if
1226 .Cm PermitRootLogin is set to
1227 .Dq without-password .
1229 If this option is set to
1230 .Dq prohibit-password
1232 .Dq without-password ,
1233 password and keyboard-interactive authentication are disabled for root.
1235 If this option is set to
1236 .Dq forced-commands-only ,
1237 root login with public key authentication will be allowed,
1240 option has been specified
1241 (which may be useful for taking remote backups even if root login is
1242 normally not allowed).
1243 All other authentication methods are disabled for root.
1245 If this option is set to
1247 root is not allowed to log in.
1251 device forwarding is allowed.
1252 The argument must be
1268 Independent of this setting, the permissions of the selected
1270 device must allow access to the user.
1274 allocation is permitted.
1277 .It Cm PermitUserEnvironment
1279 .Pa ~/.ssh/environment
1283 .Pa ~/.ssh/authorized_keys
1288 Enabling environment processing may enable users to bypass access
1289 restrictions in some configurations using mechanisms such as
1292 Specifies whether any
1298 Specifies the file that contains the process ID of the
1303 .Pa /var/run/sshd.pid .
1305 Specifies the port number that
1309 Multiple options of this type are permitted.
1315 should print the date and time of the last user login when a user logs
1324 when a user logs in interactively.
1325 (On some systems it is also printed by the shell,
1331 Specifies the protocol versions
1334 The possible values are
1338 Multiple versions must be comma-separated.
1341 Note that the order of the protocol list does not indicate preference,
1342 because the client selects among multiple protocol versions offered
1348 .It Cm PubkeyAcceptedKeyTypes
1349 Specifies the key types that will be accepted for public key authentication
1350 as a comma-separated pattern list.
1351 Alternately if the specified value begins with a
1353 character, then the specified key types will be appended to the default set
1354 instead of replacing them.
1355 The default for this option is:
1356 .Bd -literal -offset 3n
1357 ecdsa-sha2-nistp256-cert-v01@openssh.com,
1358 ecdsa-sha2-nistp384-cert-v01@openssh.com,
1359 ecdsa-sha2-nistp521-cert-v01@openssh.com,
1360 ssh-ed25519-cert-v01@openssh.com,
1361 ssh-rsa-cert-v01@openssh.com,
1362 ssh-dss-cert-v01@openssh.com,
1363 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,
1364 ecdsa-sha2-nistp521,ssh-ed25519,
1372 may be used to list supported key types.
1373 .It Cm PubkeyAuthentication
1374 Specifies whether public key authentication is allowed.
1377 Note that this option applies to protocol version 2 only.
1379 Specifies the maximum amount of data that may be transmitted before the
1380 session key is renegotiated, optionally followed a maximum amount of
1381 time that may pass before the session key is renegotiated.
1382 The first argument is specified in bytes and may have a suffix of
1387 to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1388 The default is between
1392 depending on the cipher.
1393 The optional second value is specified in seconds and may use any of the
1394 units documented in the
1397 The default value for
1401 which means that rekeying is performed after the cipher's default amount
1402 of data has been sent or received and no time based rekeying is done.
1403 This option applies to protocol version 2 only.
1405 Specifies revoked public keys file, or
1408 Keys listed in this file will be refused for public key authentication.
1409 Note that if this file is not readable, then public key authentication will
1410 be refused for all users.
1411 Keys may be specified as a text file, listing one public key per line, or as
1412 an OpenSSH Key Revocation List (KRL) as generated by
1414 For more information on KRLs, see the KEY REVOCATION LISTS section in
1416 .It Cm RhostsRSAAuthentication
1417 Specifies whether rhosts or
1418 .Pa /etc/hosts.equiv
1419 authentication together
1420 with successful RSA host authentication is allowed.
1423 This option applies to protocol version 1 only.
1424 .It Cm RSAAuthentication
1425 Specifies whether pure RSA authentication is allowed.
1428 This option applies to protocol version 1 only.
1429 .It Cm ServerKeyBits
1430 Defines the number of bits in the ephemeral protocol version 1 server key.
1431 The default and minimum value is 1024.
1432 .It Cm StreamLocalBindMask
1433 Sets the octal file creation mode mask
1435 used when creating a Unix-domain socket file for local or remote
1437 This option is only used for port forwarding to a Unix-domain socket file.
1439 The default value is 0177, which creates a Unix-domain socket file that is
1440 readable and writable only by the owner.
1441 Note that not all operating systems honor the file mode on Unix-domain
1443 .It Cm StreamLocalBindUnlink
1444 Specifies whether to remove an existing Unix-domain socket file for local
1445 or remote port forwarding before creating a new one.
1446 If the socket file already exists and
1447 .Cm StreamLocalBindUnlink
1450 will be unable to forward the port to the Unix-domain socket file.
1451 This option is only used for port forwarding to a Unix-domain socket file.
1453 The argument must be
1462 should check file modes and ownership of the
1463 user's files and home directory before accepting login.
1464 This is normally desirable because novices sometimes accidentally leave their
1465 directory or files world-writable.
1468 Note that this does not apply to
1469 .Cm ChrootDirectory ,
1470 whose permissions and ownership are checked unconditionally.
1472 Configures an external subsystem (e.g. file transfer daemon).
1473 Arguments should be a subsystem name and a command (with optional arguments)
1474 to execute upon subsystem request.
1480 file transfer subsystem.
1482 Alternately the name
1484 implements an in-process
1487 This may simplify configurations using
1489 to force a different filesystem root on clients.
1491 By default no subsystems are defined.
1492 Note that this option applies to protocol version 2 only.
1493 .It Cm SyslogFacility
1494 Gives the facility code that is used when logging messages from
1496 The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1497 LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1498 The default is AUTH.
1500 Specifies whether the system should send TCP keepalive messages to the
1502 If they are sent, death of the connection or crash of one
1503 of the machines will be properly noticed.
1504 However, this means that
1505 connections will die if the route is down temporarily, and some people
1507 On the other hand, if TCP keepalives are not sent,
1508 sessions may hang indefinitely on the server, leaving
1510 users and consuming server resources.
1514 (to send TCP keepalive messages), and the server will notice
1515 if the network goes down or the client host crashes.
1516 This avoids infinitely hanging sessions.
1518 To disable TCP keepalive messages, the value should be set to
1520 .It Cm TrustedUserCAKeys
1521 Specifies a file containing public keys of certificate authorities that are
1522 trusted to sign user certificates for authentication, or
1525 Keys are listed one per line; empty lines and comments starting with
1528 If a certificate is presented for authentication and has its signing CA key
1529 listed in this file, then it may be used for authentication for any user
1530 listed in the certificate's principals list.
1531 Note that certificates that lack a list of principals will not be permitted
1532 for authentication using
1533 .Cm TrustedUserCAKeys .
1534 For more details on certificates, see the CERTIFICATES section in
1539 should look up the remote host name, and to check that
1540 the resolved host name for the remote IP address maps back to the
1541 very same IP address.
1543 If this option is set to
1545 then only addresses and not host names may be used in
1546 .Pa ~/.ssh/known_hosts
1558 is used for interactive login sessions.
1563 is never used for remote command execution.
1564 Note also, that if this is enabled,
1566 will be disabled because
1568 does not know how to handle
1572 .Cm UsePrivilegeSeparation
1573 is specified, it will be disabled after authentication.
1575 Enables the Pluggable Authentication Module interface.
1578 this will enable PAM authentication using
1579 .Cm ChallengeResponseAuthentication
1581 .Cm PasswordAuthentication
1582 in addition to PAM account and session module processing for all
1583 authentication types.
1585 Because PAM challenge-response authentication usually serves an equivalent
1586 role to password authentication, you should disable either
1587 .Cm PasswordAuthentication
1589 .Cm ChallengeResponseAuthentication.
1593 is enabled, you will not be able to run
1598 .It Cm UsePrivilegeSeparation
1601 separates privileges by creating an unprivileged child process
1602 to deal with incoming network traffic.
1603 After successful authentication, another process will be created that has
1604 the privilege of the authenticated user.
1605 The goal of privilege separation is to prevent privilege
1606 escalation by containing any corruption within the unprivileged processes.
1610 .Cm UsePrivilegeSeparation
1613 then the pre-authentication unprivileged process is subject to additional
1615 .It Cm VersionAddendum
1616 Optionally specifies additional text to append to the SSH protocol banner
1617 sent by the server upon connection.
1619 .Dq FreeBSD-20160125 .
1622 may be used to disable this.
1623 .It Cm X11DisplayOffset
1624 Specifies the first display number available for
1627 This prevents sshd from interfering with real X11 servers.
1629 .It Cm X11Forwarding
1630 Specifies whether X11 forwarding is permitted.
1631 The argument must be
1638 When X11 forwarding is enabled, there may be additional exposure to
1639 the server and to client displays if the
1641 proxy display is configured to listen on the wildcard address (see
1643 below), though this is not the default.
1644 Additionally, the authentication spoofing and authentication data
1645 verification and substitution occur on the client side.
1646 The security risk of using X11 forwarding is that the client's X11
1647 display server may be exposed to attack when the SSH client requests
1648 forwarding (see the warnings for
1651 .Xr ssh_config 5 ) .
1652 A system administrator may have a stance in which they want to
1653 protect clients that may expose themselves to attack by unwittingly
1654 requesting X11 forwarding, which can warrant a
1658 Note that disabling X11 forwarding does not prevent users from
1659 forwarding X11 traffic, as users can always install their own forwarders.
1660 X11 forwarding is automatically disabled if
1663 .It Cm X11UseLocalhost
1666 should bind the X11 forwarding server to the loopback address or to
1667 the wildcard address.
1669 sshd binds the forwarding server to the loopback address and sets the
1670 hostname part of the
1672 environment variable to
1674 This prevents remote hosts from connecting to the proxy display.
1675 However, some older X11 clients may not function with this
1680 to specify that the forwarding server should be bound to the wildcard
1682 The argument must be
1688 .It Cm XAuthLocation
1689 Specifies the full pathname of the
1695 .Pa /usr/local/bin/xauth .
1699 command-line arguments and configuration file options that specify time
1700 may be expressed using a sequence of the form:
1702 .Ar time Op Ar qualifier ,
1706 is a positive integer value and
1708 is one of the following:
1710 .Bl -tag -width Ds -compact -offset indent
1725 Each member of the sequence is added together to calculate
1726 the total time value.
1728 Time format examples:
1730 .Bl -tag -width Ds -compact -offset indent
1732 600 seconds (10 minutes)
1736 1 hour 30 minutes (90 minutes)
1740 .It Pa /etc/ssh/sshd_config
1741 Contains configuration data for
1743 This file should be writable by root only, but it is recommended
1744 (though not necessary) that it be world-readable.
1749 OpenSSH is a derivative of the original and free
1750 ssh 1.2.12 release by Tatu Ylonen.
1751 Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1752 Theo de Raadt and Dug Song
1753 removed many bugs, re-added newer features and
1755 Markus Friedl contributed the support for SSH
1756 protocol versions 1.5 and 2.0.
1757 Niels Provos and Markus Friedl contributed support
1758 for privilege separation.