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