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