[BACK]Return to sshd_config.5 CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Annotation of src/usr.bin/ssh/sshd_config.5, Revision 1.329

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