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