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