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