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