xref: /freebsd/crypto/openssh/sshd_config.5 (revision 716fd348)
1.\"
2.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
3.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4.\"                    All rights reserved
5.\"
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".
11.\"
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.
15.\"
16.\" Redistribution and use in source and binary forms, with or without
17.\" modification, are permitted provided that the following conditions
18.\" are met:
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.
24.\"
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.
35.\"
36.\" $OpenBSD: sshd_config.5,v 1.340 2022/03/31 17:58:44 naddy Exp $
37.Dd $Mdocdate: March 31 2022 $
38.Dt SSHD_CONFIG 5
39.Os
40.Sh NAME
41.Nm sshd_config
42.Nd OpenSSH daemon configuration file
43.Sh DESCRIPTION
44.Xr sshd 8
45reads configuration data from
46.Pa /etc/ssh/sshd_config
47(or the file specified with
48.Fl f
49on the command line).
50The file contains keyword-argument pairs, one per line.
51For each keyword, the first obtained value will be used.
52Lines starting with
53.Ql #
54and empty lines are interpreted as comments.
55Arguments may optionally be enclosed in double quotes
56.Pq \&"
57in order to represent arguments containing spaces.
58.Pp
59The possible
60keywords and their meanings are as follows (note that
61keywords are case-insensitive and arguments are case-sensitive):
62.Bl -tag -width Ds
63.It Cm AcceptEnv
64Specifies what environment variables sent by the client will be copied into
65the session's
66.Xr environ 7 .
67See
68.Cm SendEnv
69and
70.Cm SetEnv
71in
72.Xr ssh_config 5
73for how to configure the client.
74The
75.Ev TERM
76environment variable is always accepted whenever the client
77requests a pseudo-terminal as it is required by the protocol.
78Variables are specified by name, which may contain the wildcard characters
79.Ql *
80and
81.Ql \&? .
82Multiple environment variables may be separated by whitespace or spread
83across multiple
84.Cm AcceptEnv
85directives.
86Be warned that some environment variables could be used to bypass restricted
87user environments.
88For this reason, care should be taken in the use of this directive.
89The default is not to accept any environment variables.
90.It Cm AddressFamily
91Specifies which address family should be used by
92.Xr sshd 8 .
93Valid arguments are
94.Cm any
95(the default),
96.Cm inet
97(use IPv4 only), or
98.Cm inet6
99(use IPv6 only).
100.It Cm AllowAgentForwarding
101Specifies whether
102.Xr ssh-agent 1
103forwarding is permitted.
104The default is
105.Cm yes .
106Note that disabling agent forwarding does not improve security
107unless users are also denied shell access, as they can always install
108their own forwarders.
109.It Cm AllowGroups
110This keyword can be followed by a list of group name patterns, separated
111by spaces.
112If specified, login is allowed only for users whose primary
113group or supplementary group list matches one of the patterns.
114Only group names are valid; a numerical group ID is not recognized.
115By default, login is allowed for all groups.
116The allow/deny groups directives are processed in the following order:
117.Cm DenyGroups ,
118.Cm AllowGroups .
119.Pp
120See PATTERNS in
121.Xr ssh_config 5
122for more information on patterns.
123.It Cm AllowStreamLocalForwarding
124Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
125The available options are
126.Cm yes
127(the default)
128or
129.Cm all
130to allow StreamLocal forwarding,
131.Cm no
132to prevent all StreamLocal forwarding,
133.Cm local
134to allow local (from the perspective of
135.Xr ssh 1 )
136forwarding only or
137.Cm remote
138to allow remote forwarding only.
139Note that disabling StreamLocal forwarding does not improve security unless
140users are also denied shell access, as they can always install their
141own forwarders.
142.It Cm AllowTcpForwarding
143Specifies whether TCP forwarding is permitted.
144The available options are
145.Cm yes
146(the default)
147or
148.Cm all
149to allow TCP forwarding,
150.Cm no
151to prevent all TCP forwarding,
152.Cm local
153to allow local (from the perspective of
154.Xr ssh 1 )
155forwarding only or
156.Cm remote
157to allow remote forwarding only.
158Note that disabling TCP forwarding does not improve security unless
159users are also denied shell access, as they can always install their
160own forwarders.
161.It Cm AllowUsers
162This keyword can be followed by a list of user name patterns, separated
163by spaces.
164If specified, login is allowed only for user names that
165match one of the patterns.
166Only user names are valid; a numerical user ID is not recognized.
167By default, login is allowed for all users.
168If the pattern takes the form USER@HOST then USER and HOST
169are separately checked, restricting logins to particular
170users from particular hosts.
171HOST criteria may additionally contain addresses to match in CIDR
172address/masklen format.
173The allow/deny users directives are processed in the following order:
174.Cm DenyUsers ,
175.Cm AllowUsers .
176.Pp
177See PATTERNS in
178.Xr ssh_config 5
179for more information on patterns.
180.It Cm AuthenticationMethods
181Specifies the authentication methods that must be successfully completed
182for a user to be granted access.
183This option must be followed by one or more lists of comma-separated
184authentication method names, or by the single string
185.Cm any
186to indicate the default behaviour of accepting any single authentication
187method.
188If the default is overridden, then successful authentication requires
189completion of every method in at least one of these lists.
190.Pp
191For example,
192.Qq publickey,password publickey,keyboard-interactive
193would require the user to complete public key authentication, followed by
194either password or keyboard interactive authentication.
195Only methods that are next in one or more lists are offered at each stage,
196so for this example it would not be possible to attempt password or
197keyboard-interactive authentication before public key.
198.Pp
199For keyboard interactive authentication it is also possible to
200restrict authentication to a specific device by appending a
201colon followed by the device identifier
202.Cm bsdauth
203or
204.Cm pam .
205depending on the server configuration.
206For example,
207.Qq keyboard-interactive:bsdauth
208would restrict keyboard interactive authentication to the
209.Cm bsdauth
210device.
211.Pp
212If the publickey method is listed more than once,
213.Xr sshd 8
214verifies that keys that have been used successfully are not reused for
215subsequent authentications.
216For example,
217.Qq publickey,publickey
218requires successful authentication using two different public keys.
219.Pp
220Note that each authentication method listed should also be explicitly enabled
221in the configuration.
222.Pp
223The available authentication methods are:
224.Qq gssapi-with-mic ,
225.Qq hostbased ,
226.Qq keyboard-interactive ,
227.Qq none
228(used for access to password-less accounts when
229.Cm PermitEmptyPasswords
230is enabled),
231.Qq password
232and
233.Qq publickey .
234.It Cm AuthorizedKeysCommand
235Specifies a program to be used to look up the user's public keys.
236The program must be owned by root, not writable by group or others and
237specified by an absolute path.
238Arguments to
239.Cm AuthorizedKeysCommand
240accept the tokens described in the
241.Sx TOKENS
242section.
243If no arguments are specified then the username of the target user is used.
244.Pp
245The program should produce on standard output zero or
246more lines of authorized_keys output (see
247.Sx AUTHORIZED_KEYS
248in
249.Xr sshd 8 ) .
250.Cm AuthorizedKeysCommand
251is tried after the usual
252.Cm AuthorizedKeysFile
253files and will not be executed if a matching key is found there.
254By default, no
255.Cm AuthorizedKeysCommand
256is run.
257.It Cm AuthorizedKeysCommandUser
258Specifies the user under whose account the
259.Cm AuthorizedKeysCommand
260is run.
261It is recommended to use a dedicated user that has no other role on the host
262than running authorized keys commands.
263If
264.Cm AuthorizedKeysCommand
265is specified but
266.Cm AuthorizedKeysCommandUser
267is not, then
268.Xr sshd 8
269will refuse to start.
270.It Cm AuthorizedKeysFile
271Specifies the file that contains the public keys used for user authentication.
272The format is described in the AUTHORIZED_KEYS FILE FORMAT section of
273.Xr sshd 8 .
274Arguments to
275.Cm AuthorizedKeysFile
276accept the tokens described in the
277.Sx TOKENS
278section.
279After expansion,
280.Cm AuthorizedKeysFile
281is taken to be an absolute path or one relative to the user's home
282directory.
283Multiple files may be listed, separated by whitespace.
284Alternately this option may be set to
285.Cm none
286to skip checking for user keys in files.
287The default is
288.Qq .ssh/authorized_keys .ssh/authorized_keys2 .
289.It Cm AuthorizedPrincipalsCommand
290Specifies a program to be used to generate the list of allowed
291certificate principals as per
292.Cm AuthorizedPrincipalsFile .
293The program must be owned by root, not writable by group or others and
294specified by an absolute path.
295Arguments to
296.Cm AuthorizedPrincipalsCommand
297accept the tokens described in the
298.Sx TOKENS
299section.
300If no arguments are specified then the username of the target user is used.
301.Pp
302The program should produce on standard output zero or
303more lines of
304.Cm AuthorizedPrincipalsFile
305output.
306If either
307.Cm AuthorizedPrincipalsCommand
308or
309.Cm AuthorizedPrincipalsFile
310is specified, then certificates offered by the client for authentication
311must contain a principal that is listed.
312By default, no
313.Cm AuthorizedPrincipalsCommand
314is run.
315.It Cm AuthorizedPrincipalsCommandUser
316Specifies the user under whose account the
317.Cm AuthorizedPrincipalsCommand
318is run.
319It is recommended to use a dedicated user that has no other role on the host
320than running authorized principals commands.
321If
322.Cm AuthorizedPrincipalsCommand
323is specified but
324.Cm AuthorizedPrincipalsCommandUser
325is not, then
326.Xr sshd 8
327will refuse to start.
328.It Cm AuthorizedPrincipalsFile
329Specifies a file that lists principal names that are accepted for
330certificate authentication.
331When using certificates signed by a key listed in
332.Cm TrustedUserCAKeys ,
333this file lists names, one of which must appear in the certificate for it
334to be accepted for authentication.
335Names are listed one per line preceded by key options (as described in
336.Sx AUTHORIZED_KEYS FILE FORMAT
337in
338.Xr sshd 8 ) .
339Empty lines and comments starting with
340.Ql #
341are ignored.
342.Pp
343Arguments to
344.Cm AuthorizedPrincipalsFile
345accept the tokens described in the
346.Sx TOKENS
347section.
348After expansion,
349.Cm AuthorizedPrincipalsFile
350is taken to be an absolute path or one relative to the user's home directory.
351The default is
352.Cm none ,
353i.e. not to use a principals file \(en in this case, the username
354of the user must appear in a certificate's principals list for it to be
355accepted.
356.Pp
357Note that
358.Cm AuthorizedPrincipalsFile
359is only used when authentication proceeds using a CA listed in
360.Cm TrustedUserCAKeys
361and is not consulted for certification authorities trusted via
362.Pa ~/.ssh/authorized_keys ,
363though the
364.Cm principals=
365key option offers a similar facility (see
366.Xr sshd 8
367for details).
368.It Cm Banner
369The contents of the specified file are sent to the remote user before
370authentication is allowed.
371If the argument is
372.Cm none
373then no banner is displayed.
374By default, no banner is displayed.
375.It Cm CASignatureAlgorithms
376Specifies which algorithms are allowed for signing of certificates
377by certificate authorities (CAs).
378The default is:
379.Bd -literal -offset indent
380ssh-ed25519,ecdsa-sha2-nistp256,
381ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
382sk-ssh-ed25519@openssh.com,
383sk-ecdsa-sha2-nistp256@openssh.com,
384rsa-sha2-512,rsa-sha2-256
385.Ed
386.Pp
387If the specified list begins with a
388.Sq +
389character, then the specified algorithms will be appended to the default set
390instead of replacing them.
391If the specified list begins with a
392.Sq -
393character, then the specified algorithms (including wildcards) will be removed
394from the default set instead of replacing them.
395.Pp
396Certificates signed using other algorithms will not be accepted for
397public key or host-based authentication.
398.It Cm ChrootDirectory
399Specifies the pathname of a directory to
400.Xr chroot 2
401to after authentication.
402At session startup
403.Xr sshd 8
404checks that all components of the pathname are root-owned directories
405which are not writable by any other user or group.
406After the chroot,
407.Xr sshd 8
408changes the working directory to the user's home directory.
409Arguments to
410.Cm ChrootDirectory
411accept the tokens described in the
412.Sx TOKENS
413section.
414.Pp
415The
416.Cm ChrootDirectory
417must contain the necessary files and directories to support the
418user's session.
419For an interactive session this requires at least a shell, typically
420.Xr sh 1 ,
421and basic
422.Pa /dev
423nodes such as
424.Xr null 4 ,
425.Xr zero 4 ,
426.Xr stdin 4 ,
427.Xr stdout 4 ,
428.Xr stderr 4 ,
429and
430.Xr tty 4
431devices.
432For file transfer sessions using SFTP
433no additional configuration of the environment is necessary if the in-process
434sftp-server is used,
435though sessions which use logging may require
436.Pa /dev/log
437inside the chroot directory on some operating systems (see
438.Xr sftp-server 8
439for details).
440.Pp
441For safety, it is very important that the directory hierarchy be
442prevented from modification by other processes on the system (especially
443those outside the jail).
444Misconfiguration can lead to unsafe environments which
445.Xr sshd 8
446cannot detect.
447.Pp
448The default is
449.Cm none ,
450indicating not to
451.Xr chroot 2 .
452.It Cm Ciphers
453Specifies the ciphers allowed.
454Multiple ciphers must be comma-separated.
455If the specified list begins with a
456.Sq +
457character, then the specified ciphers will be appended to the default set
458instead of replacing them.
459If the specified list begins with a
460.Sq -
461character, then the specified ciphers (including wildcards) will be removed
462from the default set instead of replacing them.
463If the specified list begins with a
464.Sq ^
465character, then the specified ciphers will be placed at the head of the
466default set.
467.Pp
468The supported ciphers are:
469.Pp
470.Bl -item -compact -offset indent
471.It
4723des-cbc
473.It
474aes128-cbc
475.It
476aes192-cbc
477.It
478aes256-cbc
479.It
480aes128-ctr
481.It
482aes192-ctr
483.It
484aes256-ctr
485.It
486aes128-gcm@openssh.com
487.It
488aes256-gcm@openssh.com
489.It
490chacha20-poly1305@openssh.com
491.El
492.Pp
493The default is:
494.Bd -literal -offset indent
495chacha20-poly1305@openssh.com,
496aes128-ctr,aes192-ctr,aes256-ctr,
497aes128-gcm@openssh.com,aes256-gcm@openssh.com
498.Ed
499.Pp
500The list of available ciphers may also be obtained using
501.Qq ssh -Q cipher .
502.It Cm ClientAliveCountMax
503Sets the number of client alive messages which may be sent without
504.Xr sshd 8
505receiving any messages back from the client.
506If this threshold is reached while client alive messages are being sent,
507sshd will disconnect the client, terminating the session.
508It is important to note that the use of client alive messages is very
509different from
510.Cm TCPKeepAlive .
511The client alive messages are sent through the encrypted channel
512and therefore will not be spoofable.
513The TCP keepalive option enabled by
514.Cm TCPKeepAlive
515is spoofable.
516The client alive mechanism is valuable when the client or
517server depend on knowing when a connection has become unresponsive.
518.Pp
519The default value is 3.
520If
521.Cm ClientAliveInterval
522is set to 15, and
523.Cm ClientAliveCountMax
524is left at the default, unresponsive SSH clients
525will be disconnected after approximately 45 seconds.
526Setting a zero
527.Cm ClientAliveCountMax
528disables connection termination.
529.It Cm ClientAliveInterval
530Sets a timeout interval in seconds after which if no data has been received
531from the client,
532.Xr sshd 8
533will send a message through the encrypted
534channel to request a response from the client.
535The default
536is 0, indicating that these messages will not be sent to the client.
537.It Cm Compression
538Specifies whether compression is enabled after
539the user has authenticated successfully.
540The argument must be
541.Cm yes ,
542.Cm delayed
543(a legacy synonym for
544.Cm yes )
545or
546.Cm no .
547The default is
548.Cm yes .
549.It Cm DenyGroups
550This keyword can be followed by a list of group name patterns, separated
551by spaces.
552Login is disallowed for users whose primary group or supplementary
553group list matches one of the patterns.
554Only group names are valid; a numerical group ID is not recognized.
555By default, login is allowed for all groups.
556The allow/deny groups directives are processed in the following order:
557.Cm DenyGroups ,
558.Cm AllowGroups .
559.Pp
560See PATTERNS in
561.Xr ssh_config 5
562for more information on patterns.
563.It Cm DenyUsers
564This keyword can be followed by a list of user name patterns, separated
565by spaces.
566Login is disallowed for user names that match one of the patterns.
567Only user names are valid; a numerical user ID is not recognized.
568By default, login is allowed for all users.
569If the pattern takes the form USER@HOST then USER and HOST
570are separately checked, restricting logins to particular
571users from particular hosts.
572HOST criteria may additionally contain addresses to match in CIDR
573address/masklen format.
574The allow/deny users directives are processed in the following order:
575.Cm DenyUsers ,
576.Cm AllowUsers .
577.Pp
578See PATTERNS in
579.Xr ssh_config 5
580for more information on patterns.
581.It Cm DisableForwarding
582Disables all forwarding features, including X11,
583.Xr ssh-agent 1 ,
584TCP and StreamLocal.
585This option overrides all other forwarding-related options and may
586simplify restricted configurations.
587.It Cm ExposeAuthInfo
588Writes a temporary file containing a list of authentication methods and
589public credentials (e.g. keys) used to authenticate the user.
590The location of the file is exposed to the user session through the
591.Ev SSH_USER_AUTH
592environment variable.
593The default is
594.Cm no .
595.It Cm FingerprintHash
596Specifies the hash algorithm used when logging key fingerprints.
597Valid options are:
598.Cm md5
599and
600.Cm sha256 .
601The default is
602.Cm sha256 .
603.It Cm ForceCommand
604Forces the execution of the command specified by
605.Cm ForceCommand ,
606ignoring any command supplied by the client and
607.Pa ~/.ssh/rc
608if present.
609The command is invoked by using the user's login shell with the -c option.
610This applies to shell, command, or subsystem execution.
611It is most useful inside a
612.Cm Match
613block.
614The command originally supplied by the client is available in the
615.Ev SSH_ORIGINAL_COMMAND
616environment variable.
617Specifying a command of
618.Cm internal-sftp
619will force the use of an in-process SFTP server that requires no support
620files when used with
621.Cm ChrootDirectory .
622The default is
623.Cm none .
624.It Cm GatewayPorts
625Specifies whether remote hosts are allowed to connect to ports
626forwarded for the client.
627By default,
628.Xr sshd 8
629binds remote port forwardings to the loopback address.
630This prevents other remote hosts from connecting to forwarded ports.
631.Cm GatewayPorts
632can be used to specify that sshd
633should allow remote port forwardings to bind to non-loopback addresses, thus
634allowing other hosts to connect.
635The argument may be
636.Cm no
637to force remote port forwardings to be available to the local host only,
638.Cm yes
639to force remote port forwardings to bind to the wildcard address, or
640.Cm clientspecified
641to allow the client to select the address to which the forwarding is bound.
642The default is
643.Cm no .
644.It Cm GSSAPIAuthentication
645Specifies whether user authentication based on GSSAPI is allowed.
646The default is
647.Cm no .
648.It Cm GSSAPICleanupCredentials
649Specifies whether to automatically destroy the user's credentials cache
650on logout.
651The default is
652.Cm yes .
653.It Cm GSSAPIStrictAcceptorCheck
654Determines whether to be strict about the identity of the GSSAPI acceptor
655a client authenticates against.
656If set to
657.Cm yes
658then the client must authenticate against the host
659service on the current hostname.
660If set to
661.Cm no
662then the client may authenticate against any service key stored in the
663machine's default store.
664This facility is provided to assist with operation on multi homed machines.
665The default is
666.Cm yes .
667.It Cm HostbasedAcceptedAlgorithms
668Specifies the signature algorithms that will be accepted for hostbased
669authentication as a list of comma-separated patterns.
670Alternately if the specified list begins with a
671.Sq +
672character, then the specified signature algorithms will be appended to
673the default set instead of replacing them.
674If the specified list begins with a
675.Sq -
676character, then the specified signature algorithms (including wildcards)
677will be removed from the default set instead of replacing them.
678If the specified list begins with a
679.Sq ^
680character, then the specified signature algorithms will be placed at
681the head of the default set.
682The default for this option is:
683.Bd -literal -offset 3n
684ssh-ed25519-cert-v01@openssh.com,
685ecdsa-sha2-nistp256-cert-v01@openssh.com,
686ecdsa-sha2-nistp384-cert-v01@openssh.com,
687ecdsa-sha2-nistp521-cert-v01@openssh.com,
688sk-ssh-ed25519-cert-v01@openssh.com,
689sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
690rsa-sha2-512-cert-v01@openssh.com,
691rsa-sha2-256-cert-v01@openssh.com,
692ssh-ed25519,
693ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
694sk-ssh-ed25519@openssh.com,
695sk-ecdsa-sha2-nistp256@openssh.com,
696rsa-sha2-512,rsa-sha2-256
697.Ed
698.Pp
699The list of available signature algorithms may also be obtained using
700.Qq ssh -Q HostbasedAcceptedAlgorithms .
701This was formerly named HostbasedAcceptedKeyTypes.
702.It Cm HostbasedAuthentication
703Specifies whether rhosts or /etc/hosts.equiv authentication together
704with successful public key client host authentication is allowed
705(host-based authentication).
706The default is
707.Cm no .
708.It Cm HostbasedUsesNameFromPacketOnly
709Specifies whether or not the server will attempt to perform a reverse
710name lookup when matching the name in the
711.Pa ~/.shosts ,
712.Pa ~/.rhosts ,
713and
714.Pa /etc/hosts.equiv
715files during
716.Cm HostbasedAuthentication .
717A setting of
718.Cm yes
719means that
720.Xr sshd 8
721uses the name supplied by the client rather than
722attempting to resolve the name from the TCP connection itself.
723The default is
724.Cm no .
725.It Cm HostCertificate
726Specifies a file containing a public host certificate.
727The certificate's public key must match a private host key already specified
728by
729.Cm HostKey .
730The default behaviour of
731.Xr sshd 8
732is not to load any certificates.
733.It Cm HostKey
734Specifies a file containing a private host key
735used by SSH.
736The defaults are
737.Pa /etc/ssh/ssh_host_ecdsa_key ,
738.Pa /etc/ssh/ssh_host_ed25519_key
739and
740.Pa /etc/ssh/ssh_host_rsa_key .
741.Pp
742Note that
743.Xr sshd 8
744will refuse to use a file if it is group/world-accessible
745and that the
746.Cm HostKeyAlgorithms
747option restricts which of the keys are actually used by
748.Xr sshd 8 .
749.Pp
750It is possible to have multiple host key files.
751It is also possible to specify public host key files instead.
752In this case operations on the private key will be delegated
753to an
754.Xr ssh-agent 1 .
755.It Cm HostKeyAgent
756Identifies the UNIX-domain socket used to communicate
757with an agent that has access to the private host keys.
758If the string
759.Qq SSH_AUTH_SOCK
760is specified, the location of the socket will be read from the
761.Ev SSH_AUTH_SOCK
762environment variable.
763.It Cm HostKeyAlgorithms
764Specifies the host key signature algorithms
765that the server offers.
766The default for this option is:
767.Bd -literal -offset 3n
768ssh-ed25519-cert-v01@openssh.com,
769ecdsa-sha2-nistp256-cert-v01@openssh.com,
770ecdsa-sha2-nistp384-cert-v01@openssh.com,
771ecdsa-sha2-nistp521-cert-v01@openssh.com,
772sk-ssh-ed25519-cert-v01@openssh.com,
773sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
774rsa-sha2-512-cert-v01@openssh.com,
775rsa-sha2-256-cert-v01@openssh.com,
776ssh-ed25519,
777ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
778sk-ssh-ed25519@openssh.com,
779sk-ecdsa-sha2-nistp256@openssh.com,
780rsa-sha2-512,rsa-sha2-256
781.Ed
782.Pp
783The list of available signature algorithms may also be obtained using
784.Qq ssh -Q HostKeyAlgorithms .
785.It Cm IgnoreRhosts
786Specifies whether to ignore per-user
787.Pa .rhosts
788and
789.Pa .shosts
790files during
791.Cm HostbasedAuthentication .
792The system-wide
793.Pa /etc/hosts.equiv
794and
795.Pa /etc/ssh/shosts.equiv
796are still used regardless of this setting.
797.Pp
798Accepted values are
799.Cm yes
800(the default) to ignore all per-user files,
801.Cm shosts-only
802to allow the use of
803.Pa .shosts
804but to ignore
805.Pa .rhosts
806or
807.Cm no
808to allow both
809.Pa .shosts
810and
811.Pa rhosts .
812.It Cm IgnoreUserKnownHosts
813Specifies whether
814.Xr sshd 8
815should ignore the user's
816.Pa ~/.ssh/known_hosts
817during
818.Cm HostbasedAuthentication
819and use only the system-wide known hosts file
820.Pa /etc/ssh/known_hosts .
821The default is
822.Dq no .
823.It Cm Include
824Include the specified configuration file(s).
825Multiple pathnames may be specified and each pathname may contain
826.Xr glob 7
827wildcards that will be expanded and processed in lexical order.
828Files without absolute paths are assumed to be in
829.Pa /etc/ssh .
830An
831.Cm Include
832directive may appear inside a
833.Cm Match
834block
835to perform conditional inclusion.
836.It Cm IPQoS
837Specifies the IPv4 type-of-service or DSCP class for the connection.
838Accepted values are
839.Cm af11 ,
840.Cm af12 ,
841.Cm af13 ,
842.Cm af21 ,
843.Cm af22 ,
844.Cm af23 ,
845.Cm af31 ,
846.Cm af32 ,
847.Cm af33 ,
848.Cm af41 ,
849.Cm af42 ,
850.Cm af43 ,
851.Cm cs0 ,
852.Cm cs1 ,
853.Cm cs2 ,
854.Cm cs3 ,
855.Cm cs4 ,
856.Cm cs5 ,
857.Cm cs6 ,
858.Cm cs7 ,
859.Cm ef ,
860.Cm le ,
861.Cm lowdelay ,
862.Cm throughput ,
863.Cm reliability ,
864a numeric value, or
865.Cm none
866to use the operating system default.
867This option may take one or two arguments, separated by whitespace.
868If one argument is specified, it is used as the packet class unconditionally.
869If two values are specified, the first is automatically selected for
870interactive sessions and the second for non-interactive sessions.
871The default is
872.Cm af21
873(Low-Latency Data)
874for interactive sessions and
875.Cm cs1
876(Lower Effort)
877for non-interactive sessions.
878.It Cm KbdInteractiveAuthentication
879Specifies whether to allow keyboard-interactive authentication.
880All authentication styles from
881.Xr login.conf 5
882are supported.
883The default is
884.Cm yes .
885The argument to this keyword must be
886.Cm yes
887or
888.Cm no .
889.Cm ChallengeResponseAuthentication
890is a deprecated alias for this.
891.It Cm KerberosAuthentication
892Specifies whether the password provided by the user for
893.Cm PasswordAuthentication
894will be validated through the Kerberos KDC.
895To use this option, the server needs a
896Kerberos servtab which allows the verification of the KDC's identity.
897The default is
898.Cm no .
899.It Cm KerberosGetAFSToken
900If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
901an AFS token before accessing the user's home directory.
902The default is
903.Cm no .
904.It Cm KerberosOrLocalPasswd
905If password authentication through Kerberos fails then
906the password will be validated via any additional local mechanism
907such as
908.Pa /etc/passwd .
909The default is
910.Cm yes .
911.It Cm KerberosTicketCleanup
912Specifies whether to automatically destroy the user's ticket cache
913file on logout.
914The default is
915.Cm yes .
916.It Cm KexAlgorithms
917Specifies the available KEX (Key Exchange) algorithms.
918Multiple algorithms must be comma-separated.
919Alternately if the specified list begins with a
920.Sq +
921character, then the specified algorithms will be appended to the default set
922instead of replacing them.
923If the specified list begins with a
924.Sq -
925character, then the specified algorithms (including wildcards) will be removed
926from the default set instead of replacing them.
927If the specified list begins with a
928.Sq ^
929character, then the specified algorithms will be placed at the head of the
930default set.
931The supported algorithms are:
932.Pp
933.Bl -item -compact -offset indent
934.It
935curve25519-sha256
936.It
937curve25519-sha256@libssh.org
938.It
939diffie-hellman-group1-sha1
940.It
941diffie-hellman-group14-sha1
942.It
943diffie-hellman-group14-sha256
944.It
945diffie-hellman-group16-sha512
946.It
947diffie-hellman-group18-sha512
948.It
949diffie-hellman-group-exchange-sha1
950.It
951diffie-hellman-group-exchange-sha256
952.It
953ecdh-sha2-nistp256
954.It
955ecdh-sha2-nistp384
956.It
957ecdh-sha2-nistp521
958.It
959sntrup761x25519-sha512@openssh.com
960.El
961.Pp
962The default is:
963.Bd -literal -offset indent
964sntrup761x25519-sha512@openssh.com,
965curve25519-sha256,curve25519-sha256@libssh.org,
966ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
967diffie-hellman-group-exchange-sha256,
968diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,
969diffie-hellman-group14-sha256
970.Ed
971.Pp
972The list of available key exchange algorithms may also be obtained using
973.Qq ssh -Q KexAlgorithms .
974.It Cm ListenAddress
975Specifies the local addresses
976.Xr sshd 8
977should listen on.
978The following forms may be used:
979.Pp
980.Bl -item -offset indent -compact
981.It
982.Cm ListenAddress
983.Sm off
984.Ar hostname | address
985.Sm on
986.Op Cm rdomain Ar domain
987.It
988.Cm ListenAddress
989.Sm off
990.Ar hostname : port
991.Sm on
992.Op Cm rdomain Ar domain
993.It
994.Cm ListenAddress
995.Sm off
996.Ar IPv4_address : port
997.Sm on
998.Op Cm rdomain Ar domain
999.It
1000.Cm ListenAddress
1001.Sm off
1002.Oo Ar hostname | address Oc : Ar port
1003.Sm on
1004.Op Cm rdomain Ar domain
1005.El
1006.Pp
1007The optional
1008.Cm rdomain
1009qualifier requests
1010.Xr sshd 8
1011listen in an explicit routing domain.
1012If
1013.Ar port
1014is not specified,
1015sshd will listen on the address and all
1016.Cm Port
1017options specified.
1018The default is to listen on all local addresses on the current default
1019routing domain.
1020Multiple
1021.Cm ListenAddress
1022options are permitted.
1023For more information on routing domains, see
1024.Xr rdomain 4 .
1025.It Cm LoginGraceTime
1026The server disconnects after this time if the user has not
1027successfully logged in.
1028If the value is 0, there is no time limit.
1029The default is 120 seconds.
1030.It Cm LogLevel
1031Gives the verbosity level that is used when logging messages from
1032.Xr sshd 8 .
1033The possible values are:
1034QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
1035The default is INFO.
1036DEBUG and DEBUG1 are equivalent.
1037DEBUG2 and DEBUG3 each specify higher levels of debugging output.
1038Logging with a DEBUG level violates the privacy of users and is not recommended.
1039.It Cm LogVerbose
1040Specify one or more overrides to LogLevel.
1041An override consists of a pattern lists that matches the source file, function
1042and line number to force detailed logging for.
1043For example, an override pattern of:
1044.Bd -literal -offset indent
1045kex.c:*:1000,*:kex_exchange_identification():*,packet.c:*
1046.Ed
1047.Pp
1048would enable detailed logging for line 1000 of
1049.Pa kex.c ,
1050everything in the
1051.Fn kex_exchange_identification
1052function, and all code in the
1053.Pa packet.c
1054file.
1055This option is intended for debugging and no overrides are enabled by default.
1056.It Cm MACs
1057Specifies the available MAC (message authentication code) algorithms.
1058The MAC algorithm is used for data integrity protection.
1059Multiple algorithms must be comma-separated.
1060If the specified list begins with a
1061.Sq +
1062character, then the specified algorithms will be appended to the default set
1063instead of replacing them.
1064If the specified list begins with a
1065.Sq -
1066character, then the specified algorithms (including wildcards) will be removed
1067from the default set instead of replacing them.
1068If the specified list begins with a
1069.Sq ^
1070character, then the specified algorithms will be placed at the head of the
1071default set.
1072.Pp
1073The algorithms that contain
1074.Qq -etm
1075calculate the MAC after encryption (encrypt-then-mac).
1076These are considered safer and their use recommended.
1077The supported MACs are:
1078.Pp
1079.Bl -item -compact -offset indent
1080.It
1081hmac-md5
1082.It
1083hmac-md5-96
1084.It
1085hmac-sha1
1086.It
1087hmac-sha1-96
1088.It
1089hmac-sha2-256
1090.It
1091hmac-sha2-512
1092.It
1093umac-64@openssh.com
1094.It
1095umac-128@openssh.com
1096.It
1097hmac-md5-etm@openssh.com
1098.It
1099hmac-md5-96-etm@openssh.com
1100.It
1101hmac-sha1-etm@openssh.com
1102.It
1103hmac-sha1-96-etm@openssh.com
1104.It
1105hmac-sha2-256-etm@openssh.com
1106.It
1107hmac-sha2-512-etm@openssh.com
1108.It
1109umac-64-etm@openssh.com
1110.It
1111umac-128-etm@openssh.com
1112.El
1113.Pp
1114The default is:
1115.Bd -literal -offset indent
1116umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1117hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
1118hmac-sha1-etm@openssh.com,
1119umac-64@openssh.com,umac-128@openssh.com,
1120hmac-sha2-256,hmac-sha2-512,hmac-sha1
1121.Ed
1122.Pp
1123The list of available MAC algorithms may also be obtained using
1124.Qq ssh -Q mac .
1125.It Cm Match
1126Introduces a conditional block.
1127If all of the criteria on the
1128.Cm Match
1129line are satisfied, the keywords on the following lines override those
1130set in the global section of the config file, until either another
1131.Cm Match
1132line or the end of the file.
1133If a keyword appears in multiple
1134.Cm Match
1135blocks that are satisfied, only the first instance of the keyword is
1136applied.
1137.Pp
1138The arguments to
1139.Cm Match
1140are one or more criteria-pattern pairs or the single token
1141.Cm All
1142which matches all criteria.
1143The available criteria are
1144.Cm User ,
1145.Cm Group ,
1146.Cm Host ,
1147.Cm LocalAddress ,
1148.Cm LocalPort ,
1149.Cm RDomain ,
1150and
1151.Cm Address
1152(with
1153.Cm RDomain
1154representing the
1155.Xr rdomain 4
1156on which the connection was received).
1157.Pp
1158The match patterns may consist of single entries or comma-separated
1159lists and may use the wildcard and negation operators described in the
1160.Sx PATTERNS
1161section of
1162.Xr ssh_config 5 .
1163.Pp
1164The patterns in an
1165.Cm Address
1166criteria may additionally contain addresses to match in CIDR
1167address/masklen format,
1168such as 192.0.2.0/24 or 2001:db8::/32.
1169Note that the mask length provided must be consistent with the address -
1170it is an error to specify a mask length that is too long for the address
1171or one with bits set in this host portion of the address.
1172For example, 192.0.2.0/33 and 192.0.2.0/8, respectively.
1173.Pp
1174Only a subset of keywords may be used on the lines following a
1175.Cm Match
1176keyword.
1177Available keywords are
1178.Cm AcceptEnv ,
1179.Cm AllowAgentForwarding ,
1180.Cm AllowGroups ,
1181.Cm AllowStreamLocalForwarding ,
1182.Cm AllowTcpForwarding ,
1183.Cm AllowUsers ,
1184.Cm AuthenticationMethods ,
1185.Cm AuthorizedKeysCommand ,
1186.Cm AuthorizedKeysCommandUser ,
1187.Cm AuthorizedKeysFile ,
1188.Cm AuthorizedPrincipalsCommand ,
1189.Cm AuthorizedPrincipalsCommandUser ,
1190.Cm AuthorizedPrincipalsFile ,
1191.Cm Banner ,
1192.Cm CASignatureAlgorithms ,
1193.Cm ChrootDirectory ,
1194.Cm ClientAliveCountMax ,
1195.Cm ClientAliveInterval ,
1196.Cm DenyGroups ,
1197.Cm DenyUsers ,
1198.Cm DisableForwarding ,
1199.Cm ExposeAuthInfo ,
1200.Cm ForceCommand ,
1201.Cm GatewayPorts ,
1202.Cm GSSAPIAuthentication ,
1203.Cm HostbasedAcceptedAlgorithms ,
1204.Cm HostbasedAuthentication ,
1205.Cm HostbasedUsesNameFromPacketOnly ,
1206.Cm IgnoreRhosts ,
1207.Cm Include ,
1208.Cm IPQoS ,
1209.Cm KbdInteractiveAuthentication ,
1210.Cm KerberosAuthentication ,
1211.Cm LogLevel ,
1212.Cm MaxAuthTries ,
1213.Cm MaxSessions ,
1214.Cm PasswordAuthentication ,
1215.Cm PermitEmptyPasswords ,
1216.Cm PermitListen ,
1217.Cm PermitOpen ,
1218.Cm PermitRootLogin ,
1219.Cm PermitTTY ,
1220.Cm PermitTunnel ,
1221.Cm PermitUserRC ,
1222.Cm PubkeyAcceptedAlgorithms ,
1223.Cm PubkeyAuthentication ,
1224.Cm PubkeyAuthOptions ,
1225.Cm RekeyLimit ,
1226.Cm RevokedKeys ,
1227.Cm RDomain ,
1228.Cm SetEnv ,
1229.Cm StreamLocalBindMask ,
1230.Cm StreamLocalBindUnlink ,
1231.Cm TrustedUserCAKeys ,
1232.Cm X11DisplayOffset ,
1233.Cm X11Forwarding
1234and
1235.Cm X11UseLocalhost .
1236.It Cm MaxAuthTries
1237Specifies the maximum number of authentication attempts permitted per
1238connection.
1239Once the number of failures reaches half this value,
1240additional failures are logged.
1241The default is 6.
1242.It Cm MaxSessions
1243Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1244sessions permitted per network connection.
1245Multiple sessions may be established by clients that support connection
1246multiplexing.
1247Setting
1248.Cm MaxSessions
1249to 1 will effectively disable session multiplexing, whereas setting it to 0
1250will prevent all shell, login and subsystem sessions while still permitting
1251forwarding.
1252The default is 10.
1253.It Cm MaxStartups
1254Specifies the maximum number of concurrent unauthenticated connections to the
1255SSH daemon.
1256Additional connections will be dropped until authentication succeeds or the
1257.Cm LoginGraceTime
1258expires for a connection.
1259The default is 10:30:100.
1260.Pp
1261Alternatively, random early drop can be enabled by specifying
1262the three colon separated values
1263start:rate:full (e.g. "10:30:60").
1264.Xr sshd 8
1265will refuse connection attempts with a probability of rate/100 (30%)
1266if there are currently start (10) unauthenticated connections.
1267The probability increases linearly and all connection attempts
1268are refused if the number of unauthenticated connections reaches full (60).
1269.It Cm ModuliFile
1270Specifies the
1271.Xr moduli 5
1272file that contains the Diffie-Hellman groups used for the
1273.Dq diffie-hellman-group-exchange-sha1
1274and
1275.Dq diffie-hellman-group-exchange-sha256
1276key exchange methods.
1277The default is
1278.Pa /etc/moduli .
1279.It Cm PasswordAuthentication
1280Specifies whether password authentication is allowed.
1281See also
1282.Cm UsePAM .
1283The default is
1284.Cm no .
1285.It Cm PermitEmptyPasswords
1286When password authentication is allowed, it specifies whether the
1287server allows login to accounts with empty password strings.
1288The default is
1289.Cm no .
1290.It Cm PermitListen
1291Specifies the addresses/ports on which a remote TCP port forwarding may listen.
1292The listen specification must be one of the following forms:
1293.Pp
1294.Bl -item -offset indent -compact
1295.It
1296.Cm PermitListen
1297.Sm off
1298.Ar port
1299.Sm on
1300.It
1301.Cm PermitListen
1302.Sm off
1303.Ar host : port
1304.Sm on
1305.El
1306.Pp
1307Multiple permissions may be specified by separating them with whitespace.
1308An argument of
1309.Cm any
1310can be used to remove all restrictions and permit any listen requests.
1311An argument of
1312.Cm none
1313can be used to prohibit all listen requests.
1314The host name may contain wildcards as described in the PATTERNS section in
1315.Xr ssh_config 5 .
1316The wildcard
1317.Sq *
1318can also be used in place of a port number to allow all ports.
1319By default all port forwarding listen requests are permitted.
1320Note that the
1321.Cm GatewayPorts
1322option may further restrict which addresses may be listened on.
1323Note also that
1324.Xr ssh 1
1325will request a listen host of
1326.Dq localhost
1327if no listen host was specifically requested, and this name is
1328treated differently to explicit localhost addresses of
1329.Dq 127.0.0.1
1330and
1331.Dq ::1 .
1332.It Cm PermitOpen
1333Specifies the destinations to which TCP port forwarding is permitted.
1334The forwarding specification must be one of the following forms:
1335.Pp
1336.Bl -item -offset indent -compact
1337.It
1338.Cm PermitOpen
1339.Sm off
1340.Ar host : port
1341.Sm on
1342.It
1343.Cm PermitOpen
1344.Sm off
1345.Ar IPv4_addr : port
1346.Sm on
1347.It
1348.Cm PermitOpen
1349.Sm off
1350.Ar \&[ IPv6_addr \&] : port
1351.Sm on
1352.El
1353.Pp
1354Multiple forwards may be specified by separating them with whitespace.
1355An argument of
1356.Cm any
1357can be used to remove all restrictions and permit any forwarding requests.
1358An argument of
1359.Cm none
1360can be used to prohibit all forwarding requests.
1361The wildcard
1362.Sq *
1363can be used for host or port to allow all hosts or ports respectively.
1364Otherwise, no pattern matching or address lookups are performed on supplied
1365names.
1366By default all port forwarding requests are permitted.
1367.It Cm PermitRootLogin
1368Specifies whether root can log in using
1369.Xr ssh 1 .
1370The argument must be
1371.Cm yes ,
1372.Cm prohibit-password ,
1373.Cm forced-commands-only ,
1374or
1375.Cm no .
1376The default is
1377.Cm no .
1378Note that if
1379.Cm ChallengeResponseAuthentication
1380and
1381.Cm UsePAM
1382are both
1383.Cm yes ,
1384this setting may be overridden by the PAM policy.
1385.Pp
1386If this option is set to
1387.Cm prohibit-password
1388(or its deprecated alias,
1389.Cm without-password ) ,
1390password and keyboard-interactive authentication are disabled for root.
1391.Pp
1392If this option is set to
1393.Cm forced-commands-only ,
1394root login with public key authentication will be allowed,
1395but only if the
1396.Ar command
1397option has been specified
1398(which may be useful for taking remote backups even if root login is
1399normally not allowed).
1400All other authentication methods are disabled for root.
1401.Pp
1402If this option is set to
1403.Cm no ,
1404root is not allowed to log in.
1405.It Cm PermitTTY
1406Specifies whether
1407.Xr pty 4
1408allocation is permitted.
1409The default is
1410.Cm yes .
1411.It Cm PermitTunnel
1412Specifies whether
1413.Xr tun 4
1414device forwarding is allowed.
1415The argument must be
1416.Cm yes ,
1417.Cm point-to-point
1418(layer 3),
1419.Cm ethernet
1420(layer 2), or
1421.Cm no .
1422Specifying
1423.Cm yes
1424permits both
1425.Cm point-to-point
1426and
1427.Cm ethernet .
1428The default is
1429.Cm no .
1430.Pp
1431Independent of this setting, the permissions of the selected
1432.Xr tun 4
1433device must allow access to the user.
1434.It Cm PermitUserEnvironment
1435Specifies whether
1436.Pa ~/.ssh/environment
1437and
1438.Cm environment=
1439options in
1440.Pa ~/.ssh/authorized_keys
1441are processed by
1442.Xr sshd 8 .
1443Valid options are
1444.Cm yes ,
1445.Cm no
1446or a pattern-list specifying which environment variable names to accept
1447(for example
1448.Qq LANG,LC_* ) .
1449The default is
1450.Cm no .
1451Enabling environment processing may enable users to bypass access
1452restrictions in some configurations using mechanisms such as
1453.Ev LD_PRELOAD .
1454.It Cm PermitUserRC
1455Specifies whether any
1456.Pa ~/.ssh/rc
1457file is executed.
1458The default is
1459.Cm yes .
1460.It Cm PerSourceMaxStartups
1461Specifies the number of unauthenticated connections allowed from a
1462given source address, or
1463.Dq none
1464if there is no limit.
1465This limit is applied in addition to
1466.Cm MaxStartups ,
1467whichever is lower.
1468The default is
1469.Cm none .
1470.It Cm PerSourceNetBlockSize
1471Specifies the number of bits of source address that are grouped together
1472for the purposes of applying PerSourceMaxStartups limits.
1473Values for IPv4 and optionally IPv6 may be specified, separated by a colon.
1474The default is
1475.Cm 32:128 ,
1476which means each address is considered individually.
1477.It Cm PidFile
1478Specifies the file that contains the process ID of the
1479SSH daemon, or
1480.Cm none
1481to not write one.
1482The default is
1483.Pa /var/run/sshd.pid .
1484.It Cm Port
1485Specifies the port number that
1486.Xr sshd 8
1487listens on.
1488The default is 22.
1489Multiple options of this type are permitted.
1490See also
1491.Cm ListenAddress .
1492.It Cm PrintLastLog
1493Specifies whether
1494.Xr sshd 8
1495should print the date and time of the last user login when a user logs
1496in interactively.
1497The default is
1498.Cm yes .
1499.It Cm PrintMotd
1500Specifies whether
1501.Xr sshd 8
1502should print
1503.Pa /etc/motd
1504when a user logs in interactively.
1505(On some systems it is also printed by the shell,
1506.Pa /etc/profile ,
1507or equivalent.)
1508The default is
1509.Cm yes .
1510.It Cm PubkeyAcceptedAlgorithms
1511Specifies the signature algorithms that will be accepted for public key
1512authentication as a list of comma-separated patterns.
1513Alternately if the specified list begins with a
1514.Sq +
1515character, then the specified algorithms will be appended to the default set
1516instead of replacing them.
1517If the specified list begins with a
1518.Sq -
1519character, then the specified algorithms (including wildcards) will be removed
1520from the default set instead of replacing them.
1521If the specified list begins with a
1522.Sq ^
1523character, then the specified algorithms will be placed at the head of the
1524default set.
1525The default for this option is:
1526.Bd -literal -offset 3n
1527ssh-ed25519-cert-v01@openssh.com,
1528ecdsa-sha2-nistp256-cert-v01@openssh.com,
1529ecdsa-sha2-nistp384-cert-v01@openssh.com,
1530ecdsa-sha2-nistp521-cert-v01@openssh.com,
1531sk-ssh-ed25519-cert-v01@openssh.com,
1532sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
1533rsa-sha2-512-cert-v01@openssh.com,
1534rsa-sha2-256-cert-v01@openssh.com,
1535ssh-ed25519,
1536ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1537sk-ssh-ed25519@openssh.com,
1538sk-ecdsa-sha2-nistp256@openssh.com,
1539rsa-sha2-512,rsa-sha2-256
1540.Ed
1541.Pp
1542The list of available signature algorithms may also be obtained using
1543.Qq ssh -Q PubkeyAcceptedAlgorithms .
1544.It Cm PubkeyAuthOptions
1545Sets one or more public key authentication options.
1546The supported keywords are:
1547.Cm none
1548(the default; indicating no additional options are enabled),
1549.Cm touch-required
1550and
1551.Cm verify-required .
1552.Pp
1553The
1554.Cm touch-required
1555option causes public key authentication using a FIDO authenticator algorithm
1556(i.e.\&
1557.Cm ecdsa-sk
1558or
1559.Cm ed25519-sk )
1560to always require the signature to attest that a physically present user
1561explicitly confirmed the authentication (usually by touching the authenticator).
1562By default,
1563.Xr sshd 8
1564requires user presence unless overridden with an authorized_keys option.
1565The
1566.Cm touch-required
1567flag disables this override.
1568.Pp
1569The
1570.Cm verify-required
1571option requires a FIDO key signature attest that the user was verified,
1572e.g. via a PIN.
1573.Pp
1574Neither the
1575.Cm touch-required
1576or
1577.Cm verify-required
1578options have any effect for other, non-FIDO, public key types.
1579.It Cm PubkeyAuthentication
1580Specifies whether public key authentication is allowed.
1581The default is
1582.Cm yes .
1583.It Cm RekeyLimit
1584Specifies the maximum amount of data that may be transmitted before the
1585session key is renegotiated, optionally followed by a maximum amount of
1586time that may pass before the session key is renegotiated.
1587The first argument is specified in bytes and may have a suffix of
1588.Sq K ,
1589.Sq M ,
1590or
1591.Sq G
1592to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1593The default is between
1594.Sq 1G
1595and
1596.Sq 4G ,
1597depending on the cipher.
1598The optional second value is specified in seconds and may use any of the
1599units documented in the
1600.Sx TIME FORMATS
1601section.
1602The default value for
1603.Cm RekeyLimit
1604is
1605.Cm default none ,
1606which means that rekeying is performed after the cipher's default amount
1607of data has been sent or received and no time based rekeying is done.
1608.It Cm RevokedKeys
1609Specifies revoked public keys file, or
1610.Cm none
1611to not use one.
1612Keys listed in this file will be refused for public key authentication.
1613Note that if this file is not readable, then public key authentication will
1614be refused for all users.
1615Keys may be specified as a text file, listing one public key per line, or as
1616an OpenSSH Key Revocation List (KRL) as generated by
1617.Xr ssh-keygen 1 .
1618For more information on KRLs, see the KEY REVOCATION LISTS section in
1619.Xr ssh-keygen 1 .
1620.It Cm RDomain
1621Specifies an explicit routing domain that is applied after authentication
1622has completed.
1623The user session, as well as any forwarded or listening IP sockets,
1624will be bound to this
1625.Xr rdomain 4 .
1626If the routing domain is set to
1627.Cm \&%D ,
1628then the domain in which the incoming connection was received will be applied.
1629.It Cm SecurityKeyProvider
1630Specifies a path to a library that will be used when loading
1631FIDO authenticator-hosted keys, overriding the default of using
1632the built-in USB HID support.
1633.It Cm SetEnv
1634Specifies one or more environment variables to set in child sessions started
1635by
1636.Xr sshd 8
1637as
1638.Dq NAME=VALUE .
1639The environment value may be quoted (e.g. if it contains whitespace
1640characters).
1641Environment variables set by
1642.Cm SetEnv
1643override the default environment and any variables specified by the user
1644via
1645.Cm AcceptEnv
1646or
1647.Cm PermitUserEnvironment .
1648.It Cm StreamLocalBindMask
1649Sets the octal file creation mode mask
1650.Pq umask
1651used when creating a Unix-domain socket file for local or remote
1652port forwarding.
1653This option is only used for port forwarding to a Unix-domain socket file.
1654.Pp
1655The default value is 0177, which creates a Unix-domain socket file that is
1656readable and writable only by the owner.
1657Note that not all operating systems honor the file mode on Unix-domain
1658socket files.
1659.It Cm StreamLocalBindUnlink
1660Specifies whether to remove an existing Unix-domain socket file for local
1661or remote port forwarding before creating a new one.
1662If the socket file already exists and
1663.Cm StreamLocalBindUnlink
1664is not enabled,
1665.Nm sshd
1666will be unable to forward the port to the Unix-domain socket file.
1667This option is only used for port forwarding to a Unix-domain socket file.
1668.Pp
1669The argument must be
1670.Cm yes
1671or
1672.Cm no .
1673The default is
1674.Cm no .
1675.It Cm StrictModes
1676Specifies whether
1677.Xr sshd 8
1678should check file modes and ownership of the
1679user's files and home directory before accepting login.
1680This is normally desirable because novices sometimes accidentally leave their
1681directory or files world-writable.
1682The default is
1683.Cm yes .
1684Note that this does not apply to
1685.Cm ChrootDirectory ,
1686whose permissions and ownership are checked unconditionally.
1687.It Cm Subsystem
1688Configures an external subsystem (e.g. file transfer daemon).
1689Arguments should be a subsystem name and a command (with optional arguments)
1690to execute upon subsystem request.
1691.Pp
1692The command
1693.Cm sftp-server
1694implements the SFTP file transfer subsystem.
1695.Pp
1696Alternately the name
1697.Cm internal-sftp
1698implements an in-process SFTP server.
1699This may simplify configurations using
1700.Cm ChrootDirectory
1701to force a different filesystem root on clients.
1702.Pp
1703By default no subsystems are defined.
1704.It Cm SyslogFacility
1705Gives the facility code that is used when logging messages from
1706.Xr sshd 8 .
1707The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1708LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1709The default is AUTH.
1710.It Cm TCPKeepAlive
1711Specifies whether the system should send TCP keepalive messages to the
1712other side.
1713If they are sent, death of the connection or crash of one
1714of the machines will be properly noticed.
1715However, this means that
1716connections will die if the route is down temporarily, and some people
1717find it annoying.
1718On the other hand, if TCP keepalives are not sent,
1719sessions may hang indefinitely on the server, leaving
1720.Qq ghost
1721users and consuming server resources.
1722.Pp
1723The default is
1724.Cm yes
1725(to send TCP keepalive messages), and the server will notice
1726if the network goes down or the client host crashes.
1727This avoids infinitely hanging sessions.
1728.Pp
1729To disable TCP keepalive messages, the value should be set to
1730.Cm no .
1731.It Cm TrustedUserCAKeys
1732Specifies a file containing public keys of certificate authorities that are
1733trusted to sign user certificates for authentication, or
1734.Cm none
1735to not use one.
1736Keys are listed one per line; empty lines and comments starting with
1737.Ql #
1738are allowed.
1739If a certificate is presented for authentication and has its signing CA key
1740listed in this file, then it may be used for authentication for any user
1741listed in the certificate's principals list.
1742Note that certificates that lack a list of principals will not be permitted
1743for authentication using
1744.Cm TrustedUserCAKeys .
1745For more details on certificates, see the CERTIFICATES section in
1746.Xr ssh-keygen 1 .
1747.It Cm UseBlacklist
1748Specifies whether
1749.Xr sshd 8
1750attempts to send authentication success and failure messages
1751to the
1752.Xr blacklistd 8
1753daemon.
1754The default is
1755.Cm no .
1756For forward compatibility with an upcoming
1757.Xr blacklistd
1758rename, the
1759.Cm UseBlocklist
1760alias can be used instead.
1761.It Cm UseDNS
1762Specifies whether
1763.Xr sshd 8
1764should look up the remote host name, and to check that
1765the resolved host name for the remote IP address maps back to the
1766very same IP address.
1767.Pp
1768If this option is set to
1769.Cm no ,
1770then only addresses and not host names may be used in
1771.Pa ~/.ssh/authorized_keys
1772.Cm from
1773and
1774.Nm
1775.Cm Match
1776.Cm Host
1777directives.
1778The default is
1779.Dq yes .
1780.It Cm UsePAM
1781Enables the Pluggable Authentication Module interface.
1782If set to
1783.Cm yes
1784this will enable PAM authentication using
1785.Cm KbdInteractiveAuthentication
1786and
1787.Cm PasswordAuthentication
1788in addition to PAM account and session module processing for all
1789authentication types.
1790.Pp
1791Because PAM keyboard-interactive authentication usually serves an equivalent
1792role to password authentication, you should disable either
1793.Cm PasswordAuthentication
1794or
1795.Cm KbdInteractiveAuthentication .
1796.Pp
1797If
1798.Cm UsePAM
1799is enabled, you will not be able to run
1800.Xr sshd 8
1801as a non-root user.
1802The default is
1803.Cm yes .
1804.It Cm VersionAddendum
1805Optionally specifies additional text to append to the SSH protocol banner
1806sent by the server upon connection.
1807The default is
1808.Qq FreeBSD-20220415 .
1809The value
1810.Cm none
1811may be used to disable this.
1812.It Cm X11DisplayOffset
1813Specifies the first display number available for
1814.Xr sshd 8 Ns 's
1815X11 forwarding.
1816This prevents sshd from interfering with real X11 servers.
1817The default is 10.
1818.It Cm X11Forwarding
1819Specifies whether X11 forwarding is permitted.
1820The argument must be
1821.Cm yes
1822or
1823.Cm no .
1824The default is
1825.Cm yes .
1826.Pp
1827When X11 forwarding is enabled, there may be additional exposure to
1828the server and to client displays if the
1829.Xr sshd 8
1830proxy display is configured to listen on the wildcard address (see
1831.Cm X11UseLocalhost ) ,
1832though this is not the default.
1833Additionally, the authentication spoofing and authentication data
1834verification and substitution occur on the client side.
1835The security risk of using X11 forwarding is that the client's X11
1836display server may be exposed to attack when the SSH client requests
1837forwarding (see the warnings for
1838.Cm ForwardX11
1839in
1840.Xr ssh_config 5 ) .
1841A system administrator may have a stance in which they want to
1842protect clients that may expose themselves to attack by unwittingly
1843requesting X11 forwarding, which can warrant a
1844.Cm no
1845setting.
1846.Pp
1847Note that disabling X11 forwarding does not prevent users from
1848forwarding X11 traffic, as users can always install their own forwarders.
1849.It Cm X11UseLocalhost
1850Specifies whether
1851.Xr sshd 8
1852should bind the X11 forwarding server to the loopback address or to
1853the wildcard address.
1854By default,
1855sshd binds the forwarding server to the loopback address and sets the
1856hostname part of the
1857.Ev DISPLAY
1858environment variable to
1859.Cm localhost .
1860This prevents remote hosts from connecting to the proxy display.
1861However, some older X11 clients may not function with this
1862configuration.
1863.Cm X11UseLocalhost
1864may be set to
1865.Cm no
1866to specify that the forwarding server should be bound to the wildcard
1867address.
1868The argument must be
1869.Cm yes
1870or
1871.Cm no .
1872The default is
1873.Cm yes .
1874.It Cm XAuthLocation
1875Specifies the full pathname of the
1876.Xr xauth 1
1877program, or
1878.Cm none
1879to not use one.
1880The default is
1881.Pa /usr/local/bin/xauth .
1882.El
1883.Sh TIME FORMATS
1884.Xr sshd 8
1885command-line arguments and configuration file options that specify time
1886may be expressed using a sequence of the form:
1887.Sm off
1888.Ar time Op Ar qualifier ,
1889.Sm on
1890where
1891.Ar time
1892is a positive integer value and
1893.Ar qualifier
1894is one of the following:
1895.Pp
1896.Bl -tag -width Ds -compact -offset indent
1897.It Aq Cm none
1898seconds
1899.It Cm s | Cm S
1900seconds
1901.It Cm m | Cm M
1902minutes
1903.It Cm h | Cm H
1904hours
1905.It Cm d | Cm D
1906days
1907.It Cm w | Cm W
1908weeks
1909.El
1910.Pp
1911Each member of the sequence is added together to calculate
1912the total time value.
1913.Pp
1914Time format examples:
1915.Pp
1916.Bl -tag -width Ds -compact -offset indent
1917.It 600
1918600 seconds (10 minutes)
1919.It 10m
192010 minutes
1921.It 1h30m
19221 hour 30 minutes (90 minutes)
1923.El
1924.Sh TOKENS
1925Arguments to some keywords can make use of tokens,
1926which are expanded at runtime:
1927.Pp
1928.Bl -tag -width XXXX -offset indent -compact
1929.It %%
1930A literal
1931.Sq % .
1932.It \&%D
1933The routing domain in which the incoming connection was received.
1934.It %F
1935The fingerprint of the CA key.
1936.It %f
1937The fingerprint of the key or certificate.
1938.It %h
1939The home directory of the user.
1940.It %i
1941The key ID in the certificate.
1942.It %K
1943The base64-encoded CA key.
1944.It %k
1945The base64-encoded key or certificate for authentication.
1946.It %s
1947The serial number of the certificate.
1948.It \&%T
1949The type of the CA key.
1950.It %t
1951The key or certificate type.
1952.It \&%U
1953The numeric user ID of the target user.
1954.It %u
1955The username.
1956.El
1957.Pp
1958.Cm AuthorizedKeysCommand
1959accepts the tokens %%, %f, %h, %k, %t, %U, and %u.
1960.Pp
1961.Cm AuthorizedKeysFile
1962accepts the tokens %%, %h, %U, and %u.
1963.Pp
1964.Cm AuthorizedPrincipalsCommand
1965accepts the tokens %%, %F, %f, %h, %i, %K, %k, %s, %T, %t, %U, and %u.
1966.Pp
1967.Cm AuthorizedPrincipalsFile
1968accepts the tokens %%, %h, %U, and %u.
1969.Pp
1970.Cm ChrootDirectory
1971accepts the tokens %%, %h, %U, and %u.
1972.Pp
1973.Cm RoutingDomain
1974accepts the token %D.
1975.Sh FILES
1976.Bl -tag -width Ds
1977.It Pa /etc/ssh/sshd_config
1978Contains configuration data for
1979.Xr sshd 8 .
1980This file should be writable by root only, but it is recommended
1981(though not necessary) that it be world-readable.
1982.El
1983.Sh SEE ALSO
1984.Xr sftp-server 8 ,
1985.Xr sshd 8
1986.Sh AUTHORS
1987.An -nosplit
1988OpenSSH is a derivative of the original and free
1989ssh 1.2.12 release by
1990.An Tatu Ylonen .
1991.An Aaron Campbell , Bob Beck , Markus Friedl , Niels Provos ,
1992.An Theo de Raadt
1993and
1994.An Dug Song
1995removed many bugs, re-added newer features and
1996created OpenSSH.
1997.An Markus Friedl
1998contributed the support for SSH protocol versions 1.5 and 2.0.
1999.An Niels Provos
2000and
2001.An Markus Friedl
2002contributed support for privilege separation.
2003