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