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