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