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