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