Debian Codegraph @

upstream/fedora-rawhide/man5/sshd_config.5

raw
1 .\"
2 .\" Author: Tatu Ylonen <[email protected]>
3 .\" Copyright (c) 1995 Tatu Ylonen <[email protected]>, 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.397 2026/03/28 05:07:12 djm Exp $
37 .Dd $Mdocdate: March 28 2026 $
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
45 reads configuration data from
46 .Pa /etc/ssh/sshd_config
47 (or the file specified with
48 .Fl f
49 on the command line).
50 The file contains keyword-argument pairs, one per line.
51 Unless noted otherwise, for each keyword, the first obtained value will be used.
52 Lines starting with
53 .Ql #
54 and empty lines are interpreted as comments.
55 Arguments may optionally be enclosed in double quotes
56 .Pq \&"
57 in order to represent arguments containing spaces.
58 .Pp
59 The possible
60 keywords and their meanings are as follows (note that
61 keywords are case-insensitive and arguments are case-sensitive):
62 .Bl -tag -width Ds
63 .It Cm AcceptEnv
64 Specifies what environment variables sent by the client will be copied into
65 the session's
66 .Xr environ 7 .
67 See
68 .Cm SendEnv
69 and
70 .Cm SetEnv
71 in
72 .Xr ssh_config 5
73 for how to configure the client.
74 The
75 .Ev TERM
76 environment variable is always accepted whenever the client
77 requests a pseudo-terminal as it is required by the protocol.
78 Variables are specified by name, which may contain the wildcard characters
79 .Ql *
80 and
81 .Ql \&? .
82 Multiple environment variables may be separated by whitespace or spread
83 across multiple
84 .Cm AcceptEnv
85 directives.
86 Be warned that some environment variables could be used to bypass restricted
87 user environments.
88 For this reason, care should be taken in the use of this directive.
89 The default is not to accept any environment variables.
90 .It Cm AddressFamily
91 Specifies which address family should be used by
92 .Xr sshd 8 .
93 Valid 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
101 Specifies whether
102 .Xr ssh-agent 1
103 forwarding is permitted.
104 The default is
105 .Cm yes .
106 Note that disabling agent forwarding does not improve security
107 unless users are also denied shell access, as they can always install
108 their own forwarders.
109 .It Cm AllowGroups
110 This keyword can be followed by a list of group name patterns, separated
111 by spaces.
112 If specified, login is allowed only for users whose primary
113 group or supplementary group list matches one of the patterns.
114 Only group names are valid; a numerical group ID is not recognized.
115 By default, login is allowed for all groups.
116 .Cm AllowGroups
117 is not consulted for groups matched by
118 .Cm DenyGroups .
119 .Pp
120 See PATTERNS in
121 .Xr ssh_config 5
122 for more information on patterns.
123 This keyword may appear multiple times in
124 .Nm
125 with each instance appending to the list.
126 .It Cm AllowStreamLocalForwarding
127 Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
128 The available options are
129 .Cm yes
130 (the default)
131 or
132 .Cm all
133 to allow StreamLocal forwarding,
134 .Cm no
135 to prevent all StreamLocal forwarding,
136 .Cm local
137 to allow local (from the perspective of
138 .Xr ssh 1 )
139 forwarding only or
140 .Cm remote
141 to allow remote forwarding only.
142 Note that disabling StreamLocal forwarding does not improve security unless
143 users are also denied shell access, as they can always install their
144 own forwarders.
145 .It Cm AllowTcpForwarding
146 Specifies whether TCP forwarding is permitted.
147 The available options are
148 .Cm yes
149 (the default)
150 or
151 .Cm all
152 to allow TCP forwarding,
153 .Cm no
154 to prevent all TCP forwarding,
155 .Cm local
156 to allow local (from the perspective of
157 .Xr ssh 1 )
158 forwarding only or
159 .Cm remote
160 to allow remote forwarding only.
161 Note that disabling TCP forwarding does not improve security unless
162 users are also denied shell access, as they can always install their
163 own forwarders.
164 .It Cm AllowUsers
165 This keyword can be followed by a list of user name patterns, separated
166 by spaces.
167 If specified, login is allowed only for user names that
168 match one of the patterns.
169 Only user names are valid; a numerical user ID is not recognized.
170 By default, login is allowed for all users.
171 If the pattern takes the form USER@HOST then USER and HOST
172 are separately checked, restricting logins to particular
173 users from particular hosts.
174 HOST criteria may additionally contain addresses to match in CIDR
175 address/masklen format.
176 .Cm AllowUsers
177 is not consulted for users matched by
178 .Cm DenyUsers .
179 .Pp
180 See PATTERNS in
181 .Xr ssh_config 5
182 for more information on patterns.
183 This keyword may appear multiple times in
184 .Nm
185 with each instance appending to the list.
186 .It Cm AuthenticationMethods
187 Specifies the authentication methods that must be successfully completed
188 for a user to be granted access.
189 This option must be followed by one or more lists of comma-separated
190 authentication method names, or by the single string
191 .Cm any
192 to indicate the default behaviour of accepting any single authentication
193 method.
194 If the default is overridden, then successful authentication requires
195 completion of every method in at least one of these lists.
196 .Pp
197 For example,
198 .Qq publickey,password publickey,keyboard-interactive
199 would require the user to complete public key authentication, followed by
200 either password or keyboard interactive authentication.
201 Only methods that are next in one or more lists are offered at each stage,
202 so for this example it would not be possible to attempt password or
203 keyboard-interactive authentication before public key.
204 .Pp
205 For keyboard interactive authentication it is also possible to
206 restrict authentication to a specific device by appending a
207 colon followed by the device identifier
208 .Cm bsdauth
209 or
210 .Cm pam .
211 depending on the server configuration.
212 For example,
213 .Qq keyboard-interactive:bsdauth
214 would restrict keyboard interactive authentication to the
215 .Cm bsdauth
216 device.
217 .Pp
218 If the publickey method is listed more than once,
219 .Xr sshd 8
220 verifies that keys that have been used successfully are not reused for
221 subsequent authentications.
222 For example,
223 .Qq publickey,publickey
224 requires successful authentication using two different public keys.
225 .Pp
226 Note that each authentication method listed should also be explicitly enabled
227 in the configuration.
228 .Pp
229 The 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
235 .Cm PermitEmptyPasswords
236 is enabled),
237 .Qq password
238 and
239 .Qq publickey .
240 .It Cm AuthorizedKeysCommand
241 Specifies a program to be used to look up the user's public keys.
242 The program must be owned by root, not writable by group or others and
243 specified by an absolute path.
244 Arguments to
245 .Cm AuthorizedKeysCommand
246 accept the tokens described in the
247 .Sx TOKENS
248 section.
249 If no arguments are specified then the username of the target user is used.
250 .Pp
251 The program should produce on standard output zero or
252 more lines of authorized_keys output (see
253 .Cm AUTHORIZED_KEYS
254 in
255 .Xr sshd 8 ) .
256 .Cm AuthorizedKeysCommand
257 is tried after the usual
258 .Cm AuthorizedKeysFile
259 files and will not be executed if a matching key is found there.
260 By default, no
261 .Cm AuthorizedKeysCommand
262 is run.
263 This command is only executed for valid users.
264 .It Cm AuthorizedKeysCommandUser
265 Specifies the user under whose account the
266 .Cm AuthorizedKeysCommand
267 is run.
268 It is recommended to use a dedicated user that has no other role on the host
269 than running authorized keys commands.
270 If
271 .Cm AuthorizedKeysCommand
272 is specified but
273 .Cm AuthorizedKeysCommandUser
274 is not, then
275 .Xr sshd 8
276 will refuse to start.
277 .It Cm AuthorizedKeysFile
278 Specifies the file that contains the public keys used for user authentication.
279 The format is described in the AUTHORIZED_KEYS FILE FORMAT section of
280 .Xr sshd 8 .
281 Arguments to
282 .Cm AuthorizedKeysFile
283 may include wildcards and accept the tokens described in the
284 .Sx TOKENS
285 section.
286 After expansion,
287 .Cm AuthorizedKeysFile
288 is taken to be an absolute path or one relative to the user's home
289 directory.
290 Multiple files may be listed, separated by whitespace.
291 Alternately this option may be set to
292 .Cm none
293 to skip checking for user keys in files.
294 The default is
295 .Qq .ssh/authorized_keys .ssh/authorized_keys2 .
296 These files are only checked for valid users.
297 .It Cm AuthorizedPrincipalsCommand
298 Specifies a program to be used to generate the list of allowed
299 certificate principals as per
300 .Cm AuthorizedPrincipalsFile .
301 The program must be owned by root, not writable by group or others and
302 specified by an absolute path.
303 Arguments to
304 .Cm AuthorizedPrincipalsCommand
305 accept the tokens described in the
306 .Sx TOKENS
307 section.
308 If no arguments are specified then the username of the target user is used.
309 .Pp
310 The program should produce on standard output zero or
311 more lines of
312 .Cm AuthorizedPrincipalsFile
313 output.
314 If either
315 .Cm AuthorizedPrincipalsCommand
316 or
317 .Cm AuthorizedPrincipalsFile
318 is specified, then certificates offered by the client for authentication
319 must contain a principal that is listed.
320 By default, no
321 .Cm AuthorizedPrincipalsCommand
322 is run.
323 This command is only executed for valid users.
324 .It Cm AuthorizedPrincipalsCommandUser
325 Specifies the user under whose account the
326 .Cm AuthorizedPrincipalsCommand
327 is run.
328 It is recommended to use a dedicated user that has no other role on the host
329 than running authorized principals commands.
330 If
331 .Cm AuthorizedPrincipalsCommand
332 is specified but
333 .Cm AuthorizedPrincipalsCommandUser
334 is not, then
335 .Xr sshd 8
336 will refuse to start.
337 .It Cm AuthorizedPrincipalsFile
338 Specifies a file that lists principal names that are accepted for
339 certificate authentication.
340 When using certificates signed by a key listed in
341 .Cm TrustedUserCAKeys ,
342 this file lists names, one of which must appear in the certificate for it
343 to be accepted for authentication.
344 Names are listed one per line preceded by key options (as described in
345 .Cm AUTHORIZED_KEYS FILE FORMAT
346 in
347 .Xr sshd 8 ) .
348 Empty lines and comments starting with
349 .Ql #
350 are ignored.
351 .Pp
352 Arguments to
353 .Cm AuthorizedPrincipalsFile
354 may include wildcards and accept the tokens described in the
355 .Sx TOKENS
356 section.
357 After expansion,
358 .Cm AuthorizedPrincipalsFile
359 is taken to be an absolute path or one relative to the user's home directory.
360 The default is
361 .Cm none ,
362 i.e. not to use a principals file \(en in this case, the username
363 of the user must appear in a certificate's principals list for it to be
364 accepted.
365 This file is only checked for valid users.
366 .Pp
367 Note that
368 .Cm AuthorizedPrincipalsFile
369 is only used when authentication proceeds using a CA listed in
370 .Cm TrustedUserCAKeys
371 and is not consulted for certification authorities trusted via
372 .Pa ~/.ssh/authorized_keys ,
373 though the
374 .Cm principals=
375 key option offers a similar facility (see
376 .Xr sshd 8
377 for details).
378 .It Cm Banner
379 The contents of the specified file are sent to the remote user before
380 authentication is allowed.
381 If the argument is
382 .Cm none
383 then no banner is displayed.
384 By default, no banner is displayed.
385 .It Cm CASignatureAlgorithms
386 The default is handled system-wide by
387 .Xr crypto-policies 7 .
388 Information about defaults, how to modify the defaults and how to customize existing policies with sub-policies are present in manual page
389 .Xr update-crypto-policies 8 .
390 .Pp
391 Specifies which algorithms are allowed for signing of certificates
392 by certificate authorities (CAs).
393 If the specified list begins with a
394 .Sq +
395 character, then the specified algorithms will be appended to the default set
396 instead of replacing them.
397 If the specified list begins with a
398 .Sq -
399 character, then the specified algorithms (including wildcards) will be removed
400 from the default set instead of replacing them.
401 .Pp
402 Certificates signed using other algorithms will not be accepted for
403 public key or host-based authentication.
404 .It Cm ChannelTimeout
405 Specifies whether and how quickly
406 .Xr sshd 8
407 should close inactive channels.
408 Timeouts are specified as one or more
409 .Dq type=interval
410 pairs separated by whitespace, where the
411 .Dq type
412 must be the special keyword
413 .Dq global
414 or a channel type name from the list below, optionally containing
415 wildcard characters.
416 .Pp
417 The timeout value
418 .Dq interval
419 is specified in seconds or may use any of the units documented in the
420 .Sx TIME FORMATS
421 section.
422 For example,
423 .Dq session=5m
424 would cause interactive sessions to terminate after five minutes of
425 inactivity.
426 Specifying a zero value disables the inactivity timeout.
427 .Pp
428 The special timeout
429 .Dq global
430 applies to all active channels, taken together.
431 Traffic on any active channel will reset the timeout, but when the timeout
432 expires then all open channels will be closed.
433 Note that this global timeout is not matched by wildcards and must be
434 specified explicitly.
435 .Pp
436 The available channel type names include:
437 .Bl -tag -width Ds
438 .It Cm agent-connection
439 Open connections to
440 .Xr ssh-agent 1 .
441 .It Cm direct-tcpip , Cm [email protected]
442 Open TCP or Unix socket (respectively) connections that have
443 been established from an
444 .Xr ssh 1
445 local forwarding, i.e.\&
446 .Cm LocalForward
447 or
448 .Cm DynamicForward .
449 .It Cm forwarded-tcpip , Cm [email protected]
450 Open TCP or Unix socket (respectively) connections that have been
451 established to an
452 .Xr sshd 8
453 listening on behalf of an
454 .Xr ssh 1
455 remote forwarding, i.e.\&
456 .Cm RemoteForward .
457 .It Cm session
458 The interactive main session, including shell session, command execution,
459 .Xr scp 1 ,
460 .Xr sftp 1 ,
461 etc.
462 .It Cm tun-connection
463 Open
464 .Cm TunnelForward
465 connections.
466 .It Cm x11-connection
467 Open X11 forwarding sessions.
468 .El
469 .Pp
470 Note that in all the above cases, terminating an inactive session does not
471 guarantee to remove all resources associated with the session, e.g. shell
472 processes or X11 clients relating to the session may continue to execute.
473 .Pp
474 Moreover, terminating an inactive channel or session does not necessarily
475 close the SSH connection, nor does it prevent a client from
476 requesting another channel of the same type.
477 In particular, expiring an inactive forwarding session does not prevent
478 another identical forwarding from being subsequently created.
479 .Pp
480 The default is not to expire channels of any type for inactivity.
481 .It Cm ChrootDirectory
482 Specifies the pathname of a directory to
483 .Xr chroot 2
484 to after authentication.
485 At session startup
486 .Xr sshd 8
487 checks that all components of the pathname are root-owned directories
488 which are not writable by group or others.
489 After the chroot,
490 .Xr sshd 8
491 changes the working directory to the user's home directory.
492 Arguments to
493 .Cm ChrootDirectory
494 accept the tokens described in the
495 .Sx TOKENS
496 section.
497 .Pp
498 The
499 .Cm ChrootDirectory
500 must contain the necessary files and directories to support the
501 user's session.
502 For an interactive session this requires at least a shell, typically
503 .Xr sh 1 ,
504 and basic
505 .Pa /dev
506 nodes such as
507 .Xr null 4 ,
508 .Xr zero 4 ,
509 .Xr stdin 4 ,
510 .Xr stdout 4 ,
511 .Xr stderr 4 ,
512 and
513 .Xr tty 4
514 devices.
515 For file transfer sessions using SFTP
516 no additional configuration of the environment is necessary if the in-process
517 sftp-server is used,
518 though sessions which use logging may require
519 .Pa /dev/log
520 inside the chroot directory on some operating systems (see
521 .Xr sftp-server 8
522 for details).
523 .Pp
524 For safety, it is very important that the directory hierarchy be
525 prevented from modification by other processes on the system (especially
526 those outside the jail).
527 Misconfiguration can lead to unsafe environments which
528 .Xr sshd 8
529 cannot detect.
530 .Pp
531 The default is
532 .Cm none ,
533 indicating not to
534 .Xr chroot 2 .
535 .It Cm Ciphers
536 The default is handled system-wide by
537 .Xr crypto-policies 7 .
538 Information about defaults, how to modify the defaults and how to customize existing policies with sub-policies are present in manual page
539 .Xr update-crypto-policies 8 .
540 .Pp
541 Specifies the ciphers allowed.
542 Multiple ciphers must be comma-separated.
543 If the specified list begins with a
544 .Sq +
545 character, then the specified ciphers will be appended to the built-in
546 openssh default set instead of replacing them.
547 If the specified list begins with a
548 .Sq -
549 character, then the specified ciphers (including wildcards) will be removed
550 from the built-in openssh default set instead of replacing them.
551 If the specified list begins with a
552 .Sq ^
553 character, then the specified ciphers will be placed at the head of the
554 built-in openssh default set.
555 .Pp
556 The supported ciphers are:
557 .Pp
558 .Bl -item -compact -offset indent
559 .It
560 3des-cbc
561 .It
562 aes128-cbc
563 .It
564 aes192-cbc
565 .It
566 aes256-cbc
567 .It
568 aes128-ctr
569 .It
570 aes192-ctr
571 .It
572 aes256-ctr
573 .It
574 [email protected]
575 .It
576 [email protected]
577 .It
578 [email protected]
579 .El
580 .Pp
581 The list of available ciphers may also be obtained using
582 .Qq ssh -Q cipher .
583 .It Cm ClientAliveCountMax
584 Sets the number of client alive messages which may be sent without
585 .Xr sshd 8
586 receiving any messages back from the client.
587 If this threshold is reached while client alive messages are being sent,
588 sshd will disconnect the client, terminating the session.
589 It is important to note that the use of client alive messages is very
590 different from
591 .Cm TCPKeepAlive .
592 The client alive messages are sent through the encrypted channel
593 and therefore will not be spoofable.
594 The TCP keepalive option enabled by
595 .Cm TCPKeepAlive
596 is spoofable.
597 The client alive mechanism is valuable when the client or
598 server depend on knowing when a connection has become unresponsive.
599 .Pp
600 The default value is 3.
601 If
602 .Cm ClientAliveInterval
603 is set to 15, and
604 .Cm ClientAliveCountMax
605 is left at the default, unresponsive SSH clients
606 will be disconnected after approximately 45 seconds.
607 Setting a zero
608 .Cm ClientAliveCountMax
609 disables connection termination.
610 .It Cm ClientAliveInterval
611 Sets a timeout interval in seconds after which if no data has been received
612 from the client,
613 .Xr sshd 8
614 will send a message through the encrypted
615 channel to request a response from the client.
616 The default
617 is 0, indicating that these messages will not be sent to the client.
618 .It Cm Compression
619 Specifies whether compression is enabled after
620 the user has authenticated successfully.
621 The argument must be
622 .Cm yes ,
623 .Cm delayed
624 (a legacy synonym for
625 .Cm yes )
626 or
627 .Cm no .
628 The default is
629 .Cm yes .
630 .It Cm DenyGroups
631 This keyword can be followed by a list of group name patterns, separated
632 by spaces.
633 Login is disallowed for users whose primary group or supplementary
634 group list matches one of the patterns.
635 Only group names are valid; a numerical group ID is not recognized.
636 By default, login is allowed for all groups.
637 .Cm AllowGroups
638 is not consulted for groups matched by
639 .Cm DenyGroups .
640 .Pp
641 See PATTERNS in
642 .Xr ssh_config 5
643 for more information on patterns.
644 This keyword may appear multiple times in
645 .Nm
646 with each instance appending to the list.
647 .It Cm DenyUsers
648 This keyword can be followed by a list of user name patterns, separated
649 by spaces.
650 Login is disallowed for user names that match one of the patterns.
651 Only user names are valid; a numerical user ID is not recognized.
652 By default, login is allowed for all users.
653 If the pattern takes the form USER@HOST then USER and HOST
654 are separately checked, restricting logins to particular
655 users from particular hosts.
656 HOST criteria may additionally contain addresses to match in CIDR
657 address/masklen format.
658 .Cm AllowUsers
659 is not consulted for users matched by
660 .Cm DenyUsers .
661 .Pp
662 See PATTERNS in
663 .Xr ssh_config 5
664 for more information on patterns.
665 This keyword may appear multiple times in
666 .Nm
667 with each instance appending to the list.
668 .It Cm DisableForwarding
669 Disables all forwarding features, including X11,
670 .Xr ssh-agent 1 ,
671 TCP and StreamLocal.
672 This option overrides all other forwarding-related options and may
673 simplify restricted configurations.
674 .It Cm ExposeAuthInfo
675 Writes a temporary file containing a list of authentication methods and
676 public credentials (e.g. keys) used to authenticate the user.
677 The location of the file is exposed to the user session through the
678 .Ev SSH_USER_AUTH
679 environment variable.
680 The default is
681 .Cm no .
682 .It Cm FingerprintHash
683 Specifies the hash algorithm used when logging key fingerprints.
684 Valid options are:
685 .Cm md5
686 and
687 .Cm sha256 .
688 The default is
689 .Cm sha256 .
690 .It Cm ForceCommand
691 Forces the execution of the command specified by
692 .Cm ForceCommand ,
693 ignoring any command supplied by the client and
694 .Pa ~/.ssh/rc
695 if present.
696 The command is invoked by using the user's login shell with the -c option.
697 This applies to shell, command, or subsystem execution.
698 It is most useful inside a
699 .Cm Match
700 block.
701 The command originally supplied by the client is available in the
702 .Ev SSH_ORIGINAL_COMMAND
703 environment variable.
704 Specifying a command of
705 .Cm internal-sftp
706 will force the use of an in-process SFTP server that requires no support
707 files when used with
708 .Cm ChrootDirectory .
709 The default is
710 .Cm none .
711 .Pp
712 This directive does not limit other kinds of access that a
713 client may request via their connection, such as TCP, agent, socket or
714 X11 forwarding.
715 If these are not desired, then they must be explicitly disabled, either
716 individually via their respective options or all together using the
717 .Cm DisableForwarding
718 option.
719 .It Cm GatewayPorts
720 Specifies whether remote hosts are allowed to connect to ports
721 forwarded for the client.
722 By default,
723 .Xr sshd 8
724 binds remote port forwardings to the loopback address.
725 This prevents other remote hosts from connecting to forwarded ports.
726 .Cm GatewayPorts
727 can be used to specify that sshd
728 should allow remote port forwardings to bind to non-loopback addresses, thus
729 allowing other hosts to connect.
730 The argument may be
731 .Cm no
732 to force remote port forwardings to be available to the local host only,
733 .Cm yes
734 to force remote port forwardings to bind to the wildcard address, or
735 .Cm clientspecified
736 to allow the client to select the address to which the forwarding is bound.
737 The default is
738 .Cm no .
739 .It Cm GSSAPIAuthentication
740 Specifies whether user authentication based on GSSAPI is allowed.
741 The default is
742 .Cm no .
743 .It Cm GSSAPICleanupCredentials
744 Specifies whether to automatically destroy the user's credentials cache
745 on logout.
746 The default is
747 .Cm yes .
748 .It Cm GSSAPIDelegateCredentials
749 Accept delegated credentials on the server side. The default is
750 .CM yes .
751 .It Cm GSSAPIEnablek5users
752 Specifies whether to look at .k5users file for GSSAPI authentication
753 access control. Further details are described in
754 .Xr ksu 1 .
755 The default is
756 .Cm no .
757 .It Cm GSSAPIKeyExchange
758 Specifies whether key exchange based on GSSAPI is allowed. GSSAPI key exchange
759 doesn't rely on ssh keys to verify host identity.
760 The default is
761 .Cm no .
762 .It Cm GSSAPIStrictAcceptorCheck
763 Determines whether to be strict about the identity of the GSSAPI acceptor
764 a client authenticates against.
765 If set to
766 .Cm yes
767 then the client must authenticate against the host
768 service on the current hostname.
769 If set to
770 .Cm no
771 then the client may authenticate against any service key stored in the
772 machine's default store.
773 This facility is provided to assist with operation on multi homed machines.
774 The default is
775 .Cm yes .
776 .It Cm GSSAPIStoreCredentialsOnRekey
777 Controls whether the user's GSSAPI credentials should be updated following a
778 successful connection rekeying. This option can be used to accepted renewed
779 or updated credentials from a compatible client. The default is
780 .Dq no .
781 .Pp
782 For this to work
783 .Cm GSSAPIKeyExchange
784 needs to be enabled in the server and also used by the client.
785 .It Cm GSSAPIKexAlgorithms
786 The default is handled system-wide by
787 .Xr crypto-policies 7 .
788 Information about defaults, how to modify the defaults and how to customize existing policies with sub-policies are present in manual page
789 .Xr update-crypto-policies 8 .
790 .Pp
791 The list of key exchange algorithms that are accepted by GSSAPI
792 key exchange. Possible values are
793 .Bd -literal -offset 3n
794 gss-gex-sha1-
795 gss-group1-sha1-
796 gss-group14-sha1-
797 gss-group14-sha256-
798 gss-group16-sha512-
799 gss-nistp256-sha256-
800 gss-curve25519-sha256-
801 .Ed
802 This option only applies to connections using GSSAPI.
803 .It Cm GSSAPIIndicators
804 Specifies whether to accept or deny GSSAPI authenticated access if Kerberos
805 mechanism is used and Kerberos ticket contains a particular set of
806 authentication indicators. The values can be specified as a comma-separated list
807 .Cm [!]name1,[!]name2,... .
808 When indicator's name is prefixed with !, the authentication indicator 'name'
809 will deny access to the system. Otherwise, one of non-negated authentication
810 indicators must be present in the Kerberos ticket to allow access. If
811 .Cm GSSAPIIndicators
812 is defined, a Kerberos ticket that has indicators but does not match the
813 policy will get denial. If at least one indicator is configured, whether for
814 access or denial, tickets without authentication indicators will be explicitly
815 rejected.
816 .Pp
817 By default systems using MIT Kerberos 1.17 or later will not assign any
818 indicators. SPAKE and PKINIT methods add authentication indicators
819 to all successful authentications. The SPAKE pre-authentication method is
820 preferred over an encrypted timestamp pre-authentication when passwords used to
821 authenticate user principals. Kerberos KDCs built with Heimdal Kerberos
822 (including Samba AD DC built with Heimdal) do not add authentication
823 indicators. However, OpenSSH built against Heimdal Kerberos library is able to
824 inquire authentication indicators and thus can be used to check for their presence.
825 .Pp
826 Indicator name is case-sensitive and depends on the configuration of a
827 particular Kerberos deployment. Indicators available in MIT Kerberos and
828 FreeIPA environments:
829 .Pp
830 .Bl -tag -width XXXX -offset indent -compact
831 .It Cm hardened
832 SPAKE or encrypted timestamp pre-authentication mechanisms in MIT Kerberos and FreeIPA
833 .It Cm pkinit
834 smartcard or PKCS11 token-based pre-authentication in MIT Kerberos and FreeIPA
835 .It Cm radius
836 pre-authentication based on a RADIUS server in MIT Kerberos and FreeIPA
837 .It Cm otp
838 TOTP/HOTP-based two-factor pre-authentication in FreeIPA
839 .It Cm idp
840 OAuth2-based pre-authentication in FreeIPA using an external identity provider
841 and device authorization grant flow
842 .It Cm passkey
843 FIDO2-based pre-authentication in FreeIPA, using FIDO2 USB and NFC tokens
844 .El
845 .Pp
846 The default
847 .Dq none
848 is to not use GSSAPI authentication indicators for access decisions.
849 .It Cm GSSAPIAllowS4U2Self
850 Controls whether the SSH server performs a Kerberos protocol transition
851 (S4U2Self) after a successful authentication using any other method.
852 Accepted values are
853 .Cm no ,
854 .Cm yes ,
855 or a time interval (see
856 .Sx TIME FORMATS
857 below).
858 .Cm no
859 disables S4U2Self entirely.
860 .Cm yes
861 enables S4U2Self and requests a ticket with the maximum lifetime
862 permitted by the KDC.
863 A time interval (e.g.\&
864 .Cm 8h ,
865 .Cm 1d )
866 enables S4U2Self and requests a ticket valid for at most that duration.
867 The option is a no-op when delegated GSSAPI credentials are already available.
868 The obtained service ticket is stored in the default credentials cache and is
869 accessible to any application that has access to the Kerberos host principal
870 .Pq host/machine.fqdn@REALM
871 credentials on the same host.
872 .Pp
873 The default is
874 .Cm no .
875 .It Cm GSSAPIProxyS4U2Services
876 Specifies a list of Kerberos service principals for which constrained
877 delegation (S4U2Proxy) tickets should be obtained after a successful
878 S4U2Self protocol transition.
879 Each entry must be a fully-qualified Kerberos principal name of the form
880 .Ar service/host@REALM .
881 Multiple principals may be listed, separated by whitespace.
882 The keyword
883 .Cm none
884 clears any previously set list.
885 .Pp
886 This option may be used independently of
887 .Cm GSSAPIAllowS4U2Self .
888 When S4U2Self succeeds, the server iterates the list and calls
889 .Xr gss_init_sec_context 3
890 for each principal with the proxy credential obtained by S4U2Self as
891 the initiator.
892 The GSSAPI library presents the evidence ticket to the KDC via an
893 S4U2Proxy TGS-REQ; if the host service holds the necessary constrained-
894 delegation permission in the KDC, a service ticket from the user to
895 the target service is issued.
896 These tickets are accumulated and then flushed into the user's ccache
897 via
898 .Xr gss_store_cred 3 ,
899 so that any application running in the user's session can use them
900 without further interaction.
901 The AP-REQ output token of each
902 .Xr gss_init_sec_context 3
903 call is discarded; no network connection to the target service is made.
904 .Pp
905 When used together with
906 .Cm GSSAPIAllowS4U2Self ,
907 the TGT and S4U2Self ticket are also stored in the user's ccache in
908 addition to the S4U2Proxy service tickets.
909 When used alone (without
910 .Cm GSSAPIAllowS4U2Self ) ,
911 only the S4U2Proxy service tickets are stored; the intermediate S4U2Self
912 credential is not placed in the user's ccache.
913 .Pp
914 This option supports
915 .Cm Match
916 blocks, allowing per-user or per-host lists of delegation targets.
917 .Pp
918 The default is empty (no S4U2Proxy delegation is performed).
919 .It Cm HostbasedAcceptedAlgorithms
920 The default is handled system-wide by
921 .Xr crypto-policies 7 .
922 Information about defaults, how to modify the defaults and how to customize existing policies with sub-policies are present in manual page
923 .Xr update-crypto-policies 8 .
924 .Pp
925 Specifies the signature algorithms that will be accepted for hostbased
926 authentication as a list of comma-separated patterns.
927 Alternately if the specified list begins with a
928 .Sq +
929 character, then the specified signature algorithms will be appended to
930 the built-in openssh default set instead of replacing them.
931 If the specified list begins with a
932 .Sq -
933 character, then the specified signature algorithms (including wildcards)
934 will be removed from the built-in openssh default set instead of replacing them.
935 If the specified list begins with a
936 .Sq ^
937 character, then the specified signature algorithms will be placed at
938 the head of the built-in openssh default set.
939 .Pp
940 The list of available signature algorithms may also be obtained using
941 .Qq ssh -Q HostbasedAcceptedAlgorithms .
942 This was formerly named HostbasedAcceptedKeyTypes.
943 .It Cm HostbasedAuthentication
944 Specifies whether rhosts or /etc/hosts.equiv authentication together
945 with successful public key client host authentication is allowed
946 (host-based authentication).
947 The default is
948 .Cm no .
949 .It Cm HostbasedUsesNameFromPacketOnly
950 Specifies whether or not the server will attempt to perform a reverse
951 name lookup when matching the name in the
952 .Pa ~/.shosts ,
953 .Pa ~/.rhosts ,
954 and
955 .Pa /etc/hosts.equiv
956 files during
957 .Cm HostbasedAuthentication .
958 A setting of
959 .Cm yes
960 means that
961 .Xr sshd 8
962 uses the name supplied by the client rather than
963 attempting to resolve the name from the TCP connection itself.
964 The default is
965 .Cm no .
966 .It Cm HostCertificate
967 Specifies a file containing a public host certificate.
968 The certificate's public key must match a private host key already specified
969 by
970 .Cm HostKey .
971 The default behaviour of
972 .Xr sshd 8
973 is not to load any certificates.
974 .It Cm HostKey
975 Specifies a file containing a private host key
976 used by SSH.
977 The defaults are
978 .Pa /etc/ssh/ssh_host_ecdsa_key ,
979 .Pa /etc/ssh/ssh_host_ed25519_key
980 and
981 .Pa /etc/ssh/ssh_host_rsa_key .
982 .Pp
983 Note that
984 .Xr sshd 8
985 will refuse to use a file if it is group/world-accessible
986 and that the
987 .Cm HostKeyAlgorithms
988 option restricts which of the keys are actually used by
989 .Xr sshd 8 .
990 .Pp
991 It is possible to have multiple host key files.
992 It is also possible to specify public host key files instead.
993 In this case operations on the private key will be delegated
994 to an
995 .Xr ssh-agent 1 .
996 .It Cm HostKeyAgent
997 Identifies the UNIX-domain socket used to communicate
998 with an agent that has access to the private host keys.
999 If the string
1000 .Qq SSH_AUTH_SOCK
1001 is specified, the location of the socket will be read from the
1002 .Ev SSH_AUTH_SOCK
1003 environment variable.
1004 .It Cm HostKeyAlgorithms
1005 The default is handled system-wide by
1006 .Xr crypto-policies 7 .
1007 Information about defaults, how to modify the defaults and how to customize existing policies with sub-policies are present in manual page
1008 .Xr update-crypto-policies 8 .
1009 .Pp
1010 Specifies the host key signature algorithms
1011 that the server offers.
1012 The list of available signature algorithms may also be obtained using
1013 .Qq ssh -Q HostKeyAlgorithms .
1014 .It Cm IgnoreRhosts
1015 Specifies whether to ignore per-user
1016 .Pa .rhosts
1017 and
1018 .Pa .shosts
1019 files during
1020 .Cm HostbasedAuthentication .
1021 The system-wide
1022 .Pa /etc/hosts.equiv
1023 and
1024 .Pa /etc/ssh/shosts.equiv
1025 are still used regardless of this setting.
1026 .Pp
1027 Accepted values are
1028 .Cm yes
1029 (the default) to ignore all per-user files,
1030 .Cm shosts-only
1031 to allow the use of
1032 .Pa .shosts
1033 but to ignore
1034 .Pa .rhosts
1035 or
1036 .Cm no
1037 to allow both
1038 .Pa .shosts
1039 and
1040 .Pa rhosts .
1041 .It Cm IgnoreUserKnownHosts
1042 Specifies whether
1043 .Xr sshd 8
1044 should ignore the user's
1045 .Pa ~/.ssh/known_hosts
1046 during
1047 .Cm HostbasedAuthentication
1048 and use only the system-wide known hosts file
1049 .Pa /etc/ssh/ssh_known_hosts .
1050 The default is
1051 .Dq no .
1052 .It Cm Include
1053 Include the specified configuration file(s).
1054 Multiple pathnames may be specified and each pathname may contain
1055 .Xr glob 7
1056 wildcards that will be expanded and processed in lexical order.
1057 Files without absolute paths are assumed to be in
1058 .Pa /etc/ssh .
1059 An
1060 .Cm Include
1061 directive may appear inside a
1062 .Cm Match
1063 block
1064 to perform conditional inclusion.
1065 .It Cm IPQoS
1066 Specifies the
1067 .Em Differentiated Services Field Codepoint Pq DSCP
1068 value for the connection.
1069 Accepted values are
1070 .Cm af11 ,
1071 .Cm af12 ,
1072 .Cm af13 ,
1073 .Cm af21 ,
1074 .Cm af22 ,
1075 .Cm af23 ,
1076 .Cm af31 ,
1077 .Cm af32 ,
1078 .Cm af33 ,
1079 .Cm af41 ,
1080 .Cm af42 ,
1081 .Cm af43 ,
1082 .Cm cs0 ,
1083 .Cm cs1 ,
1084 .Cm cs2 ,
1085 .Cm cs3 ,
1086 .Cm cs4 ,
1087 .Cm cs5 ,
1088 .Cm cs6 ,
1089 .Cm cs7 ,
1090 .Cm ef ,
1091 .Cm le ,
1092 a numeric value, or
1093 .Cm none
1094 to use the operating system default.
1095 This option may take one or two arguments, separated by whitespace.
1096 If one argument is specified, it is used as the packet class unconditionally.
1097 If two values are specified, the first is automatically selected for
1098 interactive sessions and the second for non-interactive sessions.
1099 The default is
1100 .Cm ef
1101 (Expedited Forwarding)
1102 for interactive sessions and
1103 .Cm none
1104 (the operating system default)
1105 for non-interactive sessions.
1106 .It Cm KbdInteractiveAuthentication
1107 Specifies whether to allow keyboard-interactive authentication.
1108 All authentication styles from
1109 .Xr login.conf 5
1110 are supported.
1111 The default is
1112 .Cm yes .
1113 The argument to this keyword must be
1114 .Cm yes
1115 or
1116 .Cm no .
1117 .Cm ChallengeResponseAuthentication
1118 is a deprecated alias for this.
1119 .It Cm KerberosAuthentication
1120 Specifies whether the password provided by the user for
1121 .Cm PasswordAuthentication
1122 will be validated through the Kerberos KDC.
1123 To use this option, the server needs a
1124 Kerberos servtab which allows the verification of the KDC's identity.
1125 The default is
1126 .Cm no .
1127 .It Cm KerberosGetAFSToken
1128 If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
1129 an AFS token before accessing the user's home directory.
1130 The default is
1131 .Cm no .
1132 .It Cm KerberosOrLocalPasswd
1133 If password authentication through Kerberos fails then
1134 the password will be validated via any additional local mechanism
1135 such as
1136 .Pa /etc/passwd .
1137 The default is
1138 .Cm yes .
1139 .It Cm KerberosTicketCleanup
1140 Specifies whether to automatically destroy the user's ticket cache
1141 file on logout.
1142 The default is
1143 .Cm yes .
1144 .It Cm KerberosUniqueCCache
1145 Specifies whether to store the acquired tickets in the per-session credential
1146 cache under /tmp/ or whether to use per-user credential cache as configured in
1147 .Pa /etc/krb5.conf .
1148 The default value
1149 .Cm no
1150 can lead to overwriting previous tickets by subseqent connections to the same
1151 user account.
1152 .It Cm KerberosUseKuserok
1153 Specifies whether to look at .k5login file for user's aliases.
1154 The default is
1155 .Cm yes .
1156 .It Cm KexAlgorithms
1157 The default is handled system-wide by
1158 .Xr crypto-policies 7 .
1159 Information about defaults, how to modify the defaults and how to customize existing policies with sub-policies are present in manual page
1160 .Xr update-crypto-policies 8 .
1161 .Pp
1162 Specifies the permitted KEX (Key Exchange) algorithms that the server will
1163 offer to clients.
1164 The ordering of this list is not important, as the client specifies the
1165 preference order.
1166 Multiple algorithms must be comma-separated.
1167 .Pp
1168 If the specified list begins with a
1169 .Sq +
1170 character, then the specified methods will be appended to the built-in
1171 openssh default set instead of replacing them.
1172 If the specified list begins with a
1173 .Sq -
1174 character, then the specified algorithms (including wildcards) will be removed
1175 from the built-in openssh default set instead of replacing them.
1176 If the specified list begins with a
1177 .Sq ^
1178 character, then the specified algorithms will be placed at the head of the
1179 built-in openssh default set.
1180 .Pp
1181 The supported algorithms are:
1182 .Pp
1183 .Bl -item -compact -offset indent
1184 .It
1185 curve25519-sha256
1186 .It
1187 [email protected]
1188 .It
1189 diffie-hellman-group1-sha1
1190 .It
1191 diffie-hellman-group14-sha1
1192 .It
1193 diffie-hellman-group14-sha256
1194 .It
1195 diffie-hellman-group16-sha512
1196 .It
1197 diffie-hellman-group18-sha512
1198 .It
1199 diffie-hellman-group-exchange-sha1
1200 .It
1201 diffie-hellman-group-exchange-sha256
1202 .It
1203 ecdh-sha2-nistp256
1204 .It
1205 ecdh-sha2-nistp384
1206 .It
1207 ecdh-sha2-nistp521
1208 .It
1209 mlkem768x25519-sha256
1210 .It
1211 sntrup761x25519-sha512
1212 .It
1213 [email protected]
1214 .El
1215 .Pp
1216 The list of supported key exchange algorithms may also be obtained using
1217 .Qq ssh -Q KexAlgorithms .
1218 .It Cm ListenAddress
1219 Specifies the local addresses
1220 .Xr sshd 8
1221 should listen on.
1222 The following forms may be used:
1223 .Pp
1224 .Bl -item -offset indent -compact
1225 .It
1226 .Cm ListenAddress
1227 .Sm off
1228 .Ar hostname | address
1229 .Sm on
1230 .Op Cm rdomain Ar domain
1231 .It
1232 .Cm ListenAddress
1233 .Sm off
1234 .Ar hostname : port
1235 .Sm on
1236 .Op Cm rdomain Ar domain
1237 .It
1238 .Cm ListenAddress
1239 .Sm off
1240 .Ar IPv4_address : port
1241 .Sm on
1242 .Op Cm rdomain Ar domain
1243 .It
1244 .Cm ListenAddress
1245 .Sm off
1246 .Oo Ar hostname | address Oc : Ar port
1247 .Sm on
1248 .Op Cm rdomain Ar domain
1249 .El
1250 .Pp
1251 The optional
1252 .Cm rdomain
1253 qualifier requests
1254 .Xr sshd 8
1255 listen in an explicit routing domain.
1256 If
1257 .Ar port
1258 is not specified,
1259 sshd will listen on the address and all
1260 .Cm Port
1261 options specified.
1262 The default is to listen on all local addresses on the current default
1263 routing domain.
1264 Multiple
1265 .Cm ListenAddress
1266 options are permitted.
1267 For more information on routing domains, see
1268 .Xr rdomain 4 .
1269 .It Cm LoginGraceTime
1270 The server disconnects after this time if the user has not
1271 successfully logged in.
1272 If the value is 0, there is no time limit.
1273 The default is 120 seconds.
1274 .It Cm LogLevel
1275 Gives the verbosity level that is used when logging messages from
1276 .Xr sshd 8 .
1277 The possible values are:
1278 QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
1279 The default is INFO.
1280 DEBUG and DEBUG1 are equivalent.
1281 DEBUG2 and DEBUG3 each specify higher levels of debugging output.
1282 Logging with a DEBUG level violates the privacy of users and is not recommended.
1283 .It Cm LogVerbose
1284 Specify one or more overrides to
1285 .Cm LogLevel .
1286 An override consists of one or more pattern lists that matches the
1287 source file, function and line number to force detailed logging for.
1288 For example, an override pattern of:
1289 .Bd -literal -offset indent
1290 kex.c:*:1000,*:kex_exchange_identification():*,packet.c:*
1291 .Ed
1292 .Pp
1293 would enable detailed logging for line 1000 of
1294 .Pa kex.c ,
1295 everything in the
1296 .Fn kex_exchange_identification
1297 function, and all code in the
1298 .Pa packet.c
1299 file.
1300 This option is intended for debugging and no overrides are enabled by default.
1301 .It Cm MACs
1302 The default is handled system-wide by
1303 .Xr crypto-policies 7 .
1304 Information about defaults, how to modify the defaults and how to customize existing policies with sub-policies are present in manual page
1305 .Xr update-crypto-policies 8 .
1306 .Pp
1307 Specifies the available MAC (message authentication code) algorithms.
1308 The MAC algorithm is used for data integrity protection.
1309 Multiple algorithms must be comma-separated.
1310 If the specified list begins with a
1311 .Sq +
1312 character, then the specified algorithms will be appended to the built-in
1313 openssh default set instead of replacing them.
1314 If the specified list begins with a
1315 .Sq -
1316 character, then the specified algorithms (including wildcards) will be removed
1317 from the built-in openssh default set instead of replacing them.
1318 If the specified list begins with a
1319 .Sq ^
1320 character, then the specified algorithms will be placed at the head of the
1321 built-in openssh default set.
1322 .Pp
1323 The algorithms that contain
1324 .Qq -etm
1325 calculate the MAC after encryption (encrypt-then-mac).
1326 These are considered safer and their use recommended.
1327 The supported MACs are:
1328 .Pp
1329 .Bl -item -compact -offset indent
1330 .It
1331 hmac-md5
1332 .It
1333 hmac-md5-96
1334 .It
1335 hmac-sha1
1336 .It
1337 hmac-sha1-96
1338 .It
1339 hmac-sha2-256
1340 .It
1341 hmac-sha2-512
1342 .It
1343 [email protected]
1344 .It
1345 [email protected]
1346 .It
1347 [email protected]
1348 .It
1349 [email protected]
1350 .It
1351 [email protected]
1352 .It
1353 [email protected]
1354 .It
1355 [email protected]
1356 .It
1357 [email protected]
1358 .It
1359 [email protected]
1360 .It
1361 [email protected]
1362 .El
1363 .Pp
1364 The list of available MAC algorithms may also be obtained using
1365 .Qq ssh -Q mac .
1366 .It Cm Match
1367 Introduces a conditional block.
1368 If all of the criteria on the
1369 .Cm Match
1370 line are satisfied, the keywords on the following lines override those
1371 set in the global section of the config file, until either another
1372 .Cm Match
1373 line or the end of the file.
1374 If a keyword appears in multiple
1375 .Cm Match
1376 blocks that are satisfied, only the first instance of the keyword is
1377 applied.
1378 .Pp
1379 The arguments to
1380 .Cm Match
1381 are one or more criteria-pattern pairs or one of the single token criteria:
1382 .Cm All ,
1383 which matches all criteria, or
1384 .Cm Invalid-User ,
1385 which matches when the requested user-name does not match any known account.
1386 The available criteria are
1387 .Cm User ,
1388 .Cm Group ,
1389 .Cm Host ,
1390 .Cm LocalAddress ,
1391 .Cm LocalPort ,
1392 .Cm Version ,
1393 .Cm RDomain ,
1394 and
1395 .Cm Address
1396 (with
1397 .Cm RDomain
1398 representing the
1399 .Xr rdomain 4
1400 on which the connection was received).
1401 .Pp
1402 The match patterns may consist of single entries or comma-separated
1403 lists and may use the wildcard and negation operators described in the
1404 .Sx PATTERNS
1405 section of
1406 .Xr ssh_config 5 .
1407 .Pp
1408 The patterns in an
1409 .Cm Address
1410 criteria may additionally contain addresses to match in CIDR
1411 address/masklen format,
1412 such as 192.0.2.0/24 or 2001:db8::/32.
1413 Note that the mask length provided must be consistent with the address -
1414 it is an error to specify a mask length that is too long for the address
1415 or one with bits set in this host portion of the address.
1416 For example, 192.0.2.0/33 and 192.0.2.0/8, respectively.
1417 .Pp
1418 The
1419 .Cm Version
1420 keyword matches against the version string of
1421 .Xr sshd 8 ,
1422 for example
1423 .Dq OpenSSH_10.0 .
1424 .Pp
1425 Only a subset of keywords may be used on the lines following a
1426 .Cm Match
1427 keyword.
1428 Available keywords are
1429 .Cm AcceptEnv ,
1430 .Cm AllowAgentForwarding ,
1431 .Cm AllowGroups ,
1432 .Cm AllowStreamLocalForwarding ,
1433 .Cm AllowTcpForwarding ,
1434 .Cm AllowUsers ,
1435 .Cm AuthenticationMethods ,
1436 .Cm AuthorizedKeysCommand ,
1437 .Cm AuthorizedKeysCommandUser ,
1438 .Cm AuthorizedKeysFile ,
1439 .Cm AuthorizedPrincipalsCommand ,
1440 .Cm AuthorizedPrincipalsCommandUser ,
1441 .Cm AuthorizedPrincipalsFile ,
1442 .Cm Banner ,
1443 .Cm CASignatureAlgorithms ,
1444 .Cm ChannelTimeout ,
1445 .Cm ChrootDirectory ,
1446 .Cm ClientAliveCountMax ,
1447 .Cm ClientAliveInterval ,
1448 .Cm DenyGroups ,
1449 .Cm DenyUsers ,
1450 .Cm DisableForwarding ,
1451 .Cm ExposeAuthInfo ,
1452 .Cm ForceCommand ,
1453 .Cm GatewayPorts ,
1454 .Cm GSSAPIAuthentication ,
1455 .Cm HostbasedAcceptedAlgorithms ,
1456 .Cm HostbasedAuthentication ,
1457 .Cm HostbasedUsesNameFromPacketOnly ,
1458 .Cm IgnoreRhosts ,
1459 .Cm Include ,
1460 .Cm IPQoS ,
1461 .Cm KbdInteractiveAuthentication ,
1462 .Cm KerberosAuthentication ,
1463 .Cm KerberosUseKuserok ,
1464 .Cm LogLevel ,
1465 .Cm MaxAuthTries ,
1466 .Cm MaxSessions ,
1467 .Cm PAMServiceName ,
1468 .Cm PasswordAuthentication ,
1469 .Cm PermitEmptyPasswords ,
1470 .Cm PermitListen ,
1471 .Cm PermitOpen ,
1472 .Cm PermitRootLogin ,
1473 .Cm PermitTTY ,
1474 .Cm PermitTunnel ,
1475 .Cm PermitUserRC ,
1476 .Cm PubkeyAcceptedAlgorithms ,
1477 .Cm PubkeyAuthentication ,
1478 .Cm PubkeyAuthOptions ,
1479 .Cm RefuseConnection ,
1480 .Cm RekeyLimit ,
1481 .Cm RevokedKeys ,
1482 .Cm RDomain ,
1483 .Cm SetEnv ,
1484 .Cm StreamLocalBindMask ,
1485 .Cm StreamLocalBindUnlink ,
1486 .Cm TrustedUserCAKeys ,
1487 .Cm UnusedConnectionTimeout ,
1488 .Cm X11DisplayOffset ,
1489 .Cm X11MaxDisplays ,
1490 .Cm X11Forwarding
1491 and
1492 .Cm X11UseLocalhost .
1493 .It Cm MaxAuthTries
1494 Specifies the maximum number of authentication attempts permitted per
1495 connection.
1496 Once the number of failures reaches half this value,
1497 additional failures are logged.
1498 The default is 6.
1499 .It Cm MaxSessions
1500 Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1501 sessions permitted per network connection.
1502 Multiple sessions may be established by clients that support connection
1503 multiplexing.
1504 Setting
1505 .Cm MaxSessions
1506 to 1 will effectively disable session multiplexing, whereas setting it to 0
1507 will prevent all shell, login and subsystem sessions while still permitting
1508 forwarding.
1509 The default is 10.
1510 .It Cm MaxStartups
1511 Specifies the maximum number of concurrent unauthenticated connections to the
1512 SSH daemon.
1513 Additional connections will be dropped until authentication succeeds or the
1514 .Cm LoginGraceTime
1515 expires for a connection.
1516 .Pp
1517 Alternatively, random early drop can be enabled by specifying
1518 the three colon separated values
1519 start:rate:full (e.g. "10:30:60").
1520 The default is 10:30:100.
1521 .Xr sshd 8
1522 will refuse connection attempts with a probability of rate/100 (30%)
1523 if there are currently start (10) unauthenticated connections.
1524 The probability increases linearly and all connection attempts
1525 are refused if the number of unauthenticated connections reaches full (60).
1526 .It Cm ModuliFile
1527 Specifies the
1528 .Xr moduli 5
1529 file that contains the Diffie-Hellman groups used for the
1530 .Dq diffie-hellman-group-exchange-sha1
1531 and
1532 .Dq diffie-hellman-group-exchange-sha256
1533 key exchange methods.
1534 The default is
1535 .Pa /etc/ssh/moduli .
1536 .It Cm PAMServiceName
1537 Specifies the service name used for Pluggable Authentication Modules (PAM)
1538 authentication, authorisation and session controls when
1539 .Cm UsePAM
1540 is enabled.
1541 The default is
1542 .Cm sshd .
1543 .It Cm PasswordAuthentication
1544 Specifies whether password authentication is allowed.
1545 The default is
1546 .Cm yes .
1547 .It Cm PermitEmptyPasswords
1548 When password authentication is allowed, it specifies whether the
1549 server allows login to accounts with empty password strings.
1550 The default is
1551 .Cm no .
1552 .It Cm PermitListen
1553 Specifies the addresses/ports on which a remote TCP port forwarding may listen.
1554 The listen specification must be one of the following forms:
1555 .Pp
1556 .Bl -item -offset indent -compact
1557 .It
1558 .Cm PermitListen
1559 .Sm off
1560 .Ar port
1561 .Sm on
1562 .It
1563 .Cm PermitListen
1564 .Sm off
1565 .Ar host : port
1566 .Sm on
1567 .El
1568 .Pp
1569 Multiple permissions may be specified by separating them with whitespace.
1570 An argument of
1571 .Cm any
1572 can be used to remove all restrictions and permit any listen requests.
1573 An argument of
1574 .Cm none
1575 can be used to prohibit all listen requests.
1576 The host name may contain wildcards as described in the PATTERNS section in
1577 .Xr ssh_config 5 .
1578 The wildcard
1579 .Sq *
1580 can also be used in place of a port number to allow all ports.
1581 By default all port forwarding listen requests are permitted.
1582 Note that the
1583 .Cm GatewayPorts
1584 option may further restrict which addresses may be listened on.
1585 Note also that
1586 .Xr ssh 1
1587 will request a listen host of
1588 .Dq localhost
1589 if no listen host was specifically requested, and this name is
1590 treated differently to explicit localhost addresses of
1591 .Dq 127.0.0.1
1592 and
1593 .Dq ::1 .
1594 .It Cm PermitOpen
1595 Specifies the destinations to which TCP port forwarding is permitted.
1596 The forwarding specification must be one of the following forms:
1597 .Pp
1598 .Bl -item -offset indent -compact
1599 .It
1600 .Cm PermitOpen
1601 .Sm off
1602 .Ar host : port
1603 .Sm on
1604 .It
1605 .Cm PermitOpen
1606 .Sm off
1607 .Ar IPv4_addr : port
1608 .Sm on
1609 .It
1610 .Cm PermitOpen
1611 .Sm off
1612 .Ar \&[ IPv6_addr \&] : port
1613 .Sm on
1614 .El
1615 .Pp
1616 Multiple forwards may be specified by separating them with whitespace.
1617 An argument of
1618 .Cm any
1619 can be used to remove all restrictions and permit any forwarding requests.
1620 An argument of
1621 .Cm none
1622 can be used to prohibit all forwarding requests.
1623 The wildcard
1624 .Sq *
1625 can be used for host or port to allow all hosts or ports respectively.
1626 Otherwise, no pattern matching or address lookups are performed on supplied
1627 names.
1628 By default all port forwarding requests are permitted.
1629 .It Cm PermitRootLogin
1630 Specifies whether root can log in using
1631 .Xr ssh 1 .
1632 The argument must be
1633 .Cm yes ,
1634 .Cm prohibit-password ,
1635 .Cm forced-commands-only ,
1636 or
1637 .Cm no .
1638 The default is
1639 .Cm prohibit-password .
1640 .Pp
1641 If this option is set to
1642 .Cm prohibit-password
1643 (or its deprecated alias,
1644 .Cm without-password ) ,
1645 password and keyboard-interactive authentication are disabled for root.
1646 .Pp
1647 If this option is set to
1648 .Cm forced-commands-only ,
1649 root login with public key authentication will be allowed,
1650 but only if the
1651 .Ar command
1652 option has been specified
1653 (which may be useful for taking remote backups even if root login is
1654 normally not allowed).
1655 All other authentication methods are disabled for root.
1656 .Pp
1657 If this option is set to
1658 .Cm no ,
1659 root is not allowed to log in.
1660 .It Cm PermitTTY
1661 Specifies whether
1662 .Xr pty 4
1663 allocation is permitted.
1664 The default is
1665 .Cm yes .
1666 .It Cm PermitTunnel
1667 Specifies whether
1668 .Xr tun 4
1669 device forwarding is allowed.
1670 The argument must be
1671 .Cm yes ,
1672 .Cm point-to-point
1673 (layer 3),
1674 .Cm ethernet
1675 (layer 2), or
1676 .Cm no .
1677 Specifying
1678 .Cm yes
1679 permits both
1680 .Cm point-to-point
1681 and
1682 .Cm ethernet .
1683 The default is
1684 .Cm no .
1685 .Pp
1686 Independent of this setting, the permissions of the selected
1687 .Xr tun 4
1688 device must allow access to the user.
1689 .It Cm PermitUserEnvironment
1690 Specifies whether
1691 .Pa ~/.ssh/environment
1692 and
1693 .Cm environment=
1694 options in
1695 .Pa ~/.ssh/authorized_keys
1696 are processed by
1697 .Xr sshd 8 .
1698 Valid options are
1699 .Cm yes ,
1700 .Cm no
1701 or a pattern-list specifying which environment variable names to accept
1702 (for example
1703 .Qq LANG,LC_* ) .
1704 The default is
1705 .Cm no .
1706 Enabling environment processing may enable users to bypass access
1707 restrictions in some configurations using mechanisms such as
1708 .Ev LD_PRELOAD .
1709 .It Cm PermitUserRC
1710 Specifies whether any
1711 .Pa ~/.ssh/rc
1712 file is executed.
1713 The default is
1714 .Cm yes .
1715 .It Cm PerSourceMaxStartups
1716 Specifies the number of unauthenticated connections allowed from a
1717 given source address, or
1718 .Dq none
1719 if there is no limit.
1720 This limit is applied in addition to
1721 .Cm MaxStartups ,
1722 whichever is lower.
1723 The default is
1724 .Cm none .
1725 .It Cm PerSourceNetBlockSize
1726 Specifies the number of bits of source address that are grouped together
1727 for the purposes of applying PerSourceMaxStartups limits.
1728 Values for IPv4 and optionally IPv6 may be specified, separated by a colon.
1729 The default is
1730 .Cm 32:128 ,
1731 which means each address is considered individually.
1732 .It Cm PerSourcePenalties
1733 Controls penalties for various conditions that may represent attacks on
1734 .Xr sshd 8 .
1735 If a penalty is enforced against a client then its source address and any
1736 others in the same network, as defined by
1737 .Cm PerSourceNetBlockSize ,
1738 will be refused connection for a period.
1739 .Pp
1740 A penalty doesn't affect concurrent connections in progress, but multiple
1741 penalties from the same source from concurrent connections will accumulate
1742 up to a maximum.
1743 Conversely, penalties are not applied until a minimum threshold time has been
1744 accumulated.
1745 .Pp
1746 Penalties are enabled by default with the default settings listed below
1747 but may disabled using the
1748 .Cm no
1749 keyword.
1750 The defaults may be overridden by specifying one or more of the keywords below,
1751 separated by whitespace.
1752 All keywords accept arguments, e.g.\&
1753 .Qq crash:2m .
1754 .Bl -tag -width Ds
1755 .It Cm crash:duration
1756 Specifies how long to refuse clients that cause a crash of
1757 .Xr sshd 8 (default: 90s).
1758 .It Cm authfail:duration
1759 Specifies how long to refuse clients that disconnect after making one or more
1760 unsuccessful authentication attempts (default: 5s).
1761 .It Cm invaliduser:duration
1762 Specifies how long to refuse clients that attempt to log in with an invalid
1763 user (default: 5s).
1764 .It Cm refuseconnection:duration
1765 Specifies how long to refuse clients that were administratively prohibited
1766 connection via the
1767 .Cm RefuseConnection
1768 option (default: 10s).
1769 .It Cm noauth:duration
1770 Specifies how long to refuse clients that disconnect without attempting
1771 authentication (default: 1s).
1772 This timeout should be used cautiously otherwise it may penalise legitimate
1773 scanning tools such as
1774 .Xr ssh-keyscan 1 .
1775 .It Cm grace-exceeded:duration
1776 Specifies how long to refuse clients that fail to authenticate after
1777 .Cm LoginGraceTime
1778 (default: 10s).
1779 .It Cm max:duration
1780 Specifies the maximum time a particular source address range will be refused
1781 access for (default: 10m).
1782 Repeated penalties will accumulate up to this maximum.
1783 .It Cm min:duration
1784 Specifies the minimum penalty that must accrue before enforcement begins
1785 (default: 15s).
1786 .It Cm max-sources4:number , max-sources6:number
1787 Specifies the maximum number of client IPv4 and IPv6 address ranges to
1788 track for penalties (default: 65536 for both).
1789 .It Cm overflow:mode
1790 Controls how the server behaves when
1791 .Cm max-sources4
1792 or
1793 .Cm max-sources6
1794 is exceeded.
1795 There are two operating modes:
1796 .Cm deny-all ,
1797 which denies all incoming connections other than those exempted via
1798 .Cm PerSourcePenaltyExemptList
1799 until a penalty expires, and
1800 .Cm permissive ,
1801 which allows new connections by removing existing penalties early
1802 (default: permissive).
1803 Note that client penalties below the
1804 .Cm min
1805 threshold count against the total number of tracked penalties.
1806 IPv4 and IPv6 addresses are tracked separately, so an overflow in one will
1807 not affect the other.
1808 .It Cm overflow6:mode
1809 Allows specifying a different overflow mode for IPv6 addresses.
1810 The default it to use the same overflow mode as was specified for IPv4.
1811 .El
1812 .It Cm PerSourcePenaltyExemptList
1813 Specifies a comma-separated list of addresses to exempt from penalties.
1814 This list may contain wildcards and CIDR address/masklen ranges.
1815 Note that the mask length provided must be consistent with the address -
1816 it is an error to specify a mask length that is too long for the address
1817 or one with bits set in this host portion of the address.
1818 For example, 192.0.2.0/33 and 192.0.2.0/8, respectively.
1819 The default is not to exempt any addresses.
1820 .It Cm PidFile
1821 Specifies the file that contains the process ID of the
1822 SSH daemon, or
1823 .Cm none
1824 to not write one.
1825 The default is
1826 .Pa /var/run/sshd.pid .
1827 .It Cm Port
1828 Specifies the port number that
1829 .Xr sshd 8
1830 listens on.
1831 The default is 22.
1832 Multiple options of this type are permitted.
1833 See also
1834 .Cm ListenAddress .
1835 .It Cm PrintLastLog
1836 Specifies whether
1837 .Xr sshd 8
1838 should print the date and time of the last user login when a user logs
1839 in interactively.
1840 The default is
1841 .Cm yes .
1842 .It Cm PrintMotd
1843 Specifies whether
1844 .Xr sshd 8
1845 should print
1846 .Pa /etc/motd
1847 when a user logs in interactively.
1848 (On some systems it is also printed by the shell,
1849 .Pa /etc/profile ,
1850 or equivalent.)
1851 The default is
1852 .Cm yes .
1853 .It Cm PubkeyAcceptedAlgorithms
1854 The default is handled system-wide by
1855 .Xr crypto-policies 7 .
1856 Information about defaults, how to modify the defaults and how to customize existing policies with sub-policies are present in manual page
1857 .Xr update-crypto-policies 8 .
1858 .Pp
1859 Specifies the signature algorithms that will be accepted for public key
1860 authentication as a list of comma-separated patterns.
1861 Alternately if the specified list begins with a
1862 .Sq +
1863 character, then the specified algorithms will be appended to the built-in
1864 openssh default set instead of replacing them.
1865 If the specified list begins with a
1866 .Sq -
1867 character, then the specified algorithms (including wildcards) will be removed
1868 from the built-in openssh default set instead of replacing them.
1869 If the specified list begins with a
1870 .Sq ^
1871 character, then the specified algorithms will be placed at the head of the
1872 built-in openssh default set.
1873 .Pp
1874 The list of available signature algorithms may also be obtained using
1875 .Qq ssh -Q PubkeyAcceptedAlgorithms .
1876 .It Cm PubkeyAuthOptions
1877 Sets one or more public key authentication options.
1878 The supported keywords are:
1879 .Cm none
1880 (the default; indicating no additional options are enabled),
1881 .Cm touch-required
1882 and
1883 .Cm verify-required .
1884 .Pp
1885 The
1886 .Cm touch-required
1887 option causes public key authentication using a FIDO authenticator algorithm
1888 (i.e.\&
1889 .Cm ecdsa-sk
1890 or
1891 .Cm ed25519-sk )
1892 to always require the signature to attest that a physically present user
1893 explicitly confirmed the authentication (usually by touching the authenticator).
1894 By default,
1895 .Xr sshd 8
1896 requires user presence unless overridden with an authorized_keys option.
1897 The
1898 .Cm touch-required
1899 flag disables this override.
1900 .Pp
1901 The
1902 .Cm verify-required
1903 option requires a FIDO key signature attest that the user was verified,
1904 e.g. via a PIN.
1905 .Pp
1906 Neither the
1907 .Cm touch-required
1908 or
1909 .Cm verify-required
1910 options have any effect for other, non-FIDO, public key types.
1911 .It Cm PubkeyAuthentication
1912 Specifies whether public key authentication is allowed.
1913 The default is
1914 .Cm yes .
1915 .It Cm RefuseConnection
1916 Indicates that
1917 .Xr sshd 8
1918 should unconditionally terminate the connection.
1919 Additionally, a
1920 .Cm refuseconnection
1921 penalty may be recorded against the source of the connection if
1922 .Cm PerSourcePenalties
1923 are enabled.
1924 This option is only really useful in a
1925 .Cm Match
1926 block.
1927 .It Cm RekeyLimit
1928 Specifies the maximum amount of data that may be transmitted or received
1929 before the session key is renegotiated, optionally followed by a maximum
1930 amount of time that may pass before the session key is renegotiated.
1931 The first argument is specified in bytes and may have a suffix of
1932 .Sq K ,
1933 .Sq M ,
1934 or
1935 .Sq G
1936 to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1937 The default is between
1938 .Sq 1G
1939 and
1940 .Sq 4G ,
1941 depending on the cipher.
1942 The optional second value is specified in seconds and may use any of the
1943 units documented in the
1944 .Sx TIME FORMATS
1945 section.
1946 The default value for
1947 .Cm RekeyLimit
1948 is
1949 .Cm default none ,
1950 which means that rekeying is performed after the cipher's default amount
1951 of data has been sent or received and no time based rekeying is done.
1952 .It Cm RequiredRSASize
1953 Specifies the minimum RSA key size (in bits) that
1954 .Xr sshd 8
1955 will accept.
1956 User and host-based authentication keys smaller than this limit will be
1957 refused.
1958 The default is
1959 .Cm 1024
1960 bits.
1961 Note that this limit may only be raised from the default.
1962 .It Cm RevokedKeys
1963 Specifies revoked public keys file, or
1964 .Cm none
1965 to not use one.
1966 Keys listed in this file will be refused for public key authentication.
1967 Note that if this file is not readable, then public key authentication will
1968 be refused for all users.
1969 Keys may be specified as a text file, listing one public key per line, or as
1970 an OpenSSH Key Revocation List (KRL) as generated by
1971 .Xr ssh-keygen 1 .
1972 This file may be consulted for each public key authentication attempt
1973 received by
1974 .Xr sshd 8
1975 and its contents must be consistent at all times, therefore it should only
1976 be atomically replaced and never modified in place while the server is running.
1977 For more information on KRLs, see the KEY REVOCATION LISTS section in
1978 .Xr ssh-keygen 1 .
1979 .It Cm RDomain
1980 Specifies an explicit routing domain that is applied after authentication
1981 has completed.
1982 The user session, as well as any forwarded or listening IP sockets,
1983 will be bound to this
1984 .Xr rdomain 4 .
1985 If the routing domain is set to
1986 .Cm \&%D ,
1987 then the domain in which the incoming connection was received will be applied.
1988 .It Cm SecurityKeyProvider
1989 Specifies a path to a library that will be used when loading
1990 FIDO authenticator-hosted keys, overriding the default of using
1991 the built-in USB HID support.
1992 .It Cm SetEnv
1993 Specifies one or more environment variables to set in child sessions started
1994 by
1995 .Xr sshd 8
1996 as
1997 .Dq NAME=VALUE .
1998 The environment value may be quoted (e.g. if it contains whitespace
1999 characters).
2000 Environment variables set by
2001 .Cm SetEnv
2002 override the default environment and any variables specified by the user
2003 via
2004 .Cm AcceptEnv
2005 or
2006 .Cm PermitUserEnvironment .
2007 .It Cm SshdAuthPath
2008 Overrides the default path to the
2009 .Cm sshd-auth
2010 binary that is invoked to complete user authentication.
2011 The default is
2012 .Pa /usr/libexec/openssh/sshd-auth .
2013 This option is intended for use by tests.
2014 .It Cm SshdSessionPath
2015 Overrides the default path to the
2016 .Cm sshd-session
2017 binary that is invoked to handle each connection.
2018 The default is
2019 .Pa /usr/libexec/openssh/sshd-session .
2020 This option is intended for use by tests.
2021 .It Cm StreamLocalBindMask
2022 Sets the octal file creation mode mask
2023 .Pq umask
2024 used when creating a Unix-domain socket file for local or remote
2025 port forwarding.
2026 This option is only used for port forwarding to a Unix-domain socket file.
2027 .Pp
2028 The default value is 0177, which creates a Unix-domain socket file that is
2029 readable and writable only by the owner.
2030 Note that not all operating systems honor the file mode on Unix-domain
2031 socket files.
2032 .It Cm StreamLocalBindUnlink
2033 Specifies whether to remove an existing Unix-domain socket file for local
2034 or remote port forwarding before creating a new one.
2035 If the socket file already exists and
2036 .Cm StreamLocalBindUnlink
2037 is not enabled,
2038 .Nm sshd
2039 will be unable to forward the port to the Unix-domain socket file.
2040 This option is only used for port forwarding to a Unix-domain socket file.
2041 .Pp
2042 The argument must be
2043 .Cm yes
2044 or
2045 .Cm no .
2046 The default is
2047 .Cm no .
2048 .It Cm StrictModes
2049 Specifies whether
2050 .Xr sshd 8
2051 should check file modes and ownership of the
2052 user's files and home directory before accepting login.
2053 This is normally desirable because novices sometimes accidentally leave their
2054 directory or files world-writable.
2055 The default is
2056 .Cm yes .
2057 Note that this does not apply to
2058 .Cm ChrootDirectory ,
2059 whose permissions and ownership are checked unconditionally.
2060 .It Cm Subsystem
2061 Configures an external subsystem (e.g. file transfer daemon).
2062 Arguments should be a subsystem name and a command (with optional arguments)
2063 to execute upon subsystem request.
2064 .Pp
2065 The command
2066 .Cm sftp-server
2067 implements the SFTP file transfer subsystem.
2068 .Pp
2069 Alternately the name
2070 .Cm internal-sftp
2071 implements an in-process SFTP server.
2072 This may simplify configurations using
2073 .Cm ChrootDirectory
2074 to force a different filesystem root on clients.
2075 It accepts the same command line arguments as
2076 .Cm sftp-server
2077 and even though it is in-process, settings such as
2078 .Cm LogLevel
2079 or
2080 .Cm SyslogFacility
2081 do not apply to it and must be set explicitly via
2082 command line arguments.
2083 .Pp
2084 By default no subsystems are defined.
2085 .It Cm SyslogFacility
2086 Gives the facility code that is used when logging messages from
2087 .Xr sshd 8 .
2088 The possible values are: DAEMON, USER, AUTH, AUTHPRIV, LOCAL0, LOCAL1, LOCAL2,
2089 LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
2090 The default is AUTH.
2091 .It Cm TCPKeepAlive
2092 Specifies whether the system should send TCP keepalive messages to the
2093 other side.
2094 If they are sent, death of the connection or crash of one
2095 of the machines will be properly noticed.
2096 However, this means that
2097 connections will die if the route is down temporarily, and some people
2098 find it annoying.
2099 On the other hand, if TCP keepalives are not sent,
2100 sessions may hang indefinitely on the server, leaving
2101 .Qq ghost
2102 users and consuming server resources.
2103 .Pp
2104 The default is
2105 .Cm yes
2106 (to send TCP keepalive messages), and the server will notice
2107 if the network goes down or the client host crashes.
2108 This avoids infinitely hanging sessions.
2109 .Pp
2110 To disable TCP keepalive messages, the value should be set to
2111 .Cm no .
2112 .It Cm TrustedUserCAKeys
2113 Specifies a file containing public keys of certificate authorities that are
2114 trusted to sign user certificates for authentication, or
2115 .Cm none
2116 to not use one.
2117 Keys are listed one per line; empty lines and comments starting with
2118 .Ql #
2119 are allowed.
2120 If a certificate is presented for authentication and has its signing CA key
2121 listed in this file, then it may be used for authentication for any user
2122 listed in the certificate's principals list.
2123 Note that certificates that lack a list of principals will not be permitted
2124 for authentication using
2125 .Cm TrustedUserCAKeys .
2126 For more details on certificates, see the CERTIFICATES section in
2127 .Xr ssh-keygen 1 .
2128 .It Cm UnusedConnectionTimeout
2129 Specifies whether and how quickly
2130 .Xr sshd 8
2131 should close client connections with no open channels.
2132 Open channels include active shell, command execution or subsystem
2133 sessions, connected network, socket, agent or X11 forwardings.
2134 Forwarding listeners, such as those from the
2135 .Xr ssh 1
2136 .Fl R
2137 flag, are not considered as open channels and do not prevent the timeout.
2138 The timeout value
2139 is specified in seconds or may use any of the units documented in the
2140 .Sx TIME FORMATS
2141 section.
2142 .Pp
2143 Note that this timeout starts when the client connection completes
2144 user authentication but before the client has an opportunity to open any
2145 channels.
2146 Caution should be used when using short timeout values, as they may not
2147 provide sufficient time for the client to request and open its channels
2148 before terminating the connection.
2149 .Pp
2150 The default
2151 .Cm none
2152 is to never expire connections for having no open channels.
2153 This option may be useful in conjunction with
2154 .Cm ChannelTimeout .
2155 .It Cm UseDNS
2156 Specifies whether
2157 .Xr sshd 8
2158 should look up the remote host name, and to check that
2159 the resolved host name for the remote IP address maps back to the
2160 very same IP address.
2161 .Pp
2162 If this option is set to
2163 .Cm no
2164 (the default) then only addresses and not host names may be used in
2165 .Pa ~/.ssh/authorized_keys
2166 .Cm from
2167 and
2168 .Nm
2169 .Cm Match
2170 .Cm Host
2171 directives.
2172 .It Cm UsePAM
2173 Enables the Pluggable Authentication Module interface.
2174 If set to
2175 .Cm yes
2176 this will enable PAM authentication using
2177 .Cm KbdInteractiveAuthentication
2178 and
2179 .Cm PasswordAuthentication
2180 in addition to PAM account and session module processing for all
2181 authentication types.
2182 .Pp
2183 Because PAM keyboard-interactive authentication usually serves an equivalent
2184 role to password authentication, you should disable either
2185 .Cm PasswordAuthentication
2186 or
2187 .Cm KbdInteractiveAuthentication .
2188 .Pp
2189 If
2190 .Cm UsePAM
2191 is enabled, you will not be able to run
2192 .Xr sshd 8
2193 as a non-root user.
2194 The default is
2195 .Cm no .
2196 .It Cm VersionAddendum
2197 Optionally specifies additional text to append to the SSH protocol banner
2198 sent by the server upon connection.
2199 The default is
2200 .Cm none .
2201 .It Cm X11DisplayOffset
2202 Specifies the first display number available for
2203 .Xr sshd 8 Ns 's
2204 X11 forwarding.
2205 This prevents sshd from interfering with real X11 servers.
2206 The default is 10.
2207 .It Cm X11MaxDisplays
2208 Specifies the maximum number of displays available for
2209 .Xr sshd 8 Ns 's
2210 X11 forwarding.
2211 This prevents sshd from exhausting local ports.
2212 The default is 1000.
2213 .It Cm X11Forwarding
2214 Specifies whether X11 forwarding is permitted.
2215 The argument must be
2216 .Cm yes
2217 or
2218 .Cm no .
2219 The default is
2220 .Cm no .
2221 .Pp
2222 When X11 forwarding is enabled, there may be additional exposure to
2223 the server and to client displays if the
2224 .Xr sshd 8
2225 proxy display is configured to listen on the wildcard address (see
2226 .Cm X11UseLocalhost ) ,
2227 though this is not the default.
2228 Additionally, the authentication spoofing and authentication data
2229 verification and substitution occur on the client side.
2230 The security risk of using X11 forwarding is that the client's X11
2231 display server may be exposed to attack when the SSH client requests
2232 forwarding (see the warnings for
2233 .Cm ForwardX11
2234 in
2235 .Xr ssh_config 5 ) .
2236 A system administrator may have a stance in which they want to
2237 protect clients that may expose themselves to attack by unwittingly
2238 requesting X11 forwarding, which can warrant a
2239 .Cm no
2240 setting.
2241 .Pp
2242 Note that disabling X11 forwarding does not prevent users from
2243 forwarding X11 traffic, as users can always install their own forwarders.
2244 .It Cm X11UseLocalhost
2245 Specifies whether
2246 .Xr sshd 8
2247 should bind the X11 forwarding server to the loopback address or to
2248 the wildcard address.
2249 By default,
2250 sshd binds the forwarding server to the loopback address and sets the
2251 hostname part of the
2252 .Ev DISPLAY
2253 environment variable to
2254 .Cm localhost .
2255 This prevents remote hosts from connecting to the proxy display.
2256 However, some older X11 clients may not function with this
2257 configuration.
2258 .Cm X11UseLocalhost
2259 may be set to
2260 .Cm no
2261 to specify that the forwarding server should be bound to the wildcard
2262 address.
2263 The argument must be
2264 .Cm yes
2265 or
2266 .Cm no .
2267 The default is
2268 .Cm yes .
2269 .It Cm XAuthLocation
2270 Specifies the full pathname of the
2271 .Xr xauth 1
2272 program, or
2273 .Cm none
2274 to not use one.
2275 The default is
2276 .Pa /usr/bin/xauth .
2277 .El
2278 .Sh TIME FORMATS
2279 .Xr sshd 8
2280 command-line arguments and configuration file options that specify time
2281 may be expressed using a sequence of the form:
2282 .Sm off
2283 .Ar time Op Ar qualifier ,
2284 .Sm on
2285 where
2286 .Ar time
2287 is a positive integer value and
2288 .Ar qualifier
2289 is one of the following:
2290 .Pp
2291 .Bl -tag -width Ds -compact -offset indent
2292 .It Aq Cm none
2293 seconds
2294 .It Cm s | Cm S
2295 seconds
2296 .It Cm m | Cm M
2297 minutes
2298 .It Cm h | Cm H
2299 hours
2300 .It Cm d | Cm D
2301 days
2302 .It Cm w | Cm W
2303 weeks
2304 .El
2305 .Pp
2306 Each member of the sequence is added together to calculate
2307 the total time value.
2308 .Pp
2309 Time format examples:
2310 .Pp
2311 .Bl -tag -width Ds -compact -offset indent
2312 .It 600
2313 600 seconds (10 minutes)
2314 .It 10m
2315 10 minutes
2316 .It 1h30m
2317 1 hour 30 minutes (90 minutes)
2318 .El
2319 .Sh TOKENS
2320 Arguments to some keywords can make use of tokens,
2321 which are expanded at runtime.
2322 Tokens are expanded without quoting or escaping of shell characters.
2323 It is the administrator's responsibility to ensure they are safe in the
2324 context of their use.
2325 .Pp
2326 The supported tokens in
2327 .Nm
2328 are:
2329 .Pp
2330 .Bl -tag -width XXXX -offset indent -compact
2331 .It %%
2332 A literal
2333 .Sq % .
2334 .It \&%C
2335 Identifies the connection endpoints, containing
2336 four space-separated values: client address, client port number,
2337 server address, and server port number.
2338 .It \&%D
2339 The routing domain in which the incoming connection was received.
2340 .It %F
2341 The fingerprint of the CA key.
2342 .It %f
2343 The fingerprint of the key or certificate.
2344 .It %h
2345 The home directory of the user.
2346 .It %i
2347 The key ID in the certificate.
2348 .It %K
2349 The base64-encoded CA key.
2350 .It %k
2351 The base64-encoded key or certificate for authentication.
2352 .It %s
2353 The serial number of the certificate.
2354 .It \&%T
2355 The type of the CA key.
2356 .It %t
2357 The key or certificate type.
2358 .It \&%U
2359 The numeric user ID of the target user.
2360 .It %u
2361 The username.
2362 .El
2363 .Pp
2364 .Cm AuthorizedKeysCommand
2365 accepts the tokens %%, %C, %D, %f, %h, %k, %t, %U, and %u.
2366 .Pp
2367 .Cm AuthorizedKeysFile
2368 accepts the tokens %%, %h, %U, and %u.
2369 .Pp
2370 .Cm AuthorizedPrincipalsCommand
2371 accepts the tokens %%, %C, %D, %F, %f, %h, %i, %K, %k, %s, %T, %t, %U, and %u.
2372 .Pp
2373 .Cm AuthorizedPrincipalsFile
2374 accepts the tokens %%, %h, %U, and %u.
2375 .Pp
2376 .Cm ChrootDirectory
2377 accepts the tokens %%, %h, %U, and %u.
2378 .Pp
2379 .Cm RoutingDomain
2380 accepts the token %D.
2381 .Sh FILES
2382 .Bl -tag -width Ds
2383 .It Pa /etc/ssh/sshd_config
2384 Contains configuration data for
2385 .Xr sshd 8 .
2386 This file should be writable by root only, but it is recommended
2387 (though not necessary) that it be world-readable.
2388 .El
2389 .Sh SEE ALSO
2390 .Xr sftp-server 8 ,
2391 .Xr sshd 8 ,
2392 .Xr crypto-policies 7 ,
2393 .Xr update-crypto-policies 8
2394 .Sh AUTHORS
2395 .An -nosplit
2396 OpenSSH is a derivative of the original and free
2397 ssh 1.2.12 release by
2398 .An Tatu Ylonen .
2399 .An Aaron Campbell , Bob Beck , Markus Friedl , Niels Provos ,
2400 .An Theo de Raadt
2401 and
2402 .An Dug Song
2403 removed many bugs, re-added newer features and
2404 created OpenSSH.
2405 .An Markus Friedl
2406 contributed the support for SSH protocol versions 1.5 and 2.0.
2407 .An Niels Provos
2408 and
2409 .An Markus Friedl
2410 contributed support for privilege separation.