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.343 2022/09/17 10:34:29 djm Exp $
37 .Dd $Mdocdate: September 17 2022 $
42 .Nd OpenSSH 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
73 for how to configure the client.
76 environment variable is always accepted whenever the client
77 requests a pseudo-terminal as it is required by the protocol.
78 Variables are specified by name, which may contain the wildcard characters
82 Multiple environment variables may be separated by whitespace or spread
86 Be warned that some environment variables could be used to bypass restricted
88 For this reason, care should be taken in the use of this directive.
89 The default is not to accept any environment variables.
91 Specifies which address family should be used by
100 .It Cm AllowAgentForwarding
103 forwarding is permitted.
106 Note that disabling agent forwarding does not improve security
107 unless users are also denied shell access, as they can always install
108 their own forwarders.
110 This keyword can be followed by a list of group name patterns, separated
112 If specified, login is allowed only for users whose primary
113 group or supplementary group list matches one of the patterns.
114 Only group names are valid; a numerical group ID is not recognized.
115 By default, login is allowed for all groups.
116 The allow/deny groups 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 users directives are processed in the following order:
179 for more information on patterns.
180 .It Cm AuthenticationMethods
181 Specifies the authentication methods that must be successfully completed
182 for a user to be granted access.
183 This option must be followed by one or more lists of comma-separated
184 authentication method names, or by the single string
186 to indicate the default behaviour of accepting any single authentication
188 If the default is overridden, then successful authentication requires
189 completion of every method in at least one of these lists.
192 .Qq publickey,password publickey,keyboard-interactive
193 would require the user to complete public key authentication, followed by
194 either password or keyboard interactive authentication.
195 Only methods that are next in one or more lists are offered at each stage,
196 so for this example it would not be possible to attempt password or
197 keyboard-interactive authentication before public key.
199 For keyboard interactive authentication it is also possible to
200 restrict authentication to a specific device by appending a
201 colon followed by the device identifier
205 depending on the server configuration.
207 .Qq keyboard-interactive:bsdauth
208 would restrict keyboard interactive authentication to the
212 If the publickey method is listed more than once,
214 verifies that keys that have been used successfully are not reused for
215 subsequent authentications.
217 .Qq publickey,publickey
218 requires successful authentication using two different public keys.
220 Note that each authentication method listed should also be explicitly enabled
221 in the configuration.
223 The available authentication methods are:
224 .Qq gssapi-with-mic ,
226 .Qq keyboard-interactive ,
228 (used for access to password-less accounts when
229 .Cm PermitEmptyPasswords
234 .It Cm AuthorizedKeysCommand
235 Specifies a program to be used to look up the user's public keys.
236 The program must be owned by root, not writable by group or others and
237 specified by an absolute path.
239 .Cm AuthorizedKeysCommand
240 accept the tokens described in the
243 If no arguments are specified then the username of the target user is used.
245 The program should produce on standard output zero or
246 more lines of authorized_keys output (see
250 .Cm AuthorizedKeysCommand
251 is tried after the usual
252 .Cm AuthorizedKeysFile
253 files and will not be executed if a matching key is found there.
255 .Cm AuthorizedKeysCommand
257 .It Cm AuthorizedKeysCommandUser
258 Specifies the user under whose account the
259 .Cm AuthorizedKeysCommand
261 It is recommended to use a dedicated user that has no other role on the host
262 than running authorized keys commands.
264 .Cm AuthorizedKeysCommand
266 .Cm AuthorizedKeysCommandUser
269 will refuse to start.
270 .It Cm AuthorizedKeysFile
271 Specifies the file that contains the public keys used for user authentication.
272 The format is described in the AUTHORIZED_KEYS FILE FORMAT section of
275 .Cm AuthorizedKeysFile
276 accept the tokens described in the
280 .Cm AuthorizedKeysFile
281 is taken to be an absolute path or one relative to the user's home
283 Multiple files may be listed, separated by whitespace.
284 Alternately this option may be set to
286 to skip checking for user keys in files.
288 .Qq .ssh/authorized_keys .ssh/authorized_keys2 .
289 .It Cm AuthorizedPrincipalsCommand
290 Specifies a program to be used to generate the list of allowed
291 certificate principals as per
292 .Cm AuthorizedPrincipalsFile .
293 The program must be owned by root, not writable by group or others and
294 specified by an absolute path.
296 .Cm AuthorizedPrincipalsCommand
297 accept the tokens described in the
300 If no arguments are specified then the username of the target user is used.
302 The program should produce on standard output zero or
304 .Cm AuthorizedPrincipalsFile
307 .Cm AuthorizedPrincipalsCommand
309 .Cm AuthorizedPrincipalsFile
310 is specified, then certificates offered by the client for authentication
311 must contain a principal that is listed.
313 .Cm AuthorizedPrincipalsCommand
315 .It Cm AuthorizedPrincipalsCommandUser
316 Specifies the user under whose account the
317 .Cm AuthorizedPrincipalsCommand
319 It is recommended to use a dedicated user that has no other role on the host
320 than running authorized principals commands.
322 .Cm AuthorizedPrincipalsCommand
324 .Cm AuthorizedPrincipalsCommandUser
327 will refuse to start.
328 .It Cm AuthorizedPrincipalsFile
329 Specifies a file that lists principal names that are accepted for
330 certificate authentication.
331 When using certificates signed by a key listed in
332 .Cm TrustedUserCAKeys ,
333 this file lists names, one of which must appear in the certificate for it
334 to be accepted for authentication.
335 Names are listed one per line preceded by key options (as described in
336 .Sx AUTHORIZED_KEYS FILE FORMAT
339 Empty lines and comments starting with
344 .Cm AuthorizedPrincipalsFile
345 accept the tokens described in the
349 .Cm AuthorizedPrincipalsFile
350 is taken to be an absolute path or one relative to the user's home directory.
353 i.e. not to use a principals file \(en in this case, the username
354 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 By default, no banner is displayed.
375 .It Cm CASignatureAlgorithms
376 Specifies which algorithms are allowed for signing of certificates
377 by certificate authorities (CAs).
379 .Bd -literal -offset indent
380 ssh-ed25519,ecdsa-sha2-nistp256,
381 ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
382 sk-ssh-ed25519@openssh.com,
383 sk-ecdsa-sha2-nistp256@openssh.com,
384 rsa-sha2-512,rsa-sha2-256
387 If the specified list begins with a
389 character, then the specified algorithms will be appended to the default set
390 instead of replacing them.
391 If the specified list begins with a
393 character, then the specified algorithms (including wildcards) will be removed
394 from the default set instead of replacing them.
396 Certificates signed using other algorithms will not be accepted for
397 public key or host-based authentication.
398 .It Cm ChrootDirectory
399 Specifies the pathname of a directory to
401 to after authentication.
404 checks that all components of the pathname are root-owned directories
405 which are not writable by any other user or group.
408 changes the working directory to the user's home directory.
411 accept the tokens described in the
417 must contain the necessary files and directories to support the
419 For an interactive session this requires at least a shell, typically
432 For file transfer sessions using SFTP
433 no additional configuration of the environment is necessary if the in-process
435 though sessions which use logging may require
437 inside the chroot directory on some operating systems (see
441 For safety, it is very important that the directory hierarchy be
442 prevented from modification by other processes on the system (especially
443 those outside the jail).
444 Misconfiguration can lead to unsafe environments which
453 Specifies the ciphers allowed.
454 Multiple ciphers must be comma-separated.
455 If the specified list begins with a
457 character, then the specified ciphers will be appended to the default set
458 instead of replacing them.
459 If the specified list begins with a
461 character, then the specified ciphers (including wildcards) will be removed
462 from the default set instead of replacing them.
463 If the specified list begins with a
465 character, then the specified ciphers will be placed at the head of the
468 The supported ciphers are:
470 .Bl -item -compact -offset indent
486 aes128-gcm@openssh.com
488 aes256-gcm@openssh.com
490 chacha20-poly1305@openssh.com
494 .Bd -literal -offset indent
495 chacha20-poly1305@openssh.com,
496 aes128-ctr,aes192-ctr,aes256-ctr,
497 aes128-gcm@openssh.com,aes256-gcm@openssh.com
500 The list of available ciphers may also be obtained using
502 .It Cm ClientAliveCountMax
503 Sets the number of client alive messages which may be sent without
505 receiving any messages back from the client.
506 If this threshold is reached while client alive messages are being sent,
507 sshd will disconnect the client, terminating the session.
508 It is important to note that the use of client alive messages is very
511 The client alive messages are sent through the encrypted channel
512 and therefore will not be spoofable.
513 The TCP keepalive option enabled by
516 The client alive mechanism is valuable when the client or
517 server depend on knowing when a connection has become unresponsive.
519 The default value is 3.
521 .Cm ClientAliveInterval
523 .Cm ClientAliveCountMax
524 is left at the default, unresponsive SSH clients
525 will be disconnected after approximately 45 seconds.
527 .Cm ClientAliveCountMax
528 disables connection termination.
529 .It Cm ClientAliveInterval
530 Sets a timeout interval in seconds after which if no data has been received
533 will send a message through the encrypted
534 channel to request a response from the client.
536 is 0, indicating that these messages will not be sent to the client.
538 Specifies whether compression is enabled after
539 the user has authenticated successfully.
543 (a legacy synonym for
550 This keyword can be followed by a list of group name patterns, separated
552 Login is disallowed for users whose primary group or supplementary
553 group list matches one of the patterns.
554 Only group names are valid; a numerical group ID is not recognized.
555 By default, login is allowed for all groups.
556 The allow/deny groups directives are processed in the following order:
562 for more information on patterns.
564 This keyword can be followed by a list of user name patterns, separated
566 Login is disallowed for user names that match one of the patterns.
567 Only user names are valid; a numerical user ID is not recognized.
568 By default, login is allowed for all users.
569 If the pattern takes the form USER@HOST then USER and HOST
570 are separately checked, restricting logins to particular
571 users from particular hosts.
572 HOST criteria may additionally contain addresses to match in CIDR
573 address/masklen format.
574 The allow/deny users directives are processed in the following order:
580 for more information on patterns.
581 .It Cm DisableForwarding
582 Disables all forwarding features, including X11,
585 This option overrides all other forwarding-related options and may
586 simplify restricted configurations.
587 .It Cm ExposeAuthInfo
588 Writes a temporary file containing a list of authentication methods and
589 public credentials (e.g. keys) used to authenticate the user.
590 The location of the file is exposed to the user session through the
592 environment variable.
595 .It Cm FingerprintHash
596 Specifies the hash algorithm used when logging key fingerprints.
604 Forces the execution of the command specified by
606 ignoring any command supplied by the client and
609 The command is invoked by using the user's login shell with the -c option.
610 This applies to shell, command, or subsystem execution.
611 It is most useful inside a
614 The command originally supplied by the client is available in the
615 .Ev SSH_ORIGINAL_COMMAND
616 environment variable.
617 Specifying a command of
619 will force the use of an in-process SFTP server that requires no support
621 .Cm ChrootDirectory .
625 Specifies whether remote hosts are allowed to connect to ports
626 forwarded for the client.
629 binds remote port forwardings to the loopback address.
630 This prevents other remote hosts from connecting to forwarded ports.
632 can be used to specify that sshd
633 should allow remote port forwardings to bind to non-loopback addresses, thus
634 allowing other hosts to connect.
637 to force remote port forwardings to be available to the local host only,
639 to force remote port forwardings to bind to the wildcard address, or
641 to allow the client to select the address to which the forwarding is bound.
644 .It Cm GSSAPIAuthentication
645 Specifies whether user authentication based on GSSAPI is allowed.
648 .It Cm GSSAPICleanupCredentials
649 Specifies whether to automatically destroy the user's credentials cache
653 .It Cm GSSAPIStrictAcceptorCheck
654 Determines whether to be strict about the identity of the GSSAPI acceptor
655 a client authenticates against.
658 then the client must authenticate against the host
659 service on the current hostname.
662 then the client may authenticate against any service key stored in the
663 machine's default store.
664 This facility is provided to assist with operation on multi homed machines.
667 .It Cm HostbasedAcceptedAlgorithms
668 Specifies the signature algorithms that will be accepted for hostbased
669 authentication as a list of comma-separated patterns.
670 Alternately if the specified list begins with a
672 character, then the specified signature algorithms will be appended to
673 the default set instead of replacing them.
674 If the specified list begins with a
676 character, then the specified signature algorithms (including wildcards)
677 will be removed from the default set instead of replacing them.
678 If the specified list begins with a
680 character, then the specified signature algorithms will be placed at
681 the head of the default set.
682 The default for this option is:
683 .Bd -literal -offset 3n
684 ssh-ed25519-cert-v01@openssh.com,
685 ecdsa-sha2-nistp256-cert-v01@openssh.com,
686 ecdsa-sha2-nistp384-cert-v01@openssh.com,
687 ecdsa-sha2-nistp521-cert-v01@openssh.com,
688 sk-ssh-ed25519-cert-v01@openssh.com,
689 sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
690 rsa-sha2-512-cert-v01@openssh.com,
691 rsa-sha2-256-cert-v01@openssh.com,
693 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
694 sk-ssh-ed25519@openssh.com,
695 sk-ecdsa-sha2-nistp256@openssh.com,
696 rsa-sha2-512,rsa-sha2-256
699 The list of available signature algorithms may also be obtained using
700 .Qq ssh -Q HostbasedAcceptedAlgorithms .
701 This was formerly named HostbasedAcceptedKeyTypes.
702 .It Cm HostbasedAuthentication
703 Specifies whether rhosts or /etc/hosts.equiv authentication together
704 with successful public key client host authentication is allowed
705 (host-based authentication).
708 .It Cm HostbasedUsesNameFromPacketOnly
709 Specifies whether or not the server will attempt to perform a reverse
710 name lookup when matching the name in the
716 .Cm HostbasedAuthentication .
721 uses the name supplied by the client rather than
722 attempting to resolve the name from the TCP connection itself.
725 .It Cm HostCertificate
726 Specifies a file containing a public host certificate.
727 The certificate's public key must match a private host key already specified
730 The default behaviour of
732 is not to load any certificates.
734 Specifies a file containing a private host key
737 .Pa /etc/ssh/ssh_host_ecdsa_key ,
738 .Pa /etc/ssh/ssh_host_ed25519_key
740 .Pa /etc/ssh/ssh_host_rsa_key .
744 will refuse to use a file if it is group/world-accessible
746 .Cm HostKeyAlgorithms
747 option restricts which of the keys are actually used by
750 It is possible to have multiple host key files.
751 It is also possible to specify public host key files instead.
752 In this case operations on the private key will be delegated
756 Identifies the UNIX-domain socket used to communicate
757 with an agent that has access to the private host keys.
760 is specified, the location of the socket will be read from the
762 environment variable.
763 .It Cm HostKeyAlgorithms
764 Specifies the host key signature algorithms
765 that the server offers.
766 The default for this option is:
767 .Bd -literal -offset 3n
768 ssh-ed25519-cert-v01@openssh.com,
769 ecdsa-sha2-nistp256-cert-v01@openssh.com,
770 ecdsa-sha2-nistp384-cert-v01@openssh.com,
771 ecdsa-sha2-nistp521-cert-v01@openssh.com,
772 sk-ssh-ed25519-cert-v01@openssh.com,
773 sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
774 rsa-sha2-512-cert-v01@openssh.com,
775 rsa-sha2-256-cert-v01@openssh.com,
777 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
778 sk-ssh-ed25519@openssh.com,
779 sk-ecdsa-sha2-nistp256@openssh.com,
780 rsa-sha2-512,rsa-sha2-256
783 The list of available signature algorithms may also be obtained using
784 .Qq ssh -Q HostKeyAlgorithms .
786 Specifies whether to ignore per-user
791 .Cm HostbasedAuthentication .
795 .Pa /etc/ssh/shosts.equiv
796 are still used regardless of this setting.
800 (the default) to ignore all per-user files,
812 .It Cm IgnoreUserKnownHosts
815 should ignore the user's
816 .Pa ~/.ssh/known_hosts
818 .Cm HostbasedAuthentication
819 and use only the system-wide known hosts file
820 .Pa /etc/ssh/ssh_known_hosts .
824 Include the specified configuration file(s).
825 Multiple pathnames may be specified and each pathname may contain
827 wildcards that will be expanded and processed in lexical order.
828 Files without absolute paths are assumed to be in
832 directive may appear inside a
835 to perform conditional inclusion.
837 Specifies the IPv4 type-of-service or DSCP class for the connection.
866 to use the operating system default.
867 This option may take one or two arguments, separated by whitespace.
868 If one argument is specified, it is used as the packet class unconditionally.
869 If two values are specified, the first is automatically selected for
870 interactive sessions and the second for non-interactive sessions.
874 for interactive sessions and
877 for non-interactive sessions.
878 .It Cm KbdInteractiveAuthentication
879 Specifies whether to allow keyboard-interactive authentication.
880 All authentication styles from
885 The argument to this keyword must be
889 .Cm ChallengeResponseAuthentication
890 is a deprecated alias for this.
891 .It Cm KerberosAuthentication
892 Specifies whether the password provided by the user for
893 .Cm PasswordAuthentication
894 will be validated through the Kerberos KDC.
895 To use this option, the server needs a
896 Kerberos servtab which allows the verification of the KDC's identity.
899 .It Cm KerberosGetAFSToken
900 If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
901 an AFS token before accessing the user's home directory.
904 .It Cm KerberosOrLocalPasswd
905 If password authentication through Kerberos fails then
906 the password will be validated via any additional local mechanism
911 .It Cm KerberosTicketCleanup
912 Specifies whether to automatically destroy the user's ticket cache
917 Specifies the available KEX (Key Exchange) algorithms.
918 Multiple algorithms must be comma-separated.
919 Alternately if the specified list begins with a
921 character, then the specified algorithms will be appended to the default set
922 instead of replacing them.
923 If the specified list begins with a
925 character, then the specified algorithms (including wildcards) will be removed
926 from the default set instead of replacing them.
927 If the specified list begins with a
929 character, then the specified algorithms will be placed at the head of the
931 The supported algorithms are:
933 .Bl -item -compact -offset indent
937 curve25519-sha256@libssh.org
939 diffie-hellman-group1-sha1
941 diffie-hellman-group14-sha1
943 diffie-hellman-group14-sha256
945 diffie-hellman-group16-sha512
947 diffie-hellman-group18-sha512
949 diffie-hellman-group-exchange-sha1
951 diffie-hellman-group-exchange-sha256
959 sntrup761x25519-sha512@openssh.com
963 .Bd -literal -offset indent
964 sntrup761x25519-sha512@openssh.com,
965 curve25519-sha256,curve25519-sha256@libssh.org,
966 ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
967 diffie-hellman-group-exchange-sha256,
968 diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,
969 diffie-hellman-group14-sha256
972 The list of available key exchange algorithms may also be obtained using
973 .Qq ssh -Q KexAlgorithms .
975 Specifies the local addresses
978 The following forms may be used:
980 .Bl -item -offset indent -compact
984 .Ar hostname | address
986 .Op Cm rdomain Ar domain
992 .Op Cm rdomain Ar domain
996 .Ar IPv4_address : port
998 .Op Cm rdomain Ar domain
1002 .Oo Ar hostname | address Oc : Ar port
1004 .Op Cm rdomain Ar domain
1011 listen in an explicit routing domain.
1015 sshd will listen on the address and all
1018 The default is to listen on all local addresses on the current default
1022 options are permitted.
1023 For more information on routing domains, see
1025 .It Cm LoginGraceTime
1026 The server disconnects after this time if the user has not
1027 successfully logged in.
1028 If the value is 0, there is no time limit.
1029 The default is 120 seconds.
1031 Gives the verbosity level that is used when logging messages from
1033 The possible values are:
1034 QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
1035 The default is INFO.
1036 DEBUG and DEBUG1 are equivalent.
1037 DEBUG2 and DEBUG3 each specify higher levels of debugging output.
1038 Logging with a DEBUG level violates the privacy of users and is not recommended.
1040 Specify one or more overrides to LogLevel.
1041 An override consists of a pattern lists that matches the source file, function
1042 and line number to force detailed logging for.
1043 For example, an override pattern of:
1044 .Bd -literal -offset indent
1045 kex.c:*:1000,*:kex_exchange_identification():*,packet.c:*
1048 would enable detailed logging for line 1000 of
1051 .Fn kex_exchange_identification
1052 function, and all code in the
1055 This option is intended for debugging and no overrides are enabled by default.
1057 Specifies the available MAC (message authentication code) algorithms.
1058 The MAC algorithm is used for data integrity protection.
1059 Multiple algorithms must be comma-separated.
1060 If the specified list begins with a
1062 character, then the specified algorithms will be appended to the default set
1063 instead of replacing them.
1064 If the specified list begins with a
1066 character, then the specified algorithms (including wildcards) will be removed
1067 from the default set instead of replacing them.
1068 If the specified list begins with a
1070 character, then the specified algorithms will be placed at the head of the
1073 The algorithms that contain
1075 calculate the MAC after encryption (encrypt-then-mac).
1076 These are considered safer and their use recommended.
1077 The supported MACs are:
1079 .Bl -item -compact -offset indent
1095 umac-128@openssh.com
1097 hmac-md5-etm@openssh.com
1099 hmac-md5-96-etm@openssh.com
1101 hmac-sha1-etm@openssh.com
1103 hmac-sha1-96-etm@openssh.com
1105 hmac-sha2-256-etm@openssh.com
1107 hmac-sha2-512-etm@openssh.com
1109 umac-64-etm@openssh.com
1111 umac-128-etm@openssh.com
1115 .Bd -literal -offset indent
1116 umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1117 hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
1118 hmac-sha1-etm@openssh.com,
1119 umac-64@openssh.com,umac-128@openssh.com,
1120 hmac-sha2-256,hmac-sha2-512,hmac-sha1
1123 The list of available MAC algorithms may also be obtained using
1126 Introduces a conditional block.
1127 If all of the criteria on the
1129 line are satisfied, the keywords on the following lines override those
1130 set in the global section of the config file, until either another
1132 line or the end of the file.
1133 If a keyword appears in multiple
1135 blocks that are satisfied, only the first instance of the keyword is
1140 are one or more criteria-pattern pairs or the single token
1142 which matches all criteria.
1143 The available criteria are
1156 on which the connection was received).
1158 The match patterns may consist of single entries or comma-separated
1159 lists and may use the wildcard and negation operators described in the
1166 criteria may additionally contain addresses to match in CIDR
1167 address/masklen format,
1168 such as 192.0.2.0/24 or 2001:db8::/32.
1169 Note that the mask length provided must be consistent with the address -
1170 it is an error to specify a mask length that is too long for the address
1171 or one with bits set in this host portion of the address.
1172 For example, 192.0.2.0/33 and 192.0.2.0/8, respectively.
1174 Only a subset of keywords may be used on the lines following a
1177 Available keywords are
1179 .Cm AllowAgentForwarding ,
1181 .Cm AllowStreamLocalForwarding ,
1182 .Cm AllowTcpForwarding ,
1184 .Cm AuthenticationMethods ,
1185 .Cm AuthorizedKeysCommand ,
1186 .Cm AuthorizedKeysCommandUser ,
1187 .Cm AuthorizedKeysFile ,
1188 .Cm AuthorizedPrincipalsCommand ,
1189 .Cm AuthorizedPrincipalsCommandUser ,
1190 .Cm AuthorizedPrincipalsFile ,
1192 .Cm CASignatureAlgorithms ,
1193 .Cm ChrootDirectory ,
1194 .Cm ClientAliveCountMax ,
1195 .Cm ClientAliveInterval ,
1198 .Cm DisableForwarding ,
1199 .Cm ExposeAuthInfo ,
1202 .Cm GSSAPIAuthentication ,
1203 .Cm HostbasedAcceptedAlgorithms ,
1204 .Cm HostbasedAuthentication ,
1205 .Cm HostbasedUsesNameFromPacketOnly ,
1209 .Cm KbdInteractiveAuthentication ,
1210 .Cm KerberosAuthentication ,
1214 .Cm PasswordAuthentication ,
1215 .Cm PermitEmptyPasswords ,
1218 .Cm PermitRootLogin ,
1222 .Cm PubkeyAcceptedAlgorithms ,
1223 .Cm PubkeyAuthentication ,
1224 .Cm PubkeyAuthOptions ,
1229 .Cm StreamLocalBindMask ,
1230 .Cm StreamLocalBindUnlink ,
1231 .Cm TrustedUserCAKeys ,
1232 .Cm X11DisplayOffset ,
1235 .Cm X11UseLocalhost .
1237 Specifies the maximum number of authentication attempts permitted per
1239 Once the number of failures reaches half this value,
1240 additional failures are logged.
1243 Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1244 sessions permitted per network connection.
1245 Multiple sessions may be established by clients that support connection
1249 to 1 will effectively disable session multiplexing, whereas setting it to 0
1250 will prevent all shell, login and subsystem sessions while still permitting
1254 Specifies the maximum number of concurrent unauthenticated connections to the
1256 Additional connections will be dropped until authentication succeeds or the
1258 expires for a connection.
1259 The default is 10:30:100.
1261 Alternatively, random early drop can be enabled by specifying
1262 the three colon separated values
1263 start:rate:full (e.g. "10:30:60").
1265 will refuse connection attempts with a probability of rate/100 (30%)
1266 if there are currently start (10) unauthenticated connections.
1267 The probability increases linearly and all connection attempts
1268 are refused if the number of unauthenticated connections reaches full (60).
1272 file that contains the Diffie-Hellman groups used for the
1273 .Dq diffie-hellman-group-exchange-sha1
1275 .Dq diffie-hellman-group-exchange-sha256
1276 key exchange methods.
1279 .It Cm PasswordAuthentication
1280 Specifies whether password authentication is allowed.
1281 Note that passwords may also be accepted via
1282 .Cm KbdInteractiveAuthentication .
1287 .It Cm PermitEmptyPasswords
1288 When password authentication is allowed, it specifies whether the
1289 server allows login to accounts with empty password strings.
1293 Specifies the addresses/ports on which a remote TCP port forwarding may listen.
1294 The listen specification must be one of the following forms:
1296 .Bl -item -offset indent -compact
1309 Multiple permissions may be specified by separating them with whitespace.
1312 can be used to remove all restrictions and permit any listen requests.
1315 can be used to prohibit all listen requests.
1316 The host name may contain wildcards as described in the PATTERNS section in
1320 can also be used in place of a port number to allow all ports.
1321 By default all port forwarding listen requests are permitted.
1324 option may further restrict which addresses may be listened on.
1327 will request a listen host of
1329 if no listen host was specifically requested, and this name is
1330 treated differently to explicit localhost addresses of
1335 Specifies the destinations to which TCP port forwarding is permitted.
1336 The forwarding specification must be one of the following forms:
1338 .Bl -item -offset indent -compact
1347 .Ar IPv4_addr : port
1352 .Ar \&[ IPv6_addr \&] : port
1356 Multiple forwards may be specified by separating them with whitespace.
1359 can be used to remove all restrictions and permit any forwarding requests.
1362 can be used to prohibit all forwarding requests.
1365 can be used for host or port to allow all hosts or ports respectively.
1366 Otherwise, no pattern matching or address lookups are performed on supplied
1368 By default all port forwarding requests are permitted.
1369 .It Cm PermitRootLogin
1370 Specifies whether root can log in using
1372 The argument must be
1374 .Cm prohibit-password ,
1375 .Cm forced-commands-only ,
1381 .Cm ChallengeResponseAuthentication
1386 this setting may be overridden by the PAM policy.
1388 If this option is set to
1389 .Cm prohibit-password
1390 (or its deprecated alias,
1391 .Cm without-password ) ,
1392 password and keyboard-interactive authentication are disabled for root.
1394 If this option is set to
1395 .Cm forced-commands-only ,
1396 root login with public key authentication will be allowed,
1399 option has been specified
1400 (which may be useful for taking remote backups even if root login is
1401 normally not allowed).
1402 All other authentication methods are disabled for root.
1404 If this option is set to
1406 root is not allowed to log in.
1410 allocation is permitted.
1416 device forwarding is allowed.
1417 The argument must be
1433 Independent of this setting, the permissions of the selected
1435 device must allow access to the user.
1436 .It Cm PermitUserEnvironment
1438 .Pa ~/.ssh/environment
1442 .Pa ~/.ssh/authorized_keys
1448 or a pattern-list specifying which environment variable names to accept
1453 Enabling environment processing may enable users to bypass access
1454 restrictions in some configurations using mechanisms such as
1457 Specifies whether any
1462 .It Cm PerSourceMaxStartups
1463 Specifies the number of unauthenticated connections allowed from a
1464 given source address, or
1466 if there is no limit.
1467 This limit is applied in addition to
1472 .It Cm PerSourceNetBlockSize
1473 Specifies the number of bits of source address that are grouped together
1474 for the purposes of applying PerSourceMaxStartups limits.
1475 Values for IPv4 and optionally IPv6 may be specified, separated by a colon.
1478 which means each address is considered individually.
1480 Specifies the file that contains the process ID of the
1485 .Pa /var/run/sshd.pid .
1487 Specifies the port number that
1491 Multiple options of this type are permitted.
1497 should print the date and time of the last user login when a user logs
1506 when a user logs in interactively.
1507 (On some systems it is also printed by the shell,
1512 .It Cm PubkeyAcceptedAlgorithms
1513 Specifies the signature algorithms that will be accepted for public key
1514 authentication as a list of comma-separated patterns.
1515 Alternately if the specified list begins with a
1517 character, then the specified algorithms will be appended to the default set
1518 instead of replacing them.
1519 If the specified list begins with a
1521 character, then the specified algorithms (including wildcards) will be removed
1522 from the default set instead of replacing them.
1523 If the specified list begins with a
1525 character, then the specified algorithms will be placed at the head of the
1527 The default for this option is:
1528 .Bd -literal -offset 3n
1529 ssh-ed25519-cert-v01@openssh.com,
1530 ecdsa-sha2-nistp256-cert-v01@openssh.com,
1531 ecdsa-sha2-nistp384-cert-v01@openssh.com,
1532 ecdsa-sha2-nistp521-cert-v01@openssh.com,
1533 sk-ssh-ed25519-cert-v01@openssh.com,
1534 sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
1535 rsa-sha2-512-cert-v01@openssh.com,
1536 rsa-sha2-256-cert-v01@openssh.com,
1538 ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1539 sk-ssh-ed25519@openssh.com,
1540 sk-ecdsa-sha2-nistp256@openssh.com,
1541 rsa-sha2-512,rsa-sha2-256
1544 The list of available signature algorithms may also be obtained using
1545 .Qq ssh -Q PubkeyAcceptedAlgorithms .
1546 .It Cm PubkeyAuthOptions
1547 Sets one or more public key authentication options.
1548 The supported keywords are:
1550 (the default; indicating no additional options are enabled),
1553 .Cm verify-required .
1557 option causes public key authentication using a FIDO authenticator algorithm
1562 to always require the signature to attest that a physically present user
1563 explicitly confirmed the authentication (usually by touching the authenticator).
1566 requires user presence unless overridden with an authorized_keys option.
1569 flag disables this override.
1573 option requires a FIDO key signature attest that the user was verified,
1580 options have any effect for other, non-FIDO, public key types.
1581 .It Cm PubkeyAuthentication
1582 Specifies whether public key authentication is allowed.
1586 Specifies the maximum amount of data that may be transmitted or received
1587 before the session key is renegotiated, optionally followed by a maximum
1588 amount of time that may pass before the session key is renegotiated.
1589 The first argument is specified in bytes and may have a suffix of
1594 to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1595 The default is between
1599 depending on the cipher.
1600 The optional second value is specified in seconds and may use any of the
1601 units documented in the
1604 The default value for
1608 which means that rekeying is performed after the cipher's default amount
1609 of data has been sent or received and no time based rekeying is done.
1610 .It Cm RequiredRSASize
1611 Specifies the minimum RSA key size (in bits) that
1614 User and host-based authentication keys smaller than this limit will be
1619 Note that this limit may only be raised from the default.
1621 Specifies revoked public keys file, or
1624 Keys listed in this file will be refused for public key authentication.
1625 Note that if this file is not readable, then public key authentication will
1626 be refused for all users.
1627 Keys may be specified as a text file, listing one public key per line, or as
1628 an OpenSSH Key Revocation List (KRL) as generated by
1630 For more information on KRLs, see the KEY REVOCATION LISTS section in
1633 Specifies an explicit routing domain that is applied after authentication
1635 The user session, as well as any forwarded or listening IP sockets,
1636 will be bound to this
1638 If the routing domain is set to
1640 then the domain in which the incoming connection was received will be applied.
1641 .It Cm SecurityKeyProvider
1642 Specifies a path to a library that will be used when loading
1643 FIDO authenticator-hosted keys, overriding the default of using
1644 the built-in USB HID support.
1646 Specifies one or more environment variables to set in child sessions started
1651 The environment value may be quoted (e.g. if it contains whitespace
1653 Environment variables set by
1655 override the default environment and any variables specified by the user
1659 .Cm PermitUserEnvironment .
1660 .It Cm StreamLocalBindMask
1661 Sets the octal file creation mode mask
1663 used when creating a Unix-domain socket file for local or remote
1665 This option is only used for port forwarding to a Unix-domain socket file.
1667 The default value is 0177, which creates a Unix-domain socket file that is
1668 readable and writable only by the owner.
1669 Note that not all operating systems honor the file mode on Unix-domain
1671 .It Cm StreamLocalBindUnlink
1672 Specifies whether to remove an existing Unix-domain socket file for local
1673 or remote port forwarding before creating a new one.
1674 If the socket file already exists and
1675 .Cm StreamLocalBindUnlink
1678 will be unable to forward the port to the Unix-domain socket file.
1679 This option is only used for port forwarding to a Unix-domain socket file.
1681 The argument must be
1690 should check file modes and ownership of the
1691 user's files and home directory before accepting login.
1692 This is normally desirable because novices sometimes accidentally leave their
1693 directory or files world-writable.
1696 Note that this does not apply to
1697 .Cm ChrootDirectory ,
1698 whose permissions and ownership are checked unconditionally.
1700 Configures an external subsystem (e.g. file transfer daemon).
1701 Arguments should be a subsystem name and a command (with optional arguments)
1702 to execute upon subsystem request.
1706 implements the SFTP file transfer subsystem.
1708 Alternately the name
1710 implements an in-process SFTP server.
1711 This may simplify configurations using
1713 to force a different filesystem root on clients.
1715 By default no subsystems are defined.
1716 .It Cm SyslogFacility
1717 Gives the facility code that is used when logging messages from
1719 The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1720 LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1721 The default is AUTH.
1723 Specifies whether the system should send TCP keepalive messages to the
1725 If they are sent, death of the connection or crash of one
1726 of the machines will be properly noticed.
1727 However, this means that
1728 connections will die if the route is down temporarily, and some people
1730 On the other hand, if TCP keepalives are not sent,
1731 sessions may hang indefinitely on the server, leaving
1733 users and consuming server resources.
1737 (to send TCP keepalive messages), and the server will notice
1738 if the network goes down or the client host crashes.
1739 This avoids infinitely hanging sessions.
1741 To disable TCP keepalive messages, the value should be set to
1743 .It Cm TrustedUserCAKeys
1744 Specifies a file containing public keys of certificate authorities that are
1745 trusted to sign user certificates for authentication, or
1748 Keys are listed one per line; empty lines and comments starting with
1751 If a certificate is presented for authentication and has its signing CA key
1752 listed in this file, then it may be used for authentication for any user
1753 listed in the certificate's principals list.
1754 Note that certificates that lack a list of principals will not be permitted
1755 for authentication using
1756 .Cm TrustedUserCAKeys .
1757 For more details on certificates, see the CERTIFICATES section in
1762 attempts to send authentication success and failure messages
1768 For forward compatibility with an upcoming
1772 alias can be used instead.
1776 should look up the remote host name, and to check that
1777 the resolved host name for the remote IP address maps back to the
1778 very same IP address.
1780 If this option is set to
1782 then only addresses and not host names may be used in
1783 .Pa ~/.ssh/authorized_keys
1793 Enables the Pluggable Authentication Module interface.
1796 this will enable PAM authentication using
1797 .Cm KbdInteractiveAuthentication
1799 .Cm PasswordAuthentication
1800 in addition to PAM account and session module processing for all
1801 authentication types.
1803 Because PAM keyboard-interactive authentication usually serves an equivalent
1804 role to password authentication, you should disable either
1805 .Cm PasswordAuthentication
1807 .Cm KbdInteractiveAuthentication .
1811 is enabled, you will not be able to run
1816 .It Cm VersionAddendum
1817 Optionally specifies additional text to append to the SSH protocol banner
1818 sent by the server upon connection.
1820 .Qq FreeBSD-20221019 .
1823 may be used to disable this.
1824 .It Cm X11DisplayOffset
1825 Specifies the first display number available for
1828 This prevents sshd from interfering with real X11 servers.
1830 .It Cm X11Forwarding
1831 Specifies whether X11 forwarding is permitted.
1832 The argument must be
1839 When X11 forwarding is enabled, there may be additional exposure to
1840 the server and to client displays if the
1842 proxy display is configured to listen on the wildcard address (see
1843 .Cm X11UseLocalhost ) ,
1844 though this is not the default.
1845 Additionally, the authentication spoofing and authentication data
1846 verification and substitution occur on the client side.
1847 The security risk of using X11 forwarding is that the client's X11
1848 display server may be exposed to attack when the SSH client requests
1849 forwarding (see the warnings for
1852 .Xr ssh_config 5 ) .
1853 A system administrator may have a stance in which they want to
1854 protect clients that may expose themselves to attack by unwittingly
1855 requesting X11 forwarding, which can warrant a
1859 Note that disabling X11 forwarding does not prevent users from
1860 forwarding X11 traffic, as users can always install their own forwarders.
1861 .It Cm X11UseLocalhost
1864 should bind the X11 forwarding server to the loopback address or to
1865 the wildcard address.
1867 sshd binds the forwarding server to the loopback address and sets the
1868 hostname part of the
1870 environment variable to
1872 This prevents remote hosts from connecting to the proxy display.
1873 However, some older X11 clients may not function with this
1878 to specify that the forwarding server should be bound to the wildcard
1880 The argument must be
1886 .It Cm XAuthLocation
1887 Specifies the full pathname of the
1893 .Pa /usr/local/bin/xauth .
1897 command-line arguments and configuration file options that specify time
1898 may be expressed using a sequence of the form:
1900 .Ar time Op Ar qualifier ,
1904 is a positive integer value and
1906 is one of the following:
1908 .Bl -tag -width Ds -compact -offset indent
1923 Each member of the sequence is added together to calculate
1924 the total time value.
1926 Time format examples:
1928 .Bl -tag -width Ds -compact -offset indent
1930 600 seconds (10 minutes)
1934 1 hour 30 minutes (90 minutes)
1937 Arguments to some keywords can make use of tokens,
1938 which are expanded at runtime:
1940 .Bl -tag -width XXXX -offset indent -compact
1945 The routing domain in which the incoming connection was received.
1947 The fingerprint of the CA key.
1949 The fingerprint of the key or certificate.
1951 The home directory of the user.
1953 The key ID in the certificate.
1955 The base64-encoded CA key.
1957 The base64-encoded key or certificate for authentication.
1959 The serial number of the certificate.
1961 The type of the CA key.
1963 The key or certificate type.
1965 The numeric user ID of the target user.
1970 .Cm AuthorizedKeysCommand
1971 accepts the tokens %%, %f, %h, %k, %t, %U, and %u.
1973 .Cm AuthorizedKeysFile
1974 accepts the tokens %%, %h, %U, and %u.
1976 .Cm AuthorizedPrincipalsCommand
1977 accepts the tokens %%, %F, %f, %h, %i, %K, %k, %s, %T, %t, %U, and %u.
1979 .Cm AuthorizedPrincipalsFile
1980 accepts the tokens %%, %h, %U, and %u.
1983 accepts the tokens %%, %h, %U, and %u.
1986 accepts the token %D.
1989 .It Pa /etc/ssh/sshd_config
1990 Contains configuration data for
1992 This file should be writable by root only, but it is recommended
1993 (though not necessary) that it be world-readable.
2000 OpenSSH is a derivative of the original and free
2001 ssh 1.2.12 release by
2003 .An Aaron Campbell , Bob Beck , Markus Friedl , Niels Provos ,
2007 removed many bugs, re-added newer features and
2010 contributed the support for SSH protocol versions 1.5 and 2.0.
2014 contributed support for privilege separation.