logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

sshd_config.5 (64993B)


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