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