Debian Codegraph @

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