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