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.263 2018/02/16 02:40:45 djm Exp $
37 .Dd $Mdocdate: February 16 2018 $
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.
51 For each keyword, the first obtained value will be used.
54 and empty lines are interpreted as comments.
55 Arguments may optionally be enclosed in double quotes
57 in order to represent arguments containing spaces.
60 keywords and their meanings are as follows (note that
61 keywords are case-insensitive and arguments are case-sensitive):
64 Specifies what environment variables sent by the client will be copied into
71 for how to configure the client.
74 environment variable is always sent whenever the client
75 requests a pseudo-terminal as it is required by the protocol.
76 Variables are specified by name, which may contain the wildcard characters
80 Multiple environment variables may be separated by whitespace or spread
84 Be warned that some environment variables could be used to bypass restricted
86 For this reason, care should be taken in the use of this directive.
87 The default is not to accept any environment variables.
89 Specifies which address family should be used by
98 .It Cm AllowAgentForwarding
101 forwarding is permitted.
104 Note that disabling agent forwarding does not improve security
105 unless users are also denied shell access, as they can always install
106 their own forwarders.
108 This keyword can be followed by a list of group name patterns, separated
110 If specified, login is allowed only for users whose primary
111 group or supplementary group list matches one of the patterns.
112 Only group names are valid; a numerical group ID is not recognized.
113 By default, login is allowed for all groups.
114 The allow/deny directives are processed in the following order:
123 for more information on patterns.
124 .It Cm AllowStreamLocalForwarding
125 Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
126 The available options are
131 to allow StreamLocal forwarding,
133 to prevent all StreamLocal forwarding,
135 to allow local (from the perspective of
139 to allow remote forwarding only.
140 Note that disabling StreamLocal forwarding does not improve security unless
141 users are also denied shell access, as they can always install their
143 .It Cm AllowTcpForwarding
144 Specifies whether TCP forwarding is permitted.
145 The available options are
150 to allow TCP forwarding,
152 to prevent all TCP forwarding,
154 to allow local (from the perspective of
158 to allow remote forwarding only.
159 Note that disabling TCP forwarding does not improve security unless
160 users are also denied shell access, as they can always install their
163 This keyword can be followed by a list of user name patterns, separated
165 If specified, login is allowed only for user names that
166 match one of the patterns.
167 Only user names are valid; a numerical user ID is not recognized.
168 By default, login is allowed for all users.
169 If the pattern takes the form USER@HOST then USER and HOST
170 are separately checked, restricting logins to particular
171 users from particular hosts.
172 HOST criteria may additionally contain addresses to match in CIDR
173 address/masklen format.
174 The allow/deny directives are processed in the following order:
183 for more information on patterns.
184 .It Cm AuthenticationMethods
185 Specifies the authentication methods that must be successfully completed
186 for a user to be granted access.
187 This option must be followed by one or more comma-separated lists of
188 authentication method names, or by the single string
190 to indicate the default behaviour of accepting any single authentication
192 If the default is overridden, then successful authentication requires
193 completion of every method in at least one of these lists.
196 .Qq publickey,password publickey,keyboard-interactive
197 would require the user to complete public key authentication, followed by
198 either password or keyboard interactive authentication.
199 Only methods that are next in one or more lists are offered at each stage,
200 so for this example it would not be possible to attempt password or
201 keyboard-interactive authentication before public key.
203 For keyboard interactive authentication it is also possible to
204 restrict authentication to a specific device by appending a
205 colon followed by the device identifier
210 depending on the server configuration.
212 .Qq keyboard-interactive:bsdauth
213 would restrict keyboard interactive authentication to the
217 If the publickey method is listed more than once,
219 verifies that keys that have been used successfully are not reused for
220 subsequent authentications.
222 .Qq publickey,publickey
223 requires successful authentication using two different public keys.
225 Note that each authentication method listed should also be explicitly enabled
226 in the configuration.
228 The available authentication methods are:
229 .Qq gssapi-with-mic ,
231 .Qq keyboard-interactive ,
233 (used for access to password-less accounts when
234 .Cm PermitEmptyPassword
239 .It Cm AuthorizedKeysCommand
240 Specifies a program to be used to look up the user's public keys.
241 The program must be owned by root, not writable by group or others and
242 specified by an absolute path.
244 .Cm AuthorizedKeysCommand
245 accept the tokens described in the
248 If no arguments are specified then the username of the target user is used.
250 The program should produce on standard output zero or
251 more lines of authorized_keys output (see
256 .Cm AuthorizedKeysCommand
257 does not successfully authenticate
258 and authorize the user then public key authentication continues using the usual
259 .Cm AuthorizedKeysFile
262 .Cm AuthorizedKeysCommand
264 .It Cm AuthorizedKeysCommandUser
265 Specifies the user under whose account the
266 .Cm AuthorizedKeysCommand
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 used for user authentication.
279 The format is described in the
280 .Sx AUTHORIZED_KEYS FILE FORMAT
284 .Cm AuthorizedKeysFile
285 accept the tokens described in the
289 .Cm AuthorizedKeysFile
290 is taken to be an absolute path or one relative to the user's home
292 Multiple files may be listed, separated by whitespace.
293 Alternately this option may be set to
295 to skip checking for user keys in files.
297 .Qq .ssh/authorized_keys .ssh/authorized_keys2 .
298 .It Cm AuthorizedPrincipalsCommand
299 Specifies a program to be used to generate the list of allowed
300 certificate principals as per
301 .Cm AuthorizedPrincipalsFile .
302 The program must be owned by root, not writable by group or others and
303 specified by an absolute path.
305 .Cm AuthorizedPrincipalsCommand
306 accept the tokens described in the
309 If no arguments are specified then the username of the target user is used.
311 The program should produce on standard output zero or
313 .Cm AuthorizedPrincipalsFile
316 .Cm AuthorizedPrincipalsCommand
318 .Cm AuthorizedPrincipalsFile
319 is specified, then certificates offered by the client for authentication
320 must contain a principal that is listed.
322 .Cm AuthorizedPrincipalsCommand
324 .It Cm AuthorizedPrincipalsCommandUser
325 Specifies the user under whose account the
326 .Cm AuthorizedPrincipalsCommand
328 It is recommended to use a dedicated user that has no other role on the host
329 than running authorized principals commands.
331 .Cm AuthorizedPrincipalsCommand
333 .Cm AuthorizedPrincipalsCommandUser
336 will refuse to start.
337 .It Cm AuthorizedPrincipalsFile
338 Specifies a file that lists principal names that are accepted for
339 certificate authentication.
340 When using certificates signed by a key listed in
341 .Cm TrustedUserCAKeys ,
342 this file lists names, one of which must appear in the certificate for it
343 to be accepted for authentication.
344 Names are listed one per line preceded by key options (as described in
345 .Sx AUTHORIZED_KEYS FILE FORMAT
348 Empty lines and comments starting with
353 .Cm AuthorizedPrincipalsFile
354 accept the tokens described in the
358 .Cm AuthorizedPrincipalsFile
359 is taken to be an absolute path or one relative to the user's home directory.
362 i.e. not to use a principals file \(en in this case, the username
363 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.
403 accept the tokens described in the
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 SFTP
425 no additional configuration of the environment is necessary if the in-process
427 though sessions which use logging may require
429 inside the chroot directory on some operating systems (see
433 For safety, it is very important that the directory hierarchy be
434 prevented from modification by other processes on the system (especially
435 those outside the jail).
436 Misconfiguration can lead to unsafe environments which
445 Specifies the ciphers allowed.
446 Multiple ciphers must be comma-separated.
447 If the specified value begins with a
449 character, then the specified ciphers will be appended to the default set
450 instead of replacing them.
451 If the specified value begins with a
453 character, then the specified ciphers (including wildcards) will be removed
454 from the default set instead of replacing them.
456 The supported ciphers are:
458 .Bl -item -compact -offset indent
474 aes128-gcm@openssh.com
476 aes256-gcm@openssh.com
478 chacha20-poly1305@openssh.com
482 .Bd -literal -offset indent
483 chacha20-poly1305@openssh.com,
484 aes128-ctr,aes192-ctr,aes256-ctr,
485 aes128-gcm@openssh.com,aes256-gcm@openssh.com
488 The list of available ciphers may also be obtained using
490 .It Cm ClientAliveCountMax
491 Sets the number of client alive messages which may be sent without
493 receiving any messages back from the client.
494 If this threshold is reached while client alive messages are being sent,
495 sshd will disconnect the client, terminating the session.
496 It is important to note that the use of client alive messages is very
499 The client alive messages are sent through the encrypted channel
500 and therefore will not be spoofable.
501 The TCP keepalive option enabled by
504 The client alive mechanism is valuable when the client or
505 server depend on knowing when a connection has become inactive.
507 The default value is 3.
509 .Cm ClientAliveInterval
511 .Cm ClientAliveCountMax
512 is left at the default, unresponsive SSH clients
513 will be disconnected after approximately 45 seconds.
514 .It Cm ClientAliveInterval
515 Sets a timeout interval in seconds after which if no data has been received
518 will send a message through the encrypted
519 channel to request a response from the client.
521 is 0, indicating that these messages will not be sent to the client.
523 Specifies whether compression is enabled after
524 the user has authenticated successfully.
528 (a legacy synonym for
535 This keyword can be followed by a list of group name patterns, separated
537 Login is disallowed for users whose primary group or supplementary
538 group list matches one of the patterns.
539 Only group names are valid; a numerical group ID is not recognized.
540 By default, login is allowed for all groups.
541 The allow/deny directives are processed in the following order:
550 for more information on patterns.
552 This keyword can be followed by a list of user name patterns, separated
554 Login is disallowed for user names that match one of the patterns.
555 Only user names are valid; a numerical user ID is not recognized.
556 By default, login is allowed for all users.
557 If the pattern takes the form USER@HOST then USER and HOST
558 are separately checked, restricting logins to particular
559 users from particular hosts.
560 HOST criteria may additionally contain addresses to match in CIDR
561 address/masklen format.
562 The allow/deny directives are processed in the following order:
571 for more information on patterns.
572 .It Cm DisableForwarding
573 Disables all forwarding features, including X11,
576 This option overrides all other forwarding-related options and may
577 simplify restricted configurations.
578 .It Cm ExposeAuthInfo
579 Writes a temporary file containing a list of authentication methods and
580 public credentials (e.g. keys) used to authenticate the user.
581 The location of the file is exposed to the user session through the
583 environment variable.
586 .It Cm FingerprintHash
587 Specifies the hash algorithm used when logging key fingerprints.
595 Forces the execution of the command specified by
597 ignoring any command supplied by the client and
600 The command is invoked by using the user's login shell with the -c option.
601 This applies to shell, command, or subsystem execution.
602 It is most useful inside a
605 The command originally supplied by the client is available in the
606 .Ev SSH_ORIGINAL_COMMAND
607 environment variable.
608 Specifying a command of
610 will force the use of an in-process SFTP server that requires no support
612 .Cm ChrootDirectory .
616 Specifies whether remote hosts are allowed to connect to ports
617 forwarded for the client.
620 binds remote port forwardings to the loopback address.
621 This prevents other remote hosts from connecting to forwarded ports.
623 can be used to specify that sshd
624 should allow remote port forwardings to bind to non-loopback addresses, thus
625 allowing other hosts to connect.
628 to force remote port forwardings to be available to the local host only,
630 to force remote port forwardings to bind to the wildcard address, or
632 to allow the client to select the address to which the forwarding is bound.
635 .It Cm GSSAPIAuthentication
636 Specifies whether user authentication based on GSSAPI is allowed.
639 .It Cm GSSAPICleanupCredentials
640 Specifies whether to automatically destroy the user's credentials cache
644 .It Cm GSSAPIStrictAcceptorCheck
645 Determines whether to be strict about the identity of the GSSAPI acceptor
646 a client authenticates against.
649 then the client must authenticate against the host
650 service on the current hostname.
653 then the client may authenticate against any service key stored in the
654 machine's default store.
655 This facility is provided to assist with operation on multi homed machines.
658 .It Cm HostbasedAcceptedKeyTypes
659 Specifies the key types that will be accepted for hostbased authentication
660 as a comma-separated pattern list.
661 Alternately if the specified value begins with a
663 character, then the specified key types will be appended to the default set
664 instead of replacing them.
665 If the specified value begins with a
667 character, then the specified key types (including wildcards) will be removed
668 from the default set instead of replacing them.
669 The default for this option is:
670 .Bd -literal -offset 3n
671 ecdsa-sha2-nistp256-cert-v01@openssh.com,
672 ecdsa-sha2-nistp384-cert-v01@openssh.com,
673 ecdsa-sha2-nistp521-cert-v01@openssh.com,
674 ssh-ed25519-cert-v01@openssh.com,
675 ssh-rsa-cert-v01@openssh.com,
676 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
680 The list of available key types may also be obtained using
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_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
780 and use only the system-wide known hosts file
781 .Pa /etc/ssh/known_hosts .
785 Specifies the IPv4 type-of-service or DSCP class for the connection.
813 to use the operating system default.
814 This option may take one or two arguments, separated by whitespace.
815 If one argument is specified, it is used as the packet class unconditionally.
816 If two values are specified, the first is automatically selected for
817 interactive sessions and the second for non-interactive sessions.
820 for interactive sessions and
822 for non-interactive sessions.
823 .It Cm KbdInteractiveAuthentication
824 Specifies whether to allow keyboard-interactive authentication.
825 The argument to this keyword must be
829 The default is to use whatever value
830 .Cm ChallengeResponseAuthentication
834 .It Cm KerberosAuthentication
835 Specifies whether the password provided by the user for
836 .Cm PasswordAuthentication
837 will be validated through the Kerberos KDC.
838 To use this option, the server needs a
839 Kerberos servtab which allows the verification of the KDC's identity.
842 .It Cm KerberosGetAFSToken
843 If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
844 an AFS token before accessing the user's home directory.
847 .It Cm KerberosOrLocalPasswd
848 If password authentication through Kerberos fails then
849 the password will be validated via any additional local mechanism
854 .It Cm KerberosTicketCleanup
855 Specifies whether to automatically destroy the user's ticket cache
860 Specifies the available KEX (Key Exchange) algorithms.
861 Multiple algorithms must be comma-separated.
862 Alternately if the specified value begins with a
864 character, then the specified methods will be appended to the default set
865 instead of replacing them.
866 If the specified value begins with a
868 character, then the specified methods (including wildcards) will be removed
869 from the default set instead of replacing them.
870 The supported algorithms are:
872 .Bl -item -compact -offset indent
876 curve25519-sha256@libssh.org
878 diffie-hellman-group1-sha1
880 diffie-hellman-group14-sha1
882 diffie-hellman-group14-sha256
884 diffie-hellman-group16-sha512
886 diffie-hellman-group18-sha512
888 diffie-hellman-group-exchange-sha1
890 diffie-hellman-group-exchange-sha256
900 .Bd -literal -offset indent
901 curve25519-sha256,curve25519-sha256@libssh.org,
902 ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
903 diffie-hellman-group-exchange-sha256,
904 diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,
905 diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
908 The list of available key exchange algorithms may also be obtained using
911 Specifies the local addresses
914 The following forms may be used:
916 .Bl -item -offset indent -compact
920 .Ar hostname | address
922 .Op Cm rdomain Ar domain
928 .Op Cm rdomain Ar domain
932 .Ar IPv4_address : port
934 .Op Cm rdomain Ar domain
938 .Oo Ar hostname | address Oc : Ar port
940 .Op Cm rdomain Ar domain
947 listen in an explicit routing domain.
951 sshd will listen on the address and all
954 The default is to listen on all local addresses on the current default
958 options are permitted.
959 For more information on routing domains, see
961 .It Cm LoginGraceTime
962 The server disconnects after this time if the user has not
963 successfully logged in.
964 If the value is 0, there is no time limit.
965 The default is 120 seconds.
967 Gives the verbosity level that is used when logging messages from
969 The possible values are:
970 QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
972 DEBUG and DEBUG1 are equivalent.
973 DEBUG2 and DEBUG3 each specify higher levels of debugging output.
974 Logging with a DEBUG level violates the privacy of users and is not recommended.
976 Specifies the available MAC (message authentication code) algorithms.
977 The MAC algorithm is used for data integrity protection.
978 Multiple algorithms must be comma-separated.
979 If the specified value begins with a
981 character, then the specified algorithms will be appended to the default set
982 instead of replacing them.
983 If the specified value begins with a
985 character, then the specified algorithms (including wildcards) will be removed
986 from the default set instead of replacing them.
988 The algorithms that contain
990 calculate the MAC after encryption (encrypt-then-mac).
991 These are considered safer and their use recommended.
992 The supported MACs are:
994 .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-sha1-etm@openssh.com
1018 hmac-sha1-96-etm@openssh.com
1020 hmac-sha2-256-etm@openssh.com
1022 hmac-sha2-512-etm@openssh.com
1024 umac-64-etm@openssh.com
1026 umac-128-etm@openssh.com
1030 .Bd -literal -offset indent
1031 umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1032 hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
1033 hmac-sha1-etm@openssh.com,
1034 umac-64@openssh.com,umac-128@openssh.com,
1035 hmac-sha2-256,hmac-sha2-512,hmac-sha1
1038 The list of available MAC algorithms may also be obtained using
1041 Introduces a conditional block.
1042 If all of the criteria on the
1044 line are satisfied, the keywords on the following lines override those
1045 set in the global section of the config file, until either another
1047 line or the end of the file.
1048 If a keyword appears in multiple
1050 blocks that are satisfied, only the first instance of the keyword is
1055 are one or more criteria-pattern pairs or the single token
1057 which matches all criteria.
1058 The available criteria are
1071 on which the connection was received.)
1073 The match patterns may consist of single entries or comma-separated
1074 lists and may use the wildcard and negation operators described in the
1081 criteria may additionally contain addresses to match in CIDR
1082 address/masklen format,
1083 such as 192.0.2.0/24 or 2001:db8::/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.
1087 For example, 192.0.2.0/33 and 192.0.2.0/8, respectively.
1089 Only a subset of keywords may be used on the lines following a
1092 Available keywords are
1094 .Cm AllowAgentForwarding ,
1096 .Cm AllowStreamLocalForwarding ,
1097 .Cm AllowTcpForwarding ,
1099 .Cm AuthenticationMethods ,
1100 .Cm AuthorizedKeysCommand ,
1101 .Cm AuthorizedKeysCommandUser ,
1102 .Cm AuthorizedKeysFile ,
1103 .Cm AuthorizedPrincipalsCommand ,
1104 .Cm AuthorizedPrincipalsCommandUser ,
1105 .Cm AuthorizedPrincipalsFile ,
1107 .Cm ChrootDirectory ,
1108 .Cm ClientAliveCountMax ,
1109 .Cm ClientAliveInterval ,
1114 .Cm GSSAPIAuthentication ,
1115 .Cm HostbasedAcceptedKeyTypes ,
1116 .Cm HostbasedAuthentication ,
1117 .Cm HostbasedUsesNameFromPacketOnly ,
1119 .Cm KbdInteractiveAuthentication ,
1120 .Cm KerberosAuthentication ,
1124 .Cm PasswordAuthentication ,
1125 .Cm PermitEmptyPasswords ,
1127 .Cm PermitRootLogin ,
1131 .Cm PubkeyAcceptedKeyTypes ,
1132 .Cm PubkeyAuthentication ,
1136 .Cm StreamLocalBindMask ,
1137 .Cm StreamLocalBindUnlink ,
1138 .Cm TrustedUserCAKeys ,
1139 .Cm X11DisplayOffset ,
1142 .Cm X11UseLocalHost .
1144 Specifies the maximum number of authentication attempts permitted per
1146 Once the number of failures reaches half this value,
1147 additional failures are logged.
1150 Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1151 sessions permitted per network connection.
1152 Multiple sessions may be established by clients that support connection
1156 to 1 will effectively disable session multiplexing, whereas setting it to 0
1157 will prevent all shell, login and subsystem sessions while still permitting
1161 Specifies the maximum number of concurrent unauthenticated connections to the
1163 Additional connections will be dropped until authentication succeeds or the
1165 expires for a connection.
1166 The default is 10:30:100.
1168 Alternatively, random early drop can be enabled by specifying
1169 the three colon separated values
1170 start:rate:full (e.g. "10:30:60").
1172 will refuse connection attempts with a probability of rate/100 (30%)
1173 if there are currently start (10) unauthenticated connections.
1174 The probability increases linearly and all connection attempts
1175 are refused if the number of unauthenticated connections reaches full (60).
1176 .It Cm PasswordAuthentication
1177 Specifies whether password authentication is allowed.
1180 .It Cm PermitEmptyPasswords
1181 When password authentication is allowed, it specifies whether the
1182 server allows login to accounts with empty password strings.
1186 Specifies the destinations to which TCP port forwarding is permitted.
1187 The forwarding specification must be one of the following forms:
1189 .Bl -item -offset indent -compact
1198 .Ar IPv4_addr : port
1203 .Ar \&[ IPv6_addr \&] : port
1207 Multiple forwards may be specified by separating them with whitespace.
1210 can be used to remove all restrictions and permit any forwarding requests.
1213 can be used to prohibit all forwarding requests.
1216 can be used for host or port to allow all hosts or ports, respectively.
1217 By default all port forwarding requests are permitted.
1218 .It Cm PermitRootLogin
1219 Specifies whether root can log in using
1221 The argument must be
1223 .Cm prohibit-password ,
1224 .Cm forced-commands-only ,
1228 .Cm prohibit-password .
1230 If this option is set to
1231 .Cm prohibit-password
1232 (or its deprecated alias,
1233 .Cm without-password ) ,
1234 password and keyboard-interactive authentication are disabled for root.
1236 If this option is set to
1237 .Cm forced-commands-only ,
1238 root login with public key authentication will be allowed,
1241 option has been specified
1242 (which may be useful for taking remote backups even if root login is
1243 normally not allowed).
1244 All other authentication methods are disabled for root.
1246 If this option is set to
1248 root is not allowed to log in.
1252 allocation is permitted.
1258 device forwarding is allowed.
1259 The argument must be
1275 Independent of this setting, the permissions of the selected
1277 device must allow access to the user.
1278 .It Cm PermitUserEnvironment
1280 .Pa ~/.ssh/environment
1284 .Pa ~/.ssh/authorized_keys
1289 Enabling environment processing may enable users to bypass access
1290 restrictions in some configurations using mechanisms such as
1293 Specifies whether any
1299 Specifies the file that contains the process ID of the
1304 .Pa /var/run/sshd.pid .
1306 Specifies the port number that
1310 Multiple options of this type are permitted.
1316 should print the date and time of the last user login when a user logs
1325 when a user logs in interactively.
1326 (On some systems it is also printed by the shell,
1331 .It Cm PubkeyAcceptedKeyTypes
1332 Specifies the key types that will be accepted for public key authentication
1333 as a comma-separated pattern list.
1334 Alternately if the specified value begins with a
1336 character, then the specified key types will be appended to the default set
1337 instead of replacing them.
1338 If the specified value begins with a
1340 character, then the specified key types (including wildcards) will be removed
1341 from the default set instead of replacing them.
1342 The default for this option is:
1343 .Bd -literal -offset 3n
1344 ecdsa-sha2-nistp256-cert-v01@openssh.com,
1345 ecdsa-sha2-nistp384-cert-v01@openssh.com,
1346 ecdsa-sha2-nistp521-cert-v01@openssh.com,
1347 ssh-ed25519-cert-v01@openssh.com,
1348 ssh-rsa-cert-v01@openssh.com,
1349 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1353 The list of available key types may also be obtained using
1355 .It Cm PubkeyAuthentication
1356 Specifies whether public key authentication is allowed.
1360 Specifies the maximum amount of data that may be transmitted before the
1361 session key is renegotiated, optionally followed a maximum amount of
1362 time that may pass before the session key is renegotiated.
1363 The first argument is specified in bytes and may have a suffix of
1368 to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1369 The default is between
1373 depending on the cipher.
1374 The optional second value is specified in seconds and may use any of the
1375 units documented in the
1378 The default value for
1382 which means that rekeying is performed after the cipher's default amount
1383 of data has been sent or received and no time based rekeying is done.
1385 Specifies revoked public keys file, or
1388 Keys listed in this file will be refused for public key authentication.
1389 Note that if this file is not readable, then public key authentication will
1390 be refused for all users.
1391 Keys may be specified as a text file, listing one public key per line, or as
1392 an OpenSSH Key Revocation List (KRL) as generated by
1394 For more information on KRLs, see the KEY REVOCATION LISTS section in
1397 Specifies an explicit routing domain that is applied after authentication
1399 The user session, as well and any forwarded or listening IP sockets,
1400 will be bound to this
1402 If the routing domain is set to
1404 then the domain in which the incoming connection was received will be applied.
1405 .It Cm StreamLocalBindMask
1406 Sets the octal file creation mode mask
1408 used when creating a Unix-domain socket file for local or remote
1410 This option is only used for port forwarding to a Unix-domain socket file.
1412 The default value is 0177, which creates a Unix-domain socket file that is
1413 readable and writable only by the owner.
1414 Note that not all operating systems honor the file mode on Unix-domain
1416 .It Cm StreamLocalBindUnlink
1417 Specifies whether to remove an existing Unix-domain socket file for local
1418 or remote port forwarding before creating a new one.
1419 If the socket file already exists and
1420 .Cm StreamLocalBindUnlink
1423 will be unable to forward the port to the Unix-domain socket file.
1424 This option is only used for port forwarding to a Unix-domain socket file.
1426 The argument must be
1435 should check file modes and ownership of the
1436 user's files and home directory before accepting login.
1437 This is normally desirable because novices sometimes accidentally leave their
1438 directory or files world-writable.
1441 Note that this does not apply to
1442 .Cm ChrootDirectory ,
1443 whose permissions and ownership are checked unconditionally.
1445 Configures an external subsystem (e.g. file transfer daemon).
1446 Arguments should be a subsystem name and a command (with optional arguments)
1447 to execute upon subsystem request.
1451 implements the SFTP file transfer subsystem.
1453 Alternately the name
1455 implements an in-process SFTP server.
1456 This may simplify configurations using
1458 to force a different filesystem root on clients.
1460 By default no subsystems are defined.
1461 .It Cm SyslogFacility
1462 Gives the facility code that is used when logging messages from
1464 The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1465 LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1466 The default is AUTH.
1468 Specifies whether the system should send TCP keepalive messages to the
1470 If they are sent, death of the connection or crash of one
1471 of the machines will be properly noticed.
1472 However, this means that
1473 connections will die if the route is down temporarily, and some people
1475 On the other hand, if TCP keepalives are not sent,
1476 sessions may hang indefinitely on the server, leaving
1478 users and consuming server resources.
1482 (to send TCP keepalive messages), and the server will notice
1483 if the network goes down or the client host crashes.
1484 This avoids infinitely hanging sessions.
1486 To disable TCP keepalive messages, the value should be set to
1488 .It Cm TrustedUserCAKeys
1489 Specifies a file containing public keys of certificate authorities that are
1490 trusted to sign user certificates for authentication, or
1493 Keys are listed one per line; empty lines and comments starting with
1496 If a certificate is presented for authentication and has its signing CA key
1497 listed in this file, then it may be used for authentication for any user
1498 listed in the certificate's principals list.
1499 Note that certificates that lack a list of principals will not be permitted
1500 for authentication using
1501 .Cm TrustedUserCAKeys .
1502 For more details on certificates, see the CERTIFICATES section in
1507 should look up the remote host name, and to check that
1508 the resolved host name for the remote IP address maps back to the
1509 very same IP address.
1511 If this option is set to
1513 (the default) then only addresses and not host names may be used in
1514 .Pa ~/.ssh/authorized_keys
1522 Enables the Pluggable Authentication Module interface.
1525 this will enable PAM authentication using
1526 .Cm ChallengeResponseAuthentication
1528 .Cm PasswordAuthentication
1529 in addition to PAM account and session module processing for all
1530 authentication types.
1532 Because PAM challenge-response authentication usually serves an equivalent
1533 role to password authentication, you should disable either
1534 .Cm PasswordAuthentication
1536 .Cm ChallengeResponseAuthentication.
1540 is enabled, you will not be able to run
1545 .It Cm VersionAddendum
1546 Optionally specifies additional text to append to the SSH protocol banner
1547 sent by the server upon connection.
1550 .It Cm X11DisplayOffset
1551 Specifies the first display number available for
1554 This prevents sshd from interfering with real X11 servers.
1556 .It Cm X11Forwarding
1557 Specifies whether X11 forwarding is permitted.
1558 The argument must be
1565 When X11 forwarding is enabled, there may be additional exposure to
1566 the server and to client displays if the
1568 proxy display is configured to listen on the wildcard address (see
1569 .Cm X11UseLocalhost ) ,
1570 though this is not the default.
1571 Additionally, the authentication spoofing and authentication data
1572 verification and substitution occur on the client side.
1573 The security risk of using X11 forwarding is that the client's X11
1574 display server may be exposed to attack when the SSH client requests
1575 forwarding (see the warnings for
1578 .Xr ssh_config 5 ) .
1579 A system administrator may have a stance in which they want to
1580 protect clients that may expose themselves to attack by unwittingly
1581 requesting X11 forwarding, which can warrant a
1585 Note that disabling X11 forwarding does not prevent users from
1586 forwarding X11 traffic, as users can always install their own forwarders.
1587 .It Cm X11UseLocalhost
1590 should bind the X11 forwarding server to the loopback address or to
1591 the wildcard address.
1593 sshd binds the forwarding server to the loopback address and sets the
1594 hostname part of the
1596 environment variable to
1598 This prevents remote hosts from connecting to the proxy display.
1599 However, some older X11 clients may not function with this
1604 to specify that the forwarding server should be bound to the wildcard
1606 The argument must be
1612 .It Cm XAuthLocation
1613 Specifies the full pathname of the
1619 .Pa /usr/X11R6/bin/xauth .
1623 command-line arguments and configuration file options that specify time
1624 may be expressed using a sequence of the form:
1626 .Ar time Op Ar qualifier ,
1630 is a positive integer value and
1632 is one of the following:
1634 .Bl -tag -width Ds -compact -offset indent
1649 Each member of the sequence is added together to calculate
1650 the total time value.
1652 Time format examples:
1654 .Bl -tag -width Ds -compact -offset indent
1656 600 seconds (10 minutes)
1660 1 hour 30 minutes (90 minutes)
1663 Arguments to some keywords can make use of tokens,
1664 which are expanded at runtime:
1666 .Bl -tag -width XXXX -offset indent -compact
1671 The routing domain in which the incoming connection was received.
1673 The fingerprint of the CA key.
1675 The fingerprint of the key or certificate.
1677 The home directory of the user.
1679 The key ID in the certificate.
1681 The base64-encoded CA key.
1683 The base64-encoded key or certificate for authentication.
1685 The serial number of the certificate.
1687 The type of the CA key.
1689 The key or certificate type.
1694 .Cm AuthorizedKeysCommand
1695 accepts the tokens %%, %f, %h, %k, %t, and %u.
1697 .Cm AuthorizedKeysFile
1698 accepts the tokens %%, %h, and %u.
1700 .Cm AuthorizedPrincipalsCommand
1701 accepts the tokens %%, %F, %f, %h, %i, %K, %k, %s, %T, %t, and %u.
1703 .Cm AuthorizedPrincipalsFile
1704 accepts the tokens %%, %h, and %u.
1707 accepts the tokens %%, %h, and %u.
1710 accepts the token %D.
1713 .It Pa /etc/ssh/sshd_config
1714 Contains configuration data for
1716 This file should be writable by root only, but it is recommended
1717 (though not necessary) that it be world-readable.
1724 OpenSSH is a derivative of the original and free
1725 ssh 1.2.12 release by
1727 .An Aaron Campbell , Bob Beck , Markus Friedl , Niels Provos ,
1731 removed many bugs, re-added newer features and
1734 contributed the support for SSH protocol versions 1.5 and 2.0.
1738 contributed support for privilege separation.