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.253 2017/09/27 06:45:53 jmc Exp $
37 .Dd $Mdocdate: September 27 2017 $
42 .Nd OpenSSH SSH daemon configuration file
45 reads configuration data from
46 .Pa /etc/ssh/sshd_config
47 (or the file specified with
50 The file contains keyword-argument pairs, one per line.
53 and empty lines are interpreted as comments.
54 Arguments may optionally be enclosed in double quotes
56 in order to represent arguments containing spaces.
59 keywords and their meanings are as follows (note that
60 keywords are case-insensitive and arguments are case-sensitive):
63 Specifies what environment variables sent by the client will be copied into
70 for how to configure the client.
73 environment variable is always sent whenever the client
74 requests a pseudo-terminal as it is required by the protocol.
75 Variables are specified by name, which may contain the wildcard characters
79 Multiple environment variables may be separated by whitespace or spread
83 Be warned that some environment variables could be used to bypass restricted
85 For this reason, care should be taken in the use of this directive.
86 The default is not to accept any environment variables.
88 Specifies which address family should be used by
97 .It Cm AllowAgentForwarding
100 forwarding is permitted.
103 Note that disabling agent forwarding does not improve security
104 unless users are also denied shell access, as they can always install
105 their own forwarders.
107 This keyword can be followed by a list of group name patterns, separated
109 If specified, login is allowed only for users whose primary
110 group or supplementary group list matches one of the patterns.
111 Only group names are valid; a numerical group ID is not recognized.
112 By default, login is allowed for all groups.
113 The allow/deny directives are processed in the following order:
122 for more information on patterns.
123 .It Cm AllowStreamLocalForwarding
124 Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
125 The available options are
130 to allow StreamLocal forwarding,
132 to prevent all StreamLocal forwarding,
134 to allow local (from the perspective of
138 to allow remote forwarding only.
139 Note that disabling StreamLocal forwarding does not improve security unless
140 users are also denied shell access, as they can always install their
142 .It Cm AllowTcpForwarding
143 Specifies whether TCP forwarding is permitted.
144 The available options are
149 to allow TCP forwarding,
151 to prevent all TCP forwarding,
153 to allow local (from the perspective of
157 to allow remote forwarding only.
158 Note that disabling TCP forwarding does not improve security unless
159 users are also denied shell access, as they can always install their
162 This keyword can be followed by a list of user name patterns, separated
164 If specified, login is allowed only for user names that
165 match one of the patterns.
166 Only user names are valid; a numerical user ID is not recognized.
167 By default, login is allowed for all users.
168 If the pattern takes the form USER@HOST then USER and HOST
169 are separately checked, restricting logins to particular
170 users from particular hosts.
171 HOST criteria may additionally contain addresses to match in CIDR
172 address/masklen format.
173 The allow/deny directives are processed in the following order:
182 for more information on patterns.
183 .It Cm AuthenticationMethods
184 Specifies the authentication methods that must be successfully completed
185 for a user to be granted access.
186 This option must be followed by one or more comma-separated lists of
187 authentication method names, or by the single string
189 to indicate the default behaviour of accepting any single authentication
191 If the default is overridden, then successful authentication requires
192 completion of every method in at least one of these lists.
195 .Qq publickey,password publickey,keyboard-interactive
196 would require the user to complete public key authentication, followed by
197 either password or keyboard interactive authentication.
198 Only methods that are next in one or more lists are offered at each stage,
199 so for this example it would not be possible to attempt password or
200 keyboard-interactive authentication before public key.
202 For keyboard interactive authentication it is also possible to
203 restrict authentication to a specific device by appending a
204 colon followed by the device identifier
209 depending on the server configuration.
211 .Qq keyboard-interactive:bsdauth
212 would restrict keyboard interactive authentication to the
216 If the publickey method is listed more than once,
218 verifies that keys that have been used successfully are not reused for
219 subsequent authentications.
221 .Qq publickey,publickey
222 requires successful authentication using two different public keys.
224 Note that each authentication method listed should also be explicitly enabled
225 in the configuration.
227 The available authentication methods are:
228 .Qq gssapi-with-mic ,
230 .Qq keyboard-interactive ,
232 (used for access to password-less accounts when
233 .Cm PermitEmptyPassword
238 .It Cm AuthorizedKeysCommand
239 Specifies a program to be used to look up the user's public keys.
240 The program must be owned by root, not writable by group or others and
241 specified by an absolute path.
243 .Cm AuthorizedKeysCommand
244 accept the tokens described in the
247 If no arguments are specified then the username of the target user is used.
249 The program should produce on standard output zero or
250 more lines of authorized_keys output (see
255 .Cm AuthorizedKeysCommand
256 does not successfully authenticate
257 and authorize the user then public key authentication continues using the usual
258 .Cm AuthorizedKeysFile
261 .Cm AuthorizedKeysCommand
263 .It Cm AuthorizedKeysCommandUser
264 Specifies the user under whose account the
265 .Cm AuthorizedKeysCommand
267 It is recommended to use a dedicated user that has no other role on the host
268 than running authorized keys commands.
270 .Cm AuthorizedKeysCommand
272 .Cm AuthorizedKeysCommandUser
275 will refuse to start.
276 .It Cm AuthorizedKeysFile
277 Specifies the file that contains the public keys used for user authentication.
278 The format is described in the
279 .Sx AUTHORIZED_KEYS FILE FORMAT
283 .Cm AuthorizedKeysFile
284 accept the tokens described in the
288 .Cm AuthorizedKeysFile
289 is taken to be an absolute path or one relative to the user's home
291 Multiple files may be listed, separated by whitespace.
292 Alternately this option may be set to
294 to skip checking for user keys in files.
296 .Qq .ssh/authorized_keys .ssh/authorized_keys2 .
297 .It Cm AuthorizedPrincipalsCommand
298 Specifies a program to be used to generate the list of allowed
299 certificate principals as per
300 .Cm AuthorizedPrincipalsFile .
301 The program must be owned by root, not writable by group or others and
302 specified by an absolute path.
304 .Cm AuthorizedPrincipalsCommand
305 accept the tokens described in the
308 If no arguments are specified then the username of the target user is used.
310 The program should produce on standard output zero or
312 .Cm AuthorizedPrincipalsFile
315 .Cm AuthorizedPrincipalsCommand
317 .Cm AuthorizedPrincipalsFile
318 is specified, then certificates offered by the client for authentication
319 must contain a principal that is listed.
321 .Cm AuthorizedPrincipalsCommand
323 .It Cm AuthorizedPrincipalsCommandUser
324 Specifies the user under whose account the
325 .Cm AuthorizedPrincipalsCommand
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 in
344 .Sx AUTHORIZED_KEYS FILE FORMAT
347 Empty lines and comments starting with
352 .Cm AuthorizedPrincipalsFile
353 accept the tokens described in the
357 .Cm AuthorizedPrincipalsFile
358 is taken to be an absolute path or one relative to the user's home directory.
361 i.e. not to use a principals file \(en in this case, the username
362 of the user must appear in a certificate's principals list for it to be
366 .Cm AuthorizedPrincipalsFile
367 is only used when authentication proceeds using a CA listed in
368 .Cm TrustedUserCAKeys
369 and is not consulted for certification authorities trusted via
370 .Pa ~/.ssh/authorized_keys ,
373 key option offers a similar facility (see
377 The contents of the specified file are sent to the remote user before
378 authentication is allowed.
381 then no banner is displayed.
382 By default, no banner is displayed.
383 .It Cm ChallengeResponseAuthentication
384 Specifies whether challenge-response authentication is allowed (e.g. via
385 PAM or through authentication styles supported in
389 .It Cm ChrootDirectory
390 Specifies the pathname of a directory to
392 to after authentication.
395 checks that all components of the pathname are root-owned directories
396 which are not writable by any other user or group.
399 changes the working directory to the user's home directory.
402 accept the tokens described in the
408 must contain the necessary files and directories to support the
410 For an interactive session this requires at least a shell, typically
423 For file transfer sessions using SFTP
424 no additional configuration of the environment is necessary if the in-process
426 though sessions which use logging may require
428 inside the chroot directory on some operating systems (see
432 For safety, it is very important that the directory hierarchy be
433 prevented from modification by other processes on the system (especially
434 those outside the jail).
435 Misconfiguration can lead to unsafe environments which
444 Specifies the ciphers allowed.
445 Multiple ciphers must be comma-separated.
446 If the specified value begins with a
448 character, then the specified ciphers will be appended to the default set
449 instead of replacing them.
450 If the specified value begins with a
452 character, then the specified ciphers (including wildcards) will be removed
453 from the default set instead of replacing them.
455 The supported ciphers are:
457 .Bl -item -compact -offset indent
473 aes128-gcm@openssh.com
475 aes256-gcm@openssh.com
477 chacha20-poly1305@openssh.com
481 .Bd -literal -offset indent
482 chacha20-poly1305@openssh.com,
483 aes128-ctr,aes192-ctr,aes256-ctr,
484 aes128-gcm@openssh.com,aes256-gcm@openssh.com
487 The list of available ciphers may also be obtained using
489 .It Cm ClientAliveCountMax
490 Sets the number of client alive messages which may be sent without
492 receiving any messages back from the client.
493 If this threshold is reached while client alive messages are being sent,
494 sshd will disconnect the client, terminating the session.
495 It is important to note that the use of client alive messages is very
498 The client alive messages are sent through the encrypted channel
499 and therefore will not be spoofable.
500 The TCP keepalive option enabled by
503 The client alive mechanism is valuable when the client or
504 server depend on knowing when a connection has become inactive.
506 The default value is 3.
508 .Cm ClientAliveInterval
510 .Cm ClientAliveCountMax
511 is left at the default, unresponsive SSH clients
512 will be disconnected after approximately 45 seconds.
513 .It Cm ClientAliveInterval
514 Sets a timeout interval in seconds after which if no data has been received
517 will send a message through the encrypted
518 channel to request a response from the client.
520 is 0, indicating that these messages will not be sent to the client.
522 Specifies whether compression is enabled after
523 the user has authenticated successfully.
527 (a legacy synonym for
534 This keyword can be followed by a list of group name patterns, separated
536 Login is disallowed for users whose primary group or supplementary
537 group list matches one of the patterns.
538 Only group names are valid; a numerical group ID is not recognized.
539 By default, login is allowed for all groups.
540 The allow/deny directives are processed in the following order:
549 for more information on patterns.
551 This keyword can be followed by a list of user name patterns, separated
553 Login is disallowed for user names that match one of the patterns.
554 Only user names are valid; a numerical user ID is not recognized.
555 By default, login is allowed for all users.
556 If the pattern takes the form USER@HOST then USER and HOST
557 are separately checked, restricting logins to particular
558 users from particular hosts.
559 HOST criteria may additionally contain addresses to match in CIDR
560 address/masklen format.
561 The allow/deny directives are processed in the following order:
570 for more information on patterns.
571 .It Cm DisableForwarding
572 Disables all forwarding features, including X11,
575 This option overrides all other forwarding-related options and may
576 simplify restricted configurations.
577 .It Cm ExposeAuthInfo
578 Writes a temporary file containing a list of authentication methods and
579 public credentials (e.g. keys) used to authenticate the user.
580 The location of the file is exposed to the user session through the
582 environment variable.
585 .It Cm FingerprintHash
586 Specifies the hash algorithm used when logging key fingerprints.
594 Forces the execution of the command specified by
596 ignoring any command supplied by the client and
599 The command is invoked by using the user's login shell with the -c option.
600 This applies to shell, command, or subsystem execution.
601 It is most useful inside a
604 The command originally supplied by the client is available in the
605 .Ev SSH_ORIGINAL_COMMAND
606 environment variable.
607 Specifying a command of
609 will force the use of an in-process SFTP server that requires no support
611 .Cm ChrootDirectory .
615 Specifies whether remote hosts are allowed to connect to ports
616 forwarded for the client.
619 binds remote port forwardings to the loopback address.
620 This prevents other remote hosts from connecting to forwarded ports.
622 can be used to specify that sshd
623 should allow remote port forwardings to bind to non-loopback addresses, thus
624 allowing other hosts to connect.
627 to force remote port forwardings to be available to the local host only,
629 to force remote port forwardings to bind to the wildcard address, or
631 to allow the client to select the address to which the forwarding is bound.
634 .It Cm GSSAPIAuthentication
635 Specifies whether user authentication based on GSSAPI is allowed.
638 .It Cm GSSAPICleanupCredentials
639 Specifies whether to automatically destroy the user's credentials cache
643 .It Cm GSSAPIStrictAcceptorCheck
644 Determines whether to be strict about the identity of the GSSAPI acceptor
645 a client authenticates against.
648 then the client must authenticate against the host
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 If the specified value begins with a
666 character, then the specified key types (including wildcards) will be removed
667 from the default set instead of replacing them.
668 The default for this option is:
669 .Bd -literal -offset 3n
670 ecdsa-sha2-nistp256-cert-v01@openssh.com,
671 ecdsa-sha2-nistp384-cert-v01@openssh.com,
672 ecdsa-sha2-nistp521-cert-v01@openssh.com,
673 ssh-ed25519-cert-v01@openssh.com,
674 ssh-rsa-cert-v01@openssh.com,
675 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
679 The list of available key types may also be obtained using
681 .It Cm HostbasedAuthentication
682 Specifies whether rhosts or /etc/hosts.equiv authentication together
683 with successful public key client host authentication is allowed
684 (host-based authentication).
687 .It Cm HostbasedUsesNameFromPacketOnly
688 Specifies whether or not the server will attempt to perform a reverse
689 name lookup when matching the name in the
695 .Cm HostbasedAuthentication .
700 uses the name supplied by the client rather than
701 attempting to resolve the name from the TCP connection itself.
704 .It Cm HostCertificate
705 Specifies a file containing a public host certificate.
706 The certificate's public key must match a private host key already specified
709 The default behaviour of
711 is not to load any certificates.
713 Specifies a file containing a private host key
716 .Pa /etc/ssh/ssh_host_dsa_key ,
717 .Pa /etc/ssh/ssh_host_ecdsa_key ,
718 .Pa /etc/ssh/ssh_host_ed25519_key
720 .Pa /etc/ssh/ssh_host_rsa_key .
724 will refuse to use a file if it is group/world-accessible
726 .Cm HostKeyAlgorithms
727 option restricts which of the keys are actually used by
730 It is possible to have multiple host key files.
731 It is also possible to specify public host key files instead.
732 In this case operations on the private key will be delegated
736 Identifies the UNIX-domain socket used to communicate
737 with an agent that has access to the private host keys.
740 is specified, the location of the socket will be read from the
742 environment variable.
743 .It Cm HostKeyAlgorithms
744 Specifies the host key algorithms
745 that the server offers.
746 The default for this option is:
747 .Bd -literal -offset 3n
748 ecdsa-sha2-nistp256-cert-v01@openssh.com,
749 ecdsa-sha2-nistp384-cert-v01@openssh.com,
750 ecdsa-sha2-nistp521-cert-v01@openssh.com,
751 ssh-ed25519-cert-v01@openssh.com,
752 ssh-rsa-cert-v01@openssh.com,
753 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
757 The list of available key types may also be obtained using
764 files will not be used in
765 .Cm HostbasedAuthentication .
769 .Pa /etc/shosts.equiv
773 .It Cm IgnoreUserKnownHosts
776 should ignore the user's
777 .Pa ~/.ssh/known_hosts
779 .Cm HostbasedAuthentication .
783 Specifies the IPv4 type-of-service or DSCP class for the connection.
811 to use the operating system default.
812 This option may take one or two arguments, separated by whitespace.
813 If one argument is specified, it is used as the packet class unconditionally.
814 If two values are specified, the first is automatically selected for
815 interactive sessions and the second for non-interactive sessions.
818 for interactive sessions and
820 for non-interactive sessions.
821 .It Cm KbdInteractiveAuthentication
822 Specifies whether to allow keyboard-interactive authentication.
823 The argument to this keyword must be
827 The default is to use whatever value
828 .Cm ChallengeResponseAuthentication
832 .It Cm KerberosAuthentication
833 Specifies whether the password provided by the user for
834 .Cm PasswordAuthentication
835 will be validated through the Kerberos KDC.
836 To use this option, the server needs a
837 Kerberos servtab which allows the verification of the KDC's identity.
840 .It Cm KerberosGetAFSToken
841 If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
842 an AFS token before accessing the user's home directory.
845 .It Cm KerberosOrLocalPasswd
846 If password authentication through Kerberos fails then
847 the password will be validated via any additional local mechanism
852 .It Cm KerberosTicketCleanup
853 Specifies whether to automatically destroy the user's ticket cache
858 Specifies the available KEX (Key Exchange) algorithms.
859 Multiple algorithms must be comma-separated.
860 Alternately if the specified value begins with a
862 character, then the specified methods will be appended to the default set
863 instead of replacing them.
864 If the specified value begins with a
866 character, then the specified methods (including wildcards) will be removed
867 from the default set instead of replacing them.
868 The supported algorithms are:
870 .Bl -item -compact -offset indent
874 curve25519-sha256@libssh.org
876 diffie-hellman-group1-sha1
878 diffie-hellman-group14-sha1
880 diffie-hellman-group-exchange-sha1
882 diffie-hellman-group-exchange-sha256
892 .Bd -literal -offset indent
893 curve25519-sha256,curve25519-sha256@libssh.org,
894 ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
895 diffie-hellman-group-exchange-sha256,
896 diffie-hellman-group14-sha1
899 The list of available key exchange algorithms may also be obtained using
902 Specifies the local addresses
905 The following forms may be used:
907 .Bl -item -offset indent -compact
911 .Ar host | Ar IPv4_addr | Ar IPv6_addr
916 .Ar host | Ar IPv4_addr : Ar port
922 .Ar host | Ar IPv6_addr Oc : Ar port
929 sshd will listen on the address and all
932 The default is to listen on all local addresses.
935 options are permitted.
936 .It Cm LoginGraceTime
937 The server disconnects after this time if the user has not
938 successfully logged in.
939 If the value is 0, there is no time limit.
940 The default is 120 seconds.
942 Gives the verbosity level that is used when logging messages from
944 The possible values are:
945 QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
947 DEBUG and DEBUG1 are equivalent.
948 DEBUG2 and DEBUG3 each specify higher levels of debugging output.
949 Logging with a DEBUG level violates the privacy of users and is not recommended.
951 Specifies the available MAC (message authentication code) algorithms.
952 The MAC algorithm is used for data integrity protection.
953 Multiple algorithms must be comma-separated.
954 If the specified value begins with a
956 character, then the specified algorithms will be appended to the default set
957 instead of replacing them.
958 If the specified value begins with a
960 character, then the specified algorithms (including wildcards) will be removed
961 from the default set instead of replacing them.
963 The algorithms that contain
965 calculate the MAC after encryption (encrypt-then-mac).
966 These are considered safer and their use recommended.
967 The supported MACs are:
969 .Bl -item -compact -offset indent
987 hmac-md5-etm@openssh.com
989 hmac-md5-96-etm@openssh.com
991 hmac-sha1-etm@openssh.com
993 hmac-sha1-96-etm@openssh.com
995 hmac-sha2-256-etm@openssh.com
997 hmac-sha2-512-etm@openssh.com
999 umac-64-etm@openssh.com
1001 umac-128-etm@openssh.com
1005 .Bd -literal -offset indent
1006 umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1007 hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
1008 hmac-sha1-etm@openssh.com,
1009 umac-64@openssh.com,umac-128@openssh.com,
1010 hmac-sha2-256,hmac-sha2-512,hmac-sha1
1013 The list of available MAC algorithms may also be obtained using
1016 Introduces a conditional block.
1017 If all of the criteria on the
1019 line are satisfied, the keywords on the following lines override those
1020 set in the global section of the config file, until either another
1022 line or the end of the file.
1023 If a keyword appears in multiple
1025 blocks that are satisfied, only the first instance of the keyword is
1030 are one or more criteria-pattern pairs or the single token
1032 which matches all criteria.
1033 The available criteria are
1041 The match patterns may consist of single entries or comma-separated
1042 lists and may use the wildcard and negation operators described in the
1049 criteria may additionally contain addresses to match in CIDR
1050 address/masklen format,
1051 such as 192.0.2.0/24 or 2001:db8::/32.
1052 Note that the mask length provided must be consistent with the address -
1053 it is an error to specify a mask length that is too long for the address
1054 or one with bits set in this host portion of the address.
1055 For example, 192.0.2.0/33 and 192.0.2.0/8, respectively.
1057 Only a subset of keywords may be used on the lines following a
1060 Available keywords are
1062 .Cm AllowAgentForwarding ,
1064 .Cm AllowStreamLocalForwarding ,
1065 .Cm AllowTcpForwarding ,
1067 .Cm AuthenticationMethods ,
1068 .Cm AuthorizedKeysCommand ,
1069 .Cm AuthorizedKeysCommandUser ,
1070 .Cm AuthorizedKeysFile ,
1071 .Cm AuthorizedPrincipalsCommand ,
1072 .Cm AuthorizedPrincipalsCommandUser ,
1073 .Cm AuthorizedPrincipalsFile ,
1075 .Cm ChrootDirectory ,
1076 .Cm ClientAliveCountMax ,
1077 .Cm ClientAliveInterval ,
1082 .Cm GSSAPIAuthentication ,
1083 .Cm HostbasedAcceptedKeyTypes ,
1084 .Cm HostbasedAuthentication ,
1085 .Cm HostbasedUsesNameFromPacketOnly ,
1087 .Cm KbdInteractiveAuthentication ,
1088 .Cm KerberosAuthentication ,
1092 .Cm PasswordAuthentication ,
1093 .Cm PermitEmptyPasswords ,
1095 .Cm PermitRootLogin ,
1099 .Cm PubkeyAcceptedKeyTypes ,
1100 .Cm PubkeyAuthentication ,
1103 .Cm StreamLocalBindMask ,
1104 .Cm StreamLocalBindUnlink ,
1105 .Cm TrustedUserCAKeys ,
1106 .Cm X11DisplayOffset ,
1109 .Cm X11UseLocalHost .
1111 Specifies the maximum number of authentication attempts permitted per
1113 Once the number of failures reaches half this value,
1114 additional failures are logged.
1117 Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1118 sessions permitted per network connection.
1119 Multiple sessions may be established by clients that support connection
1123 to 1 will effectively disable session multiplexing, whereas setting it to 0
1124 will prevent all shell, login and subsystem sessions while still permitting
1128 Specifies the maximum number of concurrent unauthenticated connections to the
1130 Additional connections will be dropped until authentication succeeds or the
1132 expires for a connection.
1133 The default is 10:30:100.
1135 Alternatively, random early drop can be enabled by specifying
1136 the three colon separated values
1137 start:rate:full (e.g. "10:30:60").
1139 will refuse connection attempts with a probability of rate/100 (30%)
1140 if there are currently start (10) unauthenticated connections.
1141 The probability increases linearly and all connection attempts
1142 are refused if the number of unauthenticated connections reaches full (60).
1143 .It Cm PasswordAuthentication
1144 Specifies whether password authentication is allowed.
1147 .It Cm PermitEmptyPasswords
1148 When password authentication is allowed, it specifies whether the
1149 server allows login to accounts with empty password strings.
1153 Specifies the destinations to which TCP port forwarding is permitted.
1154 The forwarding specification must be one of the following forms:
1156 .Bl -item -offset indent -compact
1165 .Ar IPv4_addr : port
1170 .Ar \&[ IPv6_addr \&] : port
1174 Multiple forwards may be specified by separating them with whitespace.
1177 can be used to remove all restrictions and permit any forwarding requests.
1180 can be used to prohibit all forwarding requests.
1183 can be used for host or port to allow all hosts or ports, respectively.
1184 By default all port forwarding requests are permitted.
1185 .It Cm PermitRootLogin
1186 Specifies whether root can log in using
1188 The argument must be
1190 .Cm prohibit-password ,
1191 .Cm without-password ,
1192 .Cm forced-commands-only ,
1196 .Cm prohibit-password .
1198 If this option is set to
1199 .Cm prohibit-password
1201 .Cm without-password ,
1202 password and keyboard-interactive authentication are disabled for root.
1204 If this option is set to
1205 .Cm forced-commands-only ,
1206 root login with public key authentication will be allowed,
1209 option has been specified
1210 (which may be useful for taking remote backups even if root login is
1211 normally not allowed).
1212 All other authentication methods are disabled for root.
1214 If this option is set to
1216 root is not allowed to log in.
1220 allocation is permitted.
1226 device forwarding is allowed.
1227 The argument must be
1243 Independent of this setting, the permissions of the selected
1245 device must allow access to the user.
1246 .It Cm PermitUserEnvironment
1248 .Pa ~/.ssh/environment
1252 .Pa ~/.ssh/authorized_keys
1257 Enabling environment processing may enable users to bypass access
1258 restrictions in some configurations using mechanisms such as
1261 Specifies whether any
1267 Specifies the file that contains the process ID of the
1272 .Pa /var/run/sshd.pid .
1274 Specifies the port number that
1278 Multiple options of this type are permitted.
1284 should print the date and time of the last user login when a user logs
1293 when a user logs in interactively.
1294 (On some systems it is also printed by the shell,
1299 .It Cm PubkeyAcceptedKeyTypes
1300 Specifies the key types that will be accepted for public key authentication
1301 as a comma-separated pattern list.
1302 Alternately if the specified value begins with a
1304 character, then the specified key types will be appended to the default set
1305 instead of replacing them.
1306 If the specified value begins with a
1308 character, then the specified key types (including wildcards) will be removed
1309 from the default set instead of replacing them.
1310 The default for this option is:
1311 .Bd -literal -offset 3n
1312 ecdsa-sha2-nistp256-cert-v01@openssh.com,
1313 ecdsa-sha2-nistp384-cert-v01@openssh.com,
1314 ecdsa-sha2-nistp521-cert-v01@openssh.com,
1315 ssh-ed25519-cert-v01@openssh.com,
1316 ssh-rsa-cert-v01@openssh.com,
1317 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1321 The list of available key types may also be obtained using
1323 .It Cm PubkeyAuthentication
1324 Specifies whether public key authentication is allowed.
1328 Specifies the maximum amount of data that may be transmitted before the
1329 session key is renegotiated, optionally followed a maximum amount of
1330 time that may pass before the session key is renegotiated.
1331 The first argument is specified in bytes and may have a suffix of
1336 to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1337 The default is between
1341 depending on the cipher.
1342 The optional second value is specified in seconds and may use any of the
1343 units documented in the
1346 The default value for
1350 which means that rekeying is performed after the cipher's default amount
1351 of data has been sent or received and no time based rekeying is done.
1353 Specifies revoked public keys file, or
1356 Keys listed in this file will be refused for public key authentication.
1357 Note that if this file is not readable, then public key authentication will
1358 be refused for all users.
1359 Keys may be specified as a text file, listing one public key per line, or as
1360 an OpenSSH Key Revocation List (KRL) as generated by
1362 For more information on KRLs, see the KEY REVOCATION LISTS section in
1364 .It Cm StreamLocalBindMask
1365 Sets the octal file creation mode mask
1367 used when creating a Unix-domain socket file for local or remote
1369 This option is only used for port forwarding to a Unix-domain socket file.
1371 The default value is 0177, which creates a Unix-domain socket file that is
1372 readable and writable only by the owner.
1373 Note that not all operating systems honor the file mode on Unix-domain
1375 .It Cm StreamLocalBindUnlink
1376 Specifies whether to remove an existing Unix-domain socket file for local
1377 or remote port forwarding before creating a new one.
1378 If the socket file already exists and
1379 .Cm StreamLocalBindUnlink
1382 will be unable to forward the port to the Unix-domain socket file.
1383 This option is only used for port forwarding to a Unix-domain socket file.
1385 The argument must be
1394 should check file modes and ownership of the
1395 user's files and home directory before accepting login.
1396 This is normally desirable because novices sometimes accidentally leave their
1397 directory or files world-writable.
1400 Note that this does not apply to
1401 .Cm ChrootDirectory ,
1402 whose permissions and ownership are checked unconditionally.
1404 Configures an external subsystem (e.g. file transfer daemon).
1405 Arguments should be a subsystem name and a command (with optional arguments)
1406 to execute upon subsystem request.
1410 implements the SFTP file transfer subsystem.
1412 Alternately the name
1414 implements an in-process SFTP server.
1415 This may simplify configurations using
1417 to force a different filesystem root on clients.
1419 By default no subsystems are defined.
1420 .It Cm SyslogFacility
1421 Gives the facility code that is used when logging messages from
1423 The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1424 LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1425 The default is AUTH.
1427 Specifies whether the system should send TCP keepalive messages to the
1429 If they are sent, death of the connection or crash of one
1430 of the machines will be properly noticed.
1431 However, this means that
1432 connections will die if the route is down temporarily, and some people
1434 On the other hand, if TCP keepalives are not sent,
1435 sessions may hang indefinitely on the server, leaving
1437 users and consuming server resources.
1441 (to send TCP keepalive messages), and the server will notice
1442 if the network goes down or the client host crashes.
1443 This avoids infinitely hanging sessions.
1445 To disable TCP keepalive messages, the value should be set to
1447 .It Cm TrustedUserCAKeys
1448 Specifies a file containing public keys of certificate authorities that are
1449 trusted to sign user certificates for authentication, or
1452 Keys are listed one per line; empty lines and comments starting with
1455 If a certificate is presented for authentication and has its signing CA key
1456 listed in this file, then it may be used for authentication for any user
1457 listed in the certificate's principals list.
1458 Note that certificates that lack a list of principals will not be permitted
1459 for authentication using
1460 .Cm TrustedUserCAKeys .
1461 For more details on certificates, see the CERTIFICATES section in
1466 should look up the remote host name, and to check that
1467 the resolved host name for the remote IP address maps back to the
1468 very same IP address.
1470 If this option is set to
1472 (the default) then only addresses and not host names may be used in
1473 .Pa ~/.ssh/authorized_keys
1481 Enables the Pluggable Authentication Module interface.
1484 this will enable PAM authentication using
1485 .Cm ChallengeResponseAuthentication
1487 .Cm PasswordAuthentication
1488 in addition to PAM account and session module processing for all
1489 authentication types.
1491 Because PAM challenge-response authentication usually serves an equivalent
1492 role to password authentication, you should disable either
1493 .Cm PasswordAuthentication
1495 .Cm ChallengeResponseAuthentication.
1499 is enabled, you will not be able to run
1504 .It Cm VersionAddendum
1505 Optionally specifies additional text to append to the SSH protocol banner
1506 sent by the server upon connection.
1509 .It Cm X11DisplayOffset
1510 Specifies the first display number available for
1513 This prevents sshd from interfering with real X11 servers.
1515 .It Cm X11Forwarding
1516 Specifies whether X11 forwarding is permitted.
1517 The argument must be
1524 When X11 forwarding is enabled, there may be additional exposure to
1525 the server and to client displays if the
1527 proxy display is configured to listen on the wildcard address (see
1528 .Cm X11UseLocalhost ) ,
1529 though this is not the default.
1530 Additionally, the authentication spoofing and authentication data
1531 verification and substitution occur on the client side.
1532 The security risk of using X11 forwarding is that the client's X11
1533 display server may be exposed to attack when the SSH client requests
1534 forwarding (see the warnings for
1537 .Xr ssh_config 5 ) .
1538 A system administrator may have a stance in which they want to
1539 protect clients that may expose themselves to attack by unwittingly
1540 requesting X11 forwarding, which can warrant a
1544 Note that disabling X11 forwarding does not prevent users from
1545 forwarding X11 traffic, as users can always install their own forwarders.
1546 .It Cm X11UseLocalhost
1549 should bind the X11 forwarding server to the loopback address or to
1550 the wildcard address.
1552 sshd binds the forwarding server to the loopback address and sets the
1553 hostname part of the
1555 environment variable to
1557 This prevents remote hosts from connecting to the proxy display.
1558 However, some older X11 clients may not function with this
1563 to specify that the forwarding server should be bound to the wildcard
1565 The argument must be
1571 .It Cm XAuthLocation
1572 Specifies the full pathname of the
1578 .Pa /usr/X11R6/bin/xauth .
1582 command-line arguments and configuration file options that specify time
1583 may be expressed using a sequence of the form:
1585 .Ar time Op Ar qualifier ,
1589 is a positive integer value and
1591 is one of the following:
1593 .Bl -tag -width Ds -compact -offset indent
1608 Each member of the sequence is added together to calculate
1609 the total time value.
1611 Time format examples:
1613 .Bl -tag -width Ds -compact -offset indent
1615 600 seconds (10 minutes)
1619 1 hour 30 minutes (90 minutes)
1622 Arguments to some keywords can make use of tokens,
1623 which are expanded at runtime:
1625 .Bl -tag -width XXXX -offset indent -compact
1630 The fingerprint of the CA key.
1632 The fingerprint of the key or certificate.
1634 The home directory of the user.
1636 The key ID in the certificate.
1638 The base64-encoded CA key.
1640 The base64-encoded key or certificate for authentication.
1642 The serial number of the certificate.
1644 The type of the CA key.
1646 The key or certificate type.
1651 .Cm AuthorizedKeysCommand
1652 accepts the tokens %%, %f, %h, %k, %t, and %u.
1654 .Cm AuthorizedKeysFile
1655 accepts the tokens %%, %h, and %u.
1657 .Cm AuthorizedPrincipalsCommand
1658 accepts the tokens %%, %F, %f, %h, %i, %K, %k, %s, %T, %t, and %u.
1660 .Cm AuthorizedPrincipalsFile
1661 accepts the tokens %%, %h, and %u.
1664 accepts the tokens %%, %h, and %u.
1667 .It Pa /etc/ssh/sshd_config
1668 Contains configuration data for
1670 This file should be writable by root only, but it is recommended
1671 (though not necessary) that it be world-readable.
1678 OpenSSH is a derivative of the original and free
1679 ssh 1.2.12 release by
1681 .An Aaron Campbell , Bob Beck , Markus Friedl , Niels Provos ,
1685 removed many bugs, re-added newer features and
1688 contributed the support for SSH protocol versions 1.5 and 2.0.
1692 contributed support for privilege separation.