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