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