[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.185

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.185   ! djm        36: .\" $OpenBSD: sshd_config.5,v 1.184 2014/12/21 23:35:14 jmc Exp $
1.184     jmc        37: .Dd $Mdocdate: December 21 2014 $
1.1       stevesk    38: .Dt SSHD_CONFIG 5
                     39: .Os
                     40: .Sh NAME
                     41: .Nm sshd_config
                     42: .Nd OpenSSH SSH daemon configuration file
                     43: .Sh SYNOPSIS
1.71      jmc        44: .Nm /etc/ssh/sshd_config
1.1       stevesk    45: .Sh DESCRIPTION
1.53      jmc        46: .Xr sshd 8
1.1       stevesk    47: reads configuration data from
                     48: .Pa /etc/ssh/sshd_config
                     49: (or the file specified with
                     50: .Fl f
                     51: on the command line).
                     52: The file contains keyword-argument pairs, one per line.
                     53: Lines starting with
                     54: .Ql #
                     55: and empty lines are interpreted as comments.
1.56      dtucker    56: Arguments may optionally be enclosed in double quotes
                     57: .Pq \&"
                     58: in order to represent arguments containing spaces.
1.1       stevesk    59: .Pp
                     60: The possible
                     61: keywords and their meanings are as follows (note that
                     62: keywords are case-insensitive and arguments are case-sensitive):
                     63: .Bl -tag -width Ds
1.30      djm        64: .It Cm AcceptEnv
                     65: Specifies what environment variables sent by the client will be copied into
                     66: the session's
                     67: .Xr environ 7 .
                     68: See
                     69: .Cm SendEnv
                     70: in
                     71: .Xr ssh_config 5
                     72: for how to configure the client.
1.31      djm        73: Note that environment passing is only supported for protocol 2.
1.30      djm        74: Variables are specified by name, which may contain the wildcard characters
1.51      jmc        75: .Ql *
1.30      djm        76: and
                     77: .Ql \&? .
1.31      djm        78: Multiple environment variables may be separated by whitespace or spread
1.30      djm        79: across multiple
                     80: .Cm AcceptEnv
                     81: directives.
1.31      djm        82: Be warned that some environment variables could be used to bypass restricted
1.30      djm        83: user environments.
                     84: For this reason, care should be taken in the use of this directive.
                     85: The default is not to accept any environment variables.
1.37      djm        86: .It Cm AddressFamily
                     87: Specifies which address family should be used by
1.53      jmc        88: .Xr sshd 8 .
1.37      djm        89: Valid arguments are
                     90: .Dq any ,
                     91: .Dq inet
1.52      jmc        92: (use IPv4 only), or
1.37      djm        93: .Dq inet6
                     94: (use IPv6 only).
                     95: The default is
                     96: .Dq any .
1.89      jmc        97: .It Cm AllowAgentForwarding
                     98: Specifies whether
                     99: .Xr ssh-agent 1
                    100: forwarding is permitted.
                    101: The default is
                    102: .Dq yes .
                    103: Note that disabling agent forwarding does not improve security
                    104: unless users are also denied shell access, as they can always install
                    105: their own forwarders.
1.1       stevesk   106: .It Cm AllowGroups
                    107: This keyword can be followed by a list of group name patterns, separated
                    108: by spaces.
                    109: If specified, login is allowed only for users whose primary
                    110: group or supplementary group list matches one of the patterns.
                    111: Only group names are valid; a numerical group ID is not recognized.
                    112: By default, login is allowed for all groups.
1.54      jmc       113: The allow/deny directives are processed in the following order:
                    114: .Cm DenyUsers ,
                    115: .Cm AllowUsers ,
                    116: .Cm DenyGroups ,
                    117: and finally
                    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.1       stevesk   123: .It Cm AllowTcpForwarding
                    124: Specifies whether TCP forwarding is permitted.
1.150     djm       125: The available options are
                    126: .Dq yes
                    127: or
                    128: .Dq all
                    129: to allow TCP forwarding,
                    130: .Dq no
                    131: to prevent all TCP forwarding,
                    132: .Dq local
                    133: to allow local (from the perspective of
1.151     jmc       134: .Xr ssh 1 )
                    135: forwarding only or
1.150     djm       136: .Dq remote
                    137: to allow remote forwarding only.
1.1       stevesk   138: The default is
                    139: .Dq yes .
                    140: Note that disabling TCP forwarding does not improve security unless
                    141: users are also denied shell access, as they can always install their
                    142: own forwarders.
1.175     millert   143: .It Cm AllowStreamLocalForwarding
                    144: Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
                    145: The available options are
                    146: .Dq yes
                    147: or
                    148: .Dq all
                    149: to allow StreamLocal forwarding,
                    150: .Dq no
                    151: to prevent all StreamLocal forwarding,
                    152: .Dq local
                    153: to allow local (from the perspective of
                    154: .Xr ssh 1 )
                    155: forwarding only or
                    156: .Dq remote
                    157: to allow remote forwarding only.
                    158: The default is
                    159: .Dq yes .
                    160: Note that disabling StreamLocal forwarding does not improve security unless
                    161: users are also denied shell access, as they can always install their
                    162: own forwarders.
1.1       stevesk   163: .It Cm AllowUsers
                    164: This keyword can be followed by a list of user name patterns, separated
                    165: by spaces.
1.14      jmc       166: If specified, login is allowed only for user names that
1.1       stevesk   167: match one of the patterns.
                    168: Only user names are valid; a numerical user ID is not recognized.
                    169: By default, login is allowed for all users.
                    170: If the pattern takes the form USER@HOST then USER and HOST
                    171: are separately checked, restricting logins to particular
                    172: users from particular hosts.
1.54      jmc       173: The allow/deny directives are processed in the following order:
                    174: .Cm DenyUsers ,
                    175: .Cm AllowUsers ,
                    176: .Cm DenyGroups ,
                    177: and finally
                    178: .Cm AllowGroups .
1.49      jmc       179: .Pp
1.161     jmc       180: See PATTERNS in
1.49      jmc       181: .Xr ssh_config 5
                    182: for more information on patterns.
1.149     djm       183: .It Cm AuthenticationMethods
                    184: Specifies the authentication methods that must be successfully completed
                    185: for a user to be granted access.
                    186: This option must be followed by one or more comma-separated lists of
                    187: authentication method names.
                    188: Successful authentication requires completion of every method in at least
                    189: one of these lists.
                    190: .Pp
                    191: For example, an argument of
                    192: .Dq publickey,password publickey,keyboard-interactive
                    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,
                    196: so for this example, it would not be possible to attempt password or
                    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
                    202: .Dq bsdauth ,
                    203: .Dq pam ,
                    204: or
                    205: .Dq skey ,
                    206: depending on the server configuration.
                    207: For example,
                    208: .Dq keyboard-interactive:bsdauth
                    209: would restrict keyboard interactive authentication to the
                    210: .Dq bsdauth
                    211: device.
1.185   ! djm       212: .Pp
        !           213: If the
        !           214: .Dq publickey
        !           215: method is listed more than one,
        !           216: .Xr sshd 8
        !           217: verifies that keys that have been used successfully are not reused for
        !           218: subsequent authentications.
        !           219: For example, an
        !           220: .Cm AuthenticationMethods
        !           221: of
        !           222: .Dq publickey,publickey
        !           223: will require successful authentication using two different public keys.
1.181     djm       224: .Pp
1.149     djm       225: This option is only available for SSH protocol 2 and will yield a fatal
                    226: error if enabled if protocol 1 is also enabled.
                    227: Note that each authentication method listed should also be explicitly enabled
                    228: in the configuration.
                    229: The default is not to require multiple authentication; successful completion
                    230: of a single authentication method is sufficient.
1.146     djm       231: .It Cm AuthorizedKeysCommand
1.147     jmc       232: Specifies a program to be used to look up the user's public keys.
1.158     djm       233: The program must be owned by root and not writable by group or others.
                    234: It will be invoked with a single argument of the username
1.146     djm       235: being authenticated, and should produce on standard output zero or
1.161     jmc       236: more lines of authorized_keys output (see AUTHORIZED_KEYS in
1.147     jmc       237: .Xr sshd 8 ) .
1.146     djm       238: If a key supplied by AuthorizedKeysCommand does not successfully authenticate
                    239: and authorize the user then public key authentication continues using the usual
                    240: .Cm AuthorizedKeysFile
                    241: files.
                    242: By default, no AuthorizedKeysCommand is run.
                    243: .It Cm AuthorizedKeysCommandUser
                    244: Specifies the user under whose account the AuthorizedKeysCommand is run.
                    245: It is recommended to use a dedicated user that has no other role on the host
                    246: than running authorized keys commands.
1.181     djm       247: If no user is specified then
                    248: .Cm AuthorizedKeysCommand
                    249: is ignored.
1.1       stevesk   250: .It Cm AuthorizedKeysFile
                    251: Specifies the file that contains the public keys that can be used
                    252: for user authentication.
1.124     djm       253: The format is described in the
1.161     jmc       254: AUTHORIZED_KEYS FILE FORMAT
1.124     djm       255: section of
                    256: .Xr sshd 8 .
1.1       stevesk   257: .Cm AuthorizedKeysFile
                    258: may contain tokens of the form %T which are substituted during connection
1.52      jmc       259: setup.
1.17      jmc       260: The following tokens are defined: %% is replaced by a literal '%',
1.52      jmc       261: %h is replaced by the home directory of the user being authenticated, and
1.1       stevesk   262: %u is replaced by the username of that user.
                    263: After expansion,
                    264: .Cm AuthorizedKeysFile
                    265: is taken to be an absolute path or one relative to the user's home
                    266: directory.
1.133     jmc       267: Multiple files may be listed, separated by whitespace.
                    268: The default is
                    269: .Dq .ssh/authorized_keys .ssh/authorized_keys2 .
1.121     djm       270: .It Cm AuthorizedPrincipalsFile
                    271: Specifies a file that lists principal names that are accepted for
                    272: certificate authentication.
                    273: When using certificates signed by a key listed in
                    274: .Cm TrustedUserCAKeys ,
                    275: this file lists names, one of which must appear in the certificate for it
                    276: to be accepted for authentication.
1.125     jmc       277: Names are listed one per line preceded by key options (as described
1.161     jmc       278: in AUTHORIZED_KEYS FILE FORMAT in
1.125     jmc       279: .Xr sshd 8 ) .
1.124     djm       280: Empty lines and comments starting with
1.121     djm       281: .Ql #
                    282: are ignored.
                    283: .Pp
                    284: .Cm AuthorizedPrincipalsFile
                    285: may contain tokens of the form %T which are substituted during connection
                    286: setup.
                    287: The following tokens are defined: %% is replaced by a literal '%',
                    288: %h is replaced by the home directory of the user being authenticated, and
                    289: %u is replaced by the username of that user.
                    290: After expansion,
                    291: .Cm AuthorizedPrincipalsFile
                    292: is taken to be an absolute path or one relative to the user's home
                    293: directory.
                    294: .Pp
1.138     djm       295: The default is
                    296: .Dq none ,
                    297: i.e. not to use a principals file \(en in this case, the username
1.121     djm       298: of the user must appear in a certificate's principals list for it to be
                    299: accepted.
                    300: Note that
                    301: .Cm AuthorizedPrincipalsFile
                    302: is only used when authentication proceeds using a CA listed in
                    303: .Cm TrustedUserCAKeys
                    304: and is not consulted for certification authorities trusted via
                    305: .Pa ~/.ssh/authorized_keys ,
                    306: though the
                    307: .Cm principals=
                    308: key option offers a similar facility (see
                    309: .Xr sshd 8
                    310: for details).
1.1       stevesk   311: .It Cm Banner
                    312: The contents of the specified file are sent to the remote user before
                    313: authentication is allowed.
1.78      djm       314: If the argument is
                    315: .Dq none
                    316: then no banner is displayed.
1.1       stevesk   317: This option is only available for protocol version 2.
                    318: By default, no banner is displayed.
                    319: .It Cm ChallengeResponseAuthentication
1.50      jmc       320: Specifies whether challenge-response authentication is allowed.
1.1       stevesk   321: All authentication styles from
                    322: .Xr login.conf 5
                    323: are supported.
                    324: The default is
                    325: .Dq yes .
1.80      djm       326: .It Cm ChrootDirectory
1.113     stevesk   327: Specifies the pathname of a directory to
1.80      djm       328: .Xr chroot 2
                    329: to after authentication.
1.113     stevesk   330: All components of the pathname must be root-owned directories that are
1.80      djm       331: not writable by any other user or group.
1.106     stevesk   332: After the chroot,
                    333: .Xr sshd 8
                    334: changes the working directory to the user's home directory.
1.80      djm       335: .Pp
1.113     stevesk   336: The pathname may contain the following tokens that are expanded at runtime once
1.80      djm       337: the connecting user has been authenticated: %% is replaced by a literal '%',
                    338: %h is replaced by the home directory of the user being authenticated, and
                    339: %u is replaced by the username of that user.
                    340: .Pp
                    341: The
                    342: .Cm ChrootDirectory
                    343: must contain the necessary files and directories to support the
1.103     stevesk   344: user's session.
1.80      djm       345: For an interactive session this requires at least a shell, typically
                    346: .Xr sh 1 ,
                    347: and basic
                    348: .Pa /dev
                    349: nodes such as
                    350: .Xr null 4 ,
                    351: .Xr zero 4 ,
                    352: .Xr stdin 4 ,
                    353: .Xr stdout 4 ,
                    354: .Xr stderr 4 ,
1.180     jmc       355: and
1.80      djm       356: .Xr tty 4
                    357: devices.
                    358: For file transfer sessions using
1.105     jmc       359: .Dq sftp ,
1.80      djm       360: no additional configuration of the environment is necessary if the
1.105     jmc       361: in-process sftp server is used,
1.176     schwarze  362: though sessions which use logging may require
1.104     stevesk   363: .Pa /dev/log
1.176     schwarze  364: inside the chroot directory on some operating systems (see
1.104     stevesk   365: .Xr sftp-server 8
1.81      jmc       366: for details).
1.80      djm       367: .Pp
                    368: The default is not to
                    369: .Xr chroot 2 .
1.1       stevesk   370: .It Cm Ciphers
                    371: Specifies the ciphers allowed for protocol version 2.
                    372: Multiple ciphers must be comma-separated.
1.167     djm       373: The supported ciphers are:
                    374: .Pp
1.173     naddy     375: .Bl -item -compact -offset indent
                    376: .It
                    377: 3des-cbc
                    378: .It
                    379: aes128-cbc
                    380: .It
                    381: aes192-cbc
                    382: .It
                    383: aes256-cbc
                    384: .It
                    385: aes128-ctr
                    386: .It
                    387: aes192-ctr
                    388: .It
                    389: aes256-ctr
                    390: .It
                    391: aes128-gcm@openssh.com
                    392: .It
                    393: aes256-gcm@openssh.com
                    394: .It
                    395: arcfour
                    396: .It
                    397: arcfour128
                    398: .It
                    399: arcfour256
                    400: .It
                    401: blowfish-cbc
                    402: .It
                    403: cast128-cbc
                    404: .It
                    405: chacha20-poly1305@openssh.com
                    406: .El
1.167     djm       407: .Pp
1.52      jmc       408: The default is:
1.173     naddy     409: .Bd -literal -offset indent
                    410: aes128-ctr,aes192-ctr,aes256-ctr,
1.153     markus    411: aes128-gcm@openssh.com,aes256-gcm@openssh.com,
1.173     naddy     412: chacha20-poly1305@openssh.com
1.1       stevesk   413: .Ed
1.167     djm       414: .Pp
                    415: The list of available ciphers may also be obtained using the
                    416: .Fl Q
                    417: option of
                    418: .Xr ssh 1 .
1.1       stevesk   419: .It Cm ClientAliveCountMax
1.48      jmc       420: Sets the number of client alive messages (see below) which may be
1.1       stevesk   421: sent without
1.52      jmc       422: .Xr sshd 8
1.17      jmc       423: receiving any messages back from the client.
                    424: If this threshold is reached while client alive messages are being sent,
1.52      jmc       425: sshd will disconnect the client, terminating the session.
1.17      jmc       426: It is important to note that the use of client alive messages is very
                    427: different from
1.27      markus    428: .Cm TCPKeepAlive
1.17      jmc       429: (below).
                    430: The client alive messages are sent through the encrypted channel
                    431: and therefore will not be spoofable.
                    432: The TCP keepalive option enabled by
1.27      markus    433: .Cm TCPKeepAlive
1.17      jmc       434: is spoofable.
                    435: The client alive mechanism is valuable when the client or
1.1       stevesk   436: server depend on knowing when a connection has become inactive.
                    437: .Pp
1.17      jmc       438: The default value is 3.
                    439: If
1.1       stevesk   440: .Cm ClientAliveInterval
1.48      jmc       441: (see below) is set to 15, and
1.1       stevesk   442: .Cm ClientAliveCountMax
1.52      jmc       443: is left at the default, unresponsive SSH clients
1.1       stevesk   444: will be disconnected after approximately 45 seconds.
1.57      markus    445: This option applies to protocol version 2 only.
1.42      djm       446: .It Cm ClientAliveInterval
                    447: Sets a timeout interval in seconds after which if no data has been received
                    448: from the client,
1.52      jmc       449: .Xr sshd 8
1.42      djm       450: will send a message through the encrypted
                    451: channel to request a response from the client.
                    452: The default
                    453: is 0, indicating that these messages will not be sent to the client.
                    454: This option applies to protocol version 2 only.
1.3       markus    455: .It Cm Compression
1.44      markus    456: Specifies whether compression is allowed, or delayed until
                    457: the user has authenticated successfully.
1.3       markus    458: The argument must be
1.44      markus    459: .Dq yes ,
                    460: .Dq delayed ,
1.3       markus    461: or
                    462: .Dq no .
                    463: The default is
1.44      markus    464: .Dq delayed .
1.1       stevesk   465: .It Cm DenyGroups
                    466: This keyword can be followed by a list of group name patterns, separated
                    467: by spaces.
                    468: Login is disallowed for users whose primary group or supplementary
                    469: group list matches one of the patterns.
                    470: Only group names are valid; a numerical group ID is not recognized.
                    471: By default, login is allowed for all groups.
1.54      jmc       472: The allow/deny directives are processed in the following order:
                    473: .Cm DenyUsers ,
                    474: .Cm AllowUsers ,
                    475: .Cm DenyGroups ,
                    476: and finally
                    477: .Cm AllowGroups .
1.49      jmc       478: .Pp
1.161     jmc       479: See PATTERNS in
1.49      jmc       480: .Xr ssh_config 5
                    481: for more information on patterns.
1.1       stevesk   482: .It Cm DenyUsers
                    483: This keyword can be followed by a list of user name patterns, separated
                    484: by spaces.
                    485: Login is disallowed for user names that match one of the patterns.
                    486: Only user names are valid; a numerical user ID is not recognized.
                    487: By default, login is allowed for all users.
                    488: If the pattern takes the form USER@HOST then USER and HOST
                    489: are separately checked, restricting logins to particular
                    490: users from particular hosts.
1.54      jmc       491: The allow/deny directives are processed in the following order:
                    492: .Cm DenyUsers ,
                    493: .Cm AllowUsers ,
                    494: .Cm DenyGroups ,
                    495: and finally
                    496: .Cm AllowGroups .
1.49      jmc       497: .Pp
1.161     jmc       498: See PATTERNS in
1.49      jmc       499: .Xr ssh_config 5
                    500: for more information on patterns.
1.183     djm       501: .It Cm FingerprintHash
                    502: Specifies the hash algorithm used when logging key fingerprints.
                    503: Valid options are:
                    504: .Dq md5
                    505: and
                    506: .Dq sha256 .
                    507: The default is
                    508: .Dq sha256 .
1.67      dtucker   509: .It Cm ForceCommand
                    510: Forces the execution of the command specified by
                    511: .Cm ForceCommand ,
1.84      djm       512: ignoring any command supplied by the client and
                    513: .Pa ~/.ssh/rc
                    514: if present.
1.67      dtucker   515: The command is invoked by using the user's login shell with the -c option.
                    516: This applies to shell, command, or subsystem execution.
                    517: It is most useful inside a
                    518: .Cm Match
                    519: block.
                    520: The command originally supplied by the client is available in the
                    521: .Ev SSH_ORIGINAL_COMMAND
                    522: environment variable.
1.82      djm       523: Specifying a command of
                    524: .Dq internal-sftp
                    525: will force the use of an in-process sftp server that requires no support
                    526: files when used with
                    527: .Cm ChrootDirectory .
1.1       stevesk   528: .It Cm GatewayPorts
                    529: Specifies whether remote hosts are allowed to connect to ports
                    530: forwarded for the client.
                    531: By default,
1.52      jmc       532: .Xr sshd 8
1.15      jmc       533: binds remote port forwardings to the loopback address.
                    534: This prevents other remote hosts from connecting to forwarded ports.
1.1       stevesk   535: .Cm GatewayPorts
1.52      jmc       536: can be used to specify that sshd
1.39      djm       537: should allow remote port forwardings to bind to non-loopback addresses, thus
                    538: allowing other hosts to connect.
                    539: The argument may be
                    540: .Dq no
                    541: to force remote port forwardings to be available to the local host only,
1.1       stevesk   542: .Dq yes
1.39      djm       543: to force remote port forwardings to bind to the wildcard address, or
                    544: .Dq clientspecified
                    545: to allow the client to select the address to which the forwarding is bound.
1.1       stevesk   546: The default is
                    547: .Dq no .
1.23      markus    548: .It Cm GSSAPIAuthentication
1.25      markus    549: Specifies whether user authentication based on GSSAPI is allowed.
1.26      djm       550: The default is
1.23      markus    551: .Dq no .
                    552: Note that this option applies to protocol version 2 only.
                    553: .It Cm GSSAPICleanupCredentials
                    554: Specifies whether to automatically destroy the user's credentials cache
                    555: on logout.
                    556: The default is
                    557: .Dq yes .
                    558: Note that this option applies to protocol version 2 only.
1.1       stevesk   559: .It Cm HostbasedAuthentication
                    560: Specifies whether rhosts or /etc/hosts.equiv authentication together
                    561: with successful public key client host authentication is allowed
1.50      jmc       562: (host-based authentication).
1.1       stevesk   563: This option is similar to
                    564: .Cm RhostsRSAAuthentication
                    565: and applies to protocol version 2 only.
1.70      dtucker   566: The default is
                    567: .Dq no .
                    568: .It Cm HostbasedUsesNameFromPacketOnly
                    569: Specifies whether or not the server will attempt to perform a reverse
                    570: name lookup when matching the name in the
                    571: .Pa ~/.shosts ,
                    572: .Pa ~/.rhosts ,
                    573: and
                    574: .Pa /etc/hosts.equiv
                    575: files during
                    576: .Cm HostbasedAuthentication .
                    577: A setting of
                    578: .Dq yes
                    579: means that
                    580: .Xr sshd 8
                    581: uses the name supplied by the client rather than
                    582: attempting to resolve the name from the TCP connection itself.
1.1       stevesk   583: The default is
                    584: .Dq no .
1.117     djm       585: .It Cm HostCertificate
                    586: Specifies a file containing a public host certificate.
                    587: The certificate's public key must match a private host key already specified
                    588: by
                    589: .Cm HostKey .
                    590: The default behaviour of
                    591: .Xr sshd 8
                    592: is not to load any certificates.
1.1       stevesk   593: .It Cm HostKey
                    594: Specifies a file containing a private host key
                    595: used by SSH.
                    596: The default is
                    597: .Pa /etc/ssh/ssh_host_key
                    598: for protocol version 1, and
1.126     djm       599: .Pa /etc/ssh/ssh_host_dsa_key ,
1.169     naddy     600: .Pa /etc/ssh/ssh_host_ecdsa_key ,
                    601: .Pa /etc/ssh/ssh_host_ed25519_key
1.126     djm       602: and
1.1       stevesk   603: .Pa /etc/ssh/ssh_host_rsa_key
                    604: for protocol version 2.
                    605: Note that
1.52      jmc       606: .Xr sshd 8
1.1       stevesk   607: will refuse to use a file if it is group/world-accessible.
                    608: It is possible to have multiple host key files.
                    609: .Dq rsa1
                    610: keys are used for version 1 and
1.126     djm       611: .Dq dsa ,
1.169     naddy     612: .Dq ecdsa ,
                    613: .Dq ed25519
1.1       stevesk   614: or
                    615: .Dq rsa
                    616: are used for version 2 of the SSH protocol.
1.162     markus    617: It is also possible to specify public host key files instead.
                    618: In this case operations on the private key will be delegated
                    619: to an
                    620: .Xr ssh-agent 1 .
                    621: .It Cm HostKeyAgent
                    622: Identifies the UNIX-domain socket used to communicate
                    623: with an agent that has access to the private host keys.
                    624: If
                    625: .Dq SSH_AUTH_SOCK
                    626: is specified, the location of the socket will be read from the
                    627: .Ev SSH_AUTH_SOCK
                    628: environment variable.
1.1       stevesk   629: .It Cm IgnoreRhosts
                    630: Specifies that
                    631: .Pa .rhosts
                    632: and
                    633: .Pa .shosts
                    634: files will not be used in
                    635: .Cm RhostsRSAAuthentication
                    636: or
                    637: .Cm HostbasedAuthentication .
                    638: .Pp
                    639: .Pa /etc/hosts.equiv
                    640: and
                    641: .Pa /etc/shosts.equiv
                    642: are still used.
                    643: The default is
                    644: .Dq yes .
                    645: .It Cm IgnoreUserKnownHosts
                    646: Specifies whether
1.52      jmc       647: .Xr sshd 8
1.1       stevesk   648: should ignore the user's
1.41      djm       649: .Pa ~/.ssh/known_hosts
1.1       stevesk   650: during
                    651: .Cm RhostsRSAAuthentication
                    652: or
                    653: .Cm HostbasedAuthentication .
                    654: The default is
                    655: .Dq no .
1.129     djm       656: .It Cm IPQoS
                    657: Specifies the IPv4 type-of-service or DSCP class for the connection.
                    658: Accepted values are
                    659: .Dq af11 ,
                    660: .Dq af12 ,
                    661: .Dq af13 ,
1.136     djm       662: .Dq af21 ,
1.129     djm       663: .Dq af22 ,
                    664: .Dq af23 ,
                    665: .Dq af31 ,
                    666: .Dq af32 ,
                    667: .Dq af33 ,
                    668: .Dq af41 ,
                    669: .Dq af42 ,
                    670: .Dq af43 ,
                    671: .Dq cs0 ,
                    672: .Dq cs1 ,
                    673: .Dq cs2 ,
                    674: .Dq cs3 ,
                    675: .Dq cs4 ,
                    676: .Dq cs5 ,
                    677: .Dq cs6 ,
                    678: .Dq cs7 ,
                    679: .Dq ef ,
                    680: .Dq lowdelay ,
                    681: .Dq throughput ,
                    682: .Dq reliability ,
                    683: or a numeric value.
1.131     djm       684: This option may take one or two arguments, separated by whitespace.
1.129     djm       685: If one argument is specified, it is used as the packet class unconditionally.
                    686: If two values are specified, the first is automatically selected for
                    687: interactive sessions and the second for non-interactive sessions.
                    688: The default is
                    689: .Dq lowdelay
                    690: for interactive sessions and
                    691: .Dq throughput
                    692: for non-interactive sessions.
1.171     jmc       693: .It Cm KbdInteractiveAuthentication
                    694: Specifies whether to allow keyboard-interactive authentication.
                    695: The argument to this keyword must be
                    696: .Dq yes
                    697: or
                    698: .Dq no .
                    699: The default is to use whatever value
                    700: .Cm ChallengeResponseAuthentication
                    701: is set to
                    702: (by default
                    703: .Dq yes ) .
1.1       stevesk   704: .It Cm KerberosAuthentication
1.24      markus    705: Specifies whether the password provided by the user for
1.1       stevesk   706: .Cm PasswordAuthentication
1.24      markus    707: will be validated through the Kerberos KDC.
1.1       stevesk   708: To use this option, the server needs a
                    709: Kerberos servtab which allows the verification of the KDC's identity.
1.52      jmc       710: The default is
1.29      dtucker   711: .Dq no .
                    712: .It Cm KerberosGetAFSToken
1.45      djm       713: If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
1.29      dtucker   714: an AFS token before accessing the user's home directory.
1.52      jmc       715: The default is
1.1       stevesk   716: .Dq no .
                    717: .It Cm KerberosOrLocalPasswd
1.52      jmc       718: If password authentication through Kerberos fails then
1.1       stevesk   719: the password will be validated via any additional local mechanism
                    720: such as
                    721: .Pa /etc/passwd .
1.52      jmc       722: The default is
1.1       stevesk   723: .Dq yes .
                    724: .It Cm KerberosTicketCleanup
                    725: Specifies whether to automatically destroy the user's ticket cache
                    726: file on logout.
1.52      jmc       727: The default is
1.1       stevesk   728: .Dq yes .
1.127     djm       729: .It Cm KexAlgorithms
                    730: Specifies the available KEX (Key Exchange) algorithms.
                    731: Multiple algorithms must be comma-separated.
1.173     naddy     732: The supported algorithms are:
                    733: .Pp
                    734: .Bl -item -compact -offset indent
                    735: .It
                    736: curve25519-sha256@libssh.org
                    737: .It
                    738: diffie-hellman-group1-sha1
                    739: .It
                    740: diffie-hellman-group14-sha1
                    741: .It
                    742: diffie-hellman-group-exchange-sha1
                    743: .It
                    744: diffie-hellman-group-exchange-sha256
                    745: .It
                    746: ecdh-sha2-nistp256
                    747: .It
                    748: ecdh-sha2-nistp384
                    749: .It
                    750: ecdh-sha2-nistp521
                    751: .El
                    752: .Pp
                    753: The default is:
1.170     dtucker   754: .Bd -literal -offset indent
                    755: curve25519-sha256@libssh.org,
                    756: ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
                    757: diffie-hellman-group-exchange-sha256,
1.173     naddy     758: diffie-hellman-group14-sha1
1.170     dtucker   759: .Ed
1.1       stevesk   760: .It Cm KeyRegenerationInterval
                    761: In protocol version 1, the ephemeral server key is automatically regenerated
                    762: after this many seconds (if it has been used).
                    763: The purpose of regeneration is to prevent
                    764: decrypting captured sessions by later breaking into the machine and
                    765: stealing the keys.
                    766: The key is never stored anywhere.
                    767: If the value is 0, the key is never regenerated.
                    768: The default is 3600 (seconds).
                    769: .It Cm ListenAddress
                    770: Specifies the local addresses
1.52      jmc       771: .Xr sshd 8
1.1       stevesk   772: should listen on.
                    773: The following forms may be used:
                    774: .Pp
                    775: .Bl -item -offset indent -compact
                    776: .It
                    777: .Cm ListenAddress
                    778: .Sm off
1.180     jmc       779: .Ar host | Ar IPv4_addr | Ar IPv6_addr
1.1       stevesk   780: .Sm on
                    781: .It
                    782: .Cm ListenAddress
                    783: .Sm off
1.180     jmc       784: .Ar host | Ar IPv4_addr : Ar port
1.1       stevesk   785: .Sm on
                    786: .It
                    787: .Cm ListenAddress
                    788: .Sm off
                    789: .Oo
1.180     jmc       790: .Ar host | Ar IPv6_addr Oc : Ar port
1.1       stevesk   791: .Sm on
                    792: .El
                    793: .Pp
                    794: If
                    795: .Ar port
                    796: is not specified,
1.52      jmc       797: sshd will listen on the address and all prior
1.1       stevesk   798: .Cm Port
1.17      jmc       799: options specified.
                    800: The default is to listen on all local addresses.
1.15      jmc       801: Multiple
1.1       stevesk   802: .Cm ListenAddress
1.17      jmc       803: options are permitted.
                    804: Additionally, any
1.1       stevesk   805: .Cm Port
1.52      jmc       806: options must precede this option for non-port qualified addresses.
1.1       stevesk   807: .It Cm LoginGraceTime
                    808: The server disconnects after this time if the user has not
                    809: successfully logged in.
                    810: If the value is 0, there is no time limit.
1.12      stevesk   811: The default is 120 seconds.
1.1       stevesk   812: .It Cm LogLevel
                    813: Gives the verbosity level that is used when logging messages from
1.53      jmc       814: .Xr sshd 8 .
1.1       stevesk   815: The possible values are:
1.52      jmc       816: QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
1.15      jmc       817: The default is INFO.
                    818: DEBUG and DEBUG1 are equivalent.
                    819: DEBUG2 and DEBUG3 each specify higher levels of debugging output.
                    820: Logging with a DEBUG level violates the privacy of users and is not recommended.
1.1       stevesk   821: .It Cm MACs
                    822: Specifies the available MAC (message authentication code) algorithms.
                    823: The MAC algorithm is used in protocol version 2
                    824: for data integrity protection.
                    825: Multiple algorithms must be comma-separated.
1.152     markus    826: The algorithms that contain
                    827: .Dq -etm
                    828: calculate the MAC after encryption (encrypt-then-mac).
                    829: These are considered safer and their use recommended.
1.173     naddy     830: The supported MACs are:
                    831: .Pp
                    832: .Bl -item -compact -offset indent
                    833: .It
                    834: hmac-md5
                    835: .It
                    836: hmac-md5-96
                    837: .It
                    838: hmac-ripemd160
                    839: .It
                    840: hmac-sha1
                    841: .It
                    842: hmac-sha1-96
                    843: .It
                    844: hmac-sha2-256
                    845: .It
                    846: hmac-sha2-512
                    847: .It
                    848: umac-64@openssh.com
                    849: .It
                    850: umac-128@openssh.com
                    851: .It
                    852: hmac-md5-etm@openssh.com
                    853: .It
                    854: hmac-md5-96-etm@openssh.com
                    855: .It
                    856: hmac-ripemd160-etm@openssh.com
                    857: .It
                    858: hmac-sha1-etm@openssh.com
                    859: .It
                    860: hmac-sha1-96-etm@openssh.com
                    861: .It
                    862: hmac-sha2-256-etm@openssh.com
                    863: .It
                    864: hmac-sha2-512-etm@openssh.com
                    865: .It
                    866: umac-64-etm@openssh.com
                    867: .It
                    868: umac-128-etm@openssh.com
                    869: .El
                    870: .Pp
1.52      jmc       871: The default is:
1.77      jmc       872: .Bd -literal -offset indent
1.152     markus    873: umac-64-etm@openssh.com,umac-128-etm@openssh.com,
                    874: hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
1.173     naddy     875: umac-64@openssh.com,umac-128@openssh.com,
                    876: hmac-sha2-256,hmac-sha2-512
1.77      jmc       877: .Ed
1.60      dtucker   878: .It Cm Match
1.61      jmc       879: Introduces a conditional block.
1.65      dtucker   880: If all of the criteria on the
1.60      dtucker   881: .Cm Match
1.65      dtucker   882: line are satisfied, the keywords on the following lines override those
                    883: set in the global section of the config file, until either another
1.60      dtucker   884: .Cm Match
1.65      dtucker   885: line or the end of the file.
1.172     djm       886: If a keyword appears in multiple
                    887: .Cm Match
1.177     sobrado   888: blocks that are satisfied, only the first instance of the keyword is
1.172     djm       889: applied.
1.91      djm       890: .Pp
1.61      jmc       891: The arguments to
1.60      dtucker   892: .Cm Match
1.163     dtucker   893: are one or more criteria-pattern pairs or the single token
                    894: .Cm All
                    895: which matches all criteria.
1.60      dtucker   896: The available criteria are
                    897: .Cm User ,
1.69      dtucker   898: .Cm Group ,
1.60      dtucker   899: .Cm Host ,
1.139     dtucker   900: .Cm LocalAddress ,
                    901: .Cm LocalPort ,
1.60      dtucker   902: and
                    903: .Cm Address .
1.91      djm       904: The match patterns may consist of single entries or comma-separated
                    905: lists and may use the wildcard and negation operators described in the
1.161     jmc       906: PATTERNS section of
1.92      djm       907: .Xr ssh_config 5 .
1.91      djm       908: .Pp
                    909: The patterns in an
                    910: .Cm Address
                    911: criteria may additionally contain addresses to match in CIDR
1.93      jmc       912: address/masklen format, e.g.\&
1.91      djm       913: .Dq 192.0.2.0/24
                    914: or
                    915: .Dq 3ffe:ffff::/32 .
                    916: Note that the mask length provided must be consistent with the address -
                    917: it is an error to specify a mask length that is too long for the address
1.93      jmc       918: or one with bits set in this host portion of the address.
                    919: For example,
1.91      djm       920: .Dq 192.0.2.0/33
                    921: and
1.93      jmc       922: .Dq 192.0.2.0/8
1.91      djm       923: respectively.
                    924: .Pp
1.60      dtucker   925: Only a subset of keywords may be used on the lines following a
                    926: .Cm Match
                    927: keyword.
                    928: Available keywords are
1.142     jmc       929: .Cm AcceptEnv ,
1.99      okan      930: .Cm AllowAgentForwarding ,
1.142     jmc       931: .Cm AllowGroups ,
1.62      dtucker   932: .Cm AllowTcpForwarding ,
1.141     markus    933: .Cm AllowUsers ,
1.149     djm       934: .Cm AuthenticationMethods ,
1.146     djm       935: .Cm AuthorizedKeysCommand ,
                    936: .Cm AuthorizedKeysCommandUser ,
1.147     jmc       937: .Cm AuthorizedKeysFile ,
1.123     djm       938: .Cm AuthorizedPrincipalsFile ,
1.72      dtucker   939: .Cm Banner ,
1.85      djm       940: .Cm ChrootDirectory ,
1.141     markus    941: .Cm DenyGroups ,
                    942: .Cm DenyUsers ,
1.67      dtucker   943: .Cm ForceCommand ,
1.142     jmc       944: .Cm GatewayPorts ,
1.141     markus    945: .Cm GSSAPIAuthentication ,
1.87      djm       946: .Cm HostbasedAuthentication ,
1.123     djm       947: .Cm HostbasedUsesNameFromPacketOnly ,
1.74      jmc       948: .Cm KbdInteractiveAuthentication ,
1.72      dtucker   949: .Cm KerberosAuthentication ,
1.95      dtucker   950: .Cm MaxAuthTries ,
1.94      dtucker   951: .Cm MaxSessions ,
1.72      dtucker   952: .Cm PasswordAuthentication ,
1.97      djm       953: .Cm PermitEmptyPasswords ,
1.66      dtucker   954: .Cm PermitOpen ,
1.79      dtucker   955: .Cm PermitRootLogin ,
1.164     djm       956: .Cm PermitTTY ,
1.123     djm       957: .Cm PermitTunnel ,
1.174     djm       958: .Cm PermitUserRC ,
1.107     dtucker   959: .Cm PubkeyAuthentication ,
1.159     dtucker   960: .Cm RekeyLimit ,
1.142     jmc       961: .Cm RhostsRSAAuthentication ,
1.141     markus    962: .Cm RSAAuthentication ,
1.66      dtucker   963: .Cm X11DisplayOffset ,
1.101     djm       964: .Cm X11Forwarding
1.60      dtucker   965: and
1.102     djm       966: .Cm X11UseLocalHost .
1.33      dtucker   967: .It Cm MaxAuthTries
                    968: Specifies the maximum number of authentication attempts permitted per
1.35      jmc       969: connection.
                    970: Once the number of failures reaches half this value,
                    971: additional failures are logged.
                    972: The default is 6.
1.90      djm       973: .It Cm MaxSessions
                    974: Specifies the maximum number of open sessions permitted per network connection.
                    975: The default is 10.
1.1       stevesk   976: .It Cm MaxStartups
                    977: Specifies the maximum number of concurrent unauthenticated connections to the
1.52      jmc       978: SSH daemon.
1.1       stevesk   979: Additional connections will be dropped until authentication succeeds or the
                    980: .Cm LoginGraceTime
                    981: expires for a connection.
1.156     dtucker   982: The default is 10:30:100.
1.1       stevesk   983: .Pp
                    984: Alternatively, random early drop can be enabled by specifying
                    985: the three colon separated values
                    986: .Dq start:rate:full
1.51      jmc       987: (e.g. "10:30:60").
1.53      jmc       988: .Xr sshd 8
1.1       stevesk   989: will refuse connection attempts with a probability of
                    990: .Dq rate/100
                    991: (30%)
                    992: if there are currently
                    993: .Dq start
                    994: (10)
                    995: unauthenticated connections.
                    996: The probability increases linearly and all connection attempts
                    997: are refused if the number of unauthenticated connections reaches
                    998: .Dq full
                    999: (60).
                   1000: .It Cm PasswordAuthentication
                   1001: Specifies whether password authentication is allowed.
                   1002: The default is
                   1003: .Dq yes .
                   1004: .It Cm PermitEmptyPasswords
                   1005: When password authentication is allowed, it specifies whether the
                   1006: server allows login to accounts with empty password strings.
                   1007: The default is
                   1008: .Dq no .
1.62      dtucker  1009: .It Cm PermitOpen
                   1010: Specifies the destinations to which TCP port forwarding is permitted.
                   1011: The forwarding specification must be one of the following forms:
                   1012: .Pp
                   1013: .Bl -item -offset indent -compact
                   1014: .It
                   1015: .Cm PermitOpen
                   1016: .Sm off
                   1017: .Ar host : port
                   1018: .Sm on
                   1019: .It
                   1020: .Cm PermitOpen
                   1021: .Sm off
                   1022: .Ar IPv4_addr : port
                   1023: .Sm on
                   1024: .It
                   1025: .Cm PermitOpen
                   1026: .Sm off
                   1027: .Ar \&[ IPv6_addr \&] : port
                   1028: .Sm on
                   1029: .El
                   1030: .Pp
1.68      dtucker  1031: Multiple forwards may be specified by separating them with whitespace.
1.62      dtucker  1032: An argument of
                   1033: .Dq any
                   1034: can be used to remove all restrictions and permit any forwarding requests.
1.140     dtucker  1035: An argument of
                   1036: .Dq none
                   1037: can be used to prohibit all forwarding requests.
1.63      jmc      1038: By default all port forwarding requests are permitted.
1.1       stevesk  1039: .It Cm PermitRootLogin
1.38      jmc      1040: Specifies whether root can log in using
1.1       stevesk  1041: .Xr ssh 1 .
                   1042: The argument must be
                   1043: .Dq yes ,
                   1044: .Dq without-password ,
1.52      jmc      1045: .Dq forced-commands-only ,
1.1       stevesk  1046: or
                   1047: .Dq no .
                   1048: The default is
                   1049: .Dq yes .
                   1050: .Pp
                   1051: If this option is set to
1.52      jmc      1052: .Dq without-password ,
1.1       stevesk  1053: password authentication is disabled for root.
                   1054: .Pp
                   1055: If this option is set to
1.52      jmc      1056: .Dq forced-commands-only ,
1.1       stevesk  1057: root login with public key authentication will be allowed,
                   1058: but only if the
                   1059: .Ar command
                   1060: option has been specified
                   1061: (which may be useful for taking remote backups even if root login is
1.17      jmc      1062: normally not allowed).
                   1063: All other authentication methods are disabled for root.
1.1       stevesk  1064: .Pp
                   1065: If this option is set to
1.52      jmc      1066: .Dq no ,
1.38      jmc      1067: root is not allowed to log in.
1.46      reyk     1068: .It Cm PermitTunnel
                   1069: Specifies whether
                   1070: .Xr tun 4
                   1071: device forwarding is allowed.
1.47      reyk     1072: The argument must be
                   1073: .Dq yes ,
1.58      stevesk  1074: .Dq point-to-point
                   1075: (layer 3),
                   1076: .Dq ethernet
                   1077: (layer 2), or
1.47      reyk     1078: .Dq no .
1.58      stevesk  1079: Specifying
                   1080: .Dq yes
                   1081: permits both
                   1082: .Dq point-to-point
                   1083: and
                   1084: .Dq ethernet .
1.46      reyk     1085: The default is
                   1086: .Dq no .
1.178     djm      1087: .Pp
                   1088: Independent of this setting, the permissions of the selected
                   1089: .Xr tun 4
                   1090: device must allow access to the user.
1.164     djm      1091: .It Cm PermitTTY
                   1092: Specifies whether
1.165     jmc      1093: .Xr pty 4
1.164     djm      1094: allocation is permitted.
                   1095: The default is
                   1096: .Dq yes .
1.6       markus   1097: .It Cm PermitUserEnvironment
                   1098: Specifies whether
                   1099: .Pa ~/.ssh/environment
1.9       stevesk  1100: and
1.6       markus   1101: .Cm environment=
                   1102: options in
                   1103: .Pa ~/.ssh/authorized_keys
1.9       stevesk  1104: are processed by
1.52      jmc      1105: .Xr sshd 8 .
1.6       markus   1106: The default is
                   1107: .Dq no .
1.9       stevesk  1108: Enabling environment processing may enable users to bypass access
                   1109: restrictions in some configurations using mechanisms such as
                   1110: .Ev LD_PRELOAD .
1.174     djm      1111: .It Cm PermitUserRC
                   1112: Specifies whether any
                   1113: .Pa ~/.ssh/rc
                   1114: file is executed.
                   1115: The default is
                   1116: .Dq yes .
1.1       stevesk  1117: .It Cm PidFile
1.4       stevesk  1118: Specifies the file that contains the process ID of the
1.53      jmc      1119: SSH daemon.
1.1       stevesk  1120: The default is
                   1121: .Pa /var/run/sshd.pid .
                   1122: .It Cm Port
                   1123: Specifies the port number that
1.52      jmc      1124: .Xr sshd 8
1.1       stevesk  1125: listens on.
                   1126: The default is 22.
                   1127: Multiple options of this type are permitted.
                   1128: See also
                   1129: .Cm ListenAddress .
                   1130: .It Cm PrintLastLog
                   1131: Specifies whether
1.52      jmc      1132: .Xr sshd 8
1.36      jaredy   1133: should print the date and time of the last user login when a user logs
                   1134: in interactively.
1.1       stevesk  1135: The default is
                   1136: .Dq yes .
                   1137: .It Cm PrintMotd
                   1138: Specifies whether
1.52      jmc      1139: .Xr sshd 8
1.1       stevesk  1140: should print
                   1141: .Pa /etc/motd
                   1142: when a user logs in interactively.
                   1143: (On some systems it is also printed by the shell,
                   1144: .Pa /etc/profile ,
                   1145: or equivalent.)
                   1146: The default is
                   1147: .Dq yes .
                   1148: .It Cm Protocol
                   1149: Specifies the protocol versions
1.52      jmc      1150: .Xr sshd 8
1.5       stevesk  1151: supports.
1.1       stevesk  1152: The possible values are
1.52      jmc      1153: .Sq 1
1.1       stevesk  1154: and
1.52      jmc      1155: .Sq 2 .
1.1       stevesk  1156: Multiple versions must be comma-separated.
                   1157: The default is
1.109     jmc      1158: .Sq 2 .
1.5       stevesk  1159: Note that the order of the protocol list does not indicate preference,
                   1160: because the client selects among multiple protocol versions offered
                   1161: by the server.
                   1162: Specifying
                   1163: .Dq 2,1
                   1164: is identical to
                   1165: .Dq 1,2 .
1.1       stevesk  1166: .It Cm PubkeyAuthentication
                   1167: Specifies whether public key authentication is allowed.
                   1168: The default is
                   1169: .Dq yes .
                   1170: Note that this option applies to protocol version 2 only.
1.159     dtucker  1171: .It Cm RekeyLimit
                   1172: Specifies the maximum amount of data that may be transmitted before the
                   1173: session key is renegotiated, optionally followed a maximum amount of
                   1174: time that may pass before the session key is renegotiated.
                   1175: The first argument is specified in bytes and may have a suffix of
                   1176: .Sq K ,
                   1177: .Sq M ,
                   1178: or
                   1179: .Sq G
                   1180: to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
                   1181: The default is between
                   1182: .Sq 1G
                   1183: and
                   1184: .Sq 4G ,
                   1185: depending on the cipher.
                   1186: The optional second value is specified in seconds and may use any of the
                   1187: units documented in the
                   1188: .Sx TIME FORMATS
1.160     jmc      1189: section.
1.159     dtucker  1190: The default value for
                   1191: .Cm RekeyLimit
                   1192: is
                   1193: .Dq default none ,
                   1194: which means that rekeying is performed after the cipher's default amount
                   1195: of data has been sent or received and no time based rekeying is done.
                   1196: This option applies to protocol version 2 only.
1.118     djm      1197: .It Cm RevokedKeys
1.154     djm      1198: Specifies revoked public keys.
1.118     djm      1199: Keys listed in this file will be refused for public key authentication.
                   1200: Note that if this file is not readable, then public key authentication will
                   1201: be refused for all users.
1.154     djm      1202: Keys may be specified as a text file, listing one public key per line, or as
                   1203: an OpenSSH Key Revocation List (KRL) as generated by
1.155     jmc      1204: .Xr ssh-keygen 1 .
1.161     jmc      1205: For more information on KRLs, see the KEY REVOCATION LISTS section in
1.154     djm      1206: .Xr ssh-keygen 1 .
1.1       stevesk  1207: .It Cm RhostsRSAAuthentication
                   1208: Specifies whether rhosts or /etc/hosts.equiv authentication together
                   1209: with successful RSA host authentication is allowed.
                   1210: The default is
                   1211: .Dq no .
                   1212: This option applies to protocol version 1 only.
                   1213: .It Cm RSAAuthentication
                   1214: Specifies whether pure RSA authentication is allowed.
                   1215: The default is
                   1216: .Dq yes .
                   1217: This option applies to protocol version 1 only.
                   1218: .It Cm ServerKeyBits
                   1219: Defines the number of bits in the ephemeral protocol version 1 server key.
1.96      djm      1220: The minimum value is 512, and the default is 1024.
1.175     millert  1221: .It Cm StreamLocalBindMask
                   1222: Sets the octal file creation mode mask
                   1223: .Pq umask
                   1224: used when creating a Unix-domain socket file for local or remote
                   1225: port forwarding.
                   1226: This option is only used for port forwarding to a Unix-domain socket file.
                   1227: .Pp
                   1228: The default value is 0177, which creates a Unix-domain socket file that is
                   1229: readable and writable only by the owner.
                   1230: Note that not all operating systems honor the file mode on Unix-domain
                   1231: socket files.
                   1232: .It Cm StreamLocalBindUnlink
                   1233: Specifies whether to remove an existing Unix-domain socket file for local
                   1234: or remote port forwarding before creating a new one.
                   1235: If the socket file already exists and
                   1236: .Cm StreamLocalBindUnlink
                   1237: is not enabled,
                   1238: .Nm sshd
                   1239: will be unable to forward the port to the Unix-domain socket file.
                   1240: This option is only used for port forwarding to a Unix-domain socket file.
                   1241: .Pp
                   1242: The argument must be
                   1243: .Dq yes
                   1244: or
                   1245: .Dq no .
                   1246: The default is
                   1247: .Dq no .
1.1       stevesk  1248: .It Cm StrictModes
                   1249: Specifies whether
1.52      jmc      1250: .Xr sshd 8
1.1       stevesk  1251: should check file modes and ownership of the
                   1252: user's files and home directory before accepting login.
                   1253: This is normally desirable because novices sometimes accidentally leave their
                   1254: directory or files world-writable.
                   1255: The default is
                   1256: .Dq yes .
1.112     djm      1257: Note that this does not apply to
                   1258: .Cm ChrootDirectory ,
                   1259: whose permissions and ownership are checked unconditionally.
1.1       stevesk  1260: .It Cm Subsystem
1.51      jmc      1261: Configures an external subsystem (e.g. file transfer daemon).
1.59      djm      1262: Arguments should be a subsystem name and a command (with optional arguments)
                   1263: to execute upon subsystem request.
1.80      djm      1264: .Pp
1.1       stevesk  1265: The command
                   1266: .Xr sftp-server 8
                   1267: implements the
                   1268: .Dq sftp
                   1269: file transfer subsystem.
1.80      djm      1270: .Pp
                   1271: Alternately the name
                   1272: .Dq internal-sftp
                   1273: implements an in-process
                   1274: .Dq sftp
                   1275: server.
                   1276: This may simplify configurations using
                   1277: .Cm ChrootDirectory
                   1278: to force a different filesystem root on clients.
                   1279: .Pp
1.1       stevesk  1280: By default no subsystems are defined.
                   1281: Note that this option applies to protocol version 2 only.
                   1282: .It Cm SyslogFacility
                   1283: Gives the facility code that is used when logging messages from
1.53      jmc      1284: .Xr sshd 8 .
1.1       stevesk  1285: The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
                   1286: LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
                   1287: The default is AUTH.
1.27      markus   1288: .It Cm TCPKeepAlive
                   1289: Specifies whether the system should send TCP keepalive messages to the
                   1290: other side.
                   1291: If they are sent, death of the connection or crash of one
                   1292: of the machines will be properly noticed.
                   1293: However, this means that
                   1294: connections will die if the route is down temporarily, and some people
                   1295: find it annoying.
                   1296: On the other hand, if TCP keepalives are not sent,
                   1297: sessions may hang indefinitely on the server, leaving
                   1298: .Dq ghost
                   1299: users and consuming server resources.
                   1300: .Pp
                   1301: The default is
                   1302: .Dq yes
                   1303: (to send TCP keepalive messages), and the server will notice
                   1304: if the network goes down or the client host crashes.
                   1305: This avoids infinitely hanging sessions.
                   1306: .Pp
                   1307: To disable TCP keepalive messages, the value should be set to
                   1308: .Dq no .
1.118     djm      1309: .It Cm TrustedUserCAKeys
                   1310: Specifies a file containing public keys of certificate authorities that are
1.120     djm      1311: trusted to sign user certificates for authentication.
1.119     jmc      1312: Keys are listed one per line; empty lines and comments starting with
1.118     djm      1313: .Ql #
                   1314: are allowed.
                   1315: If a certificate is presented for authentication and has its signing CA key
                   1316: listed in this file, then it may be used for authentication for any user
                   1317: listed in the certificate's principals list.
                   1318: Note that certificates that lack a list of principals will not be permitted
                   1319: for authentication using
                   1320: .Cm TrustedUserCAKeys .
1.161     jmc      1321: For more details on certificates, see the CERTIFICATES section in
1.118     djm      1322: .Xr ssh-keygen 1 .
1.18      markus   1323: .It Cm UseDNS
                   1324: Specifies whether
1.52      jmc      1325: .Xr sshd 8
1.40      jmc      1326: should look up the remote host name and check that
1.18      markus   1327: the resolved host name for the remote IP address maps back to the
                   1328: very same IP address.
                   1329: The default is
                   1330: .Dq yes .
1.1       stevesk  1331: .It Cm UseLogin
                   1332: Specifies whether
                   1333: .Xr login 1
                   1334: is used for interactive login sessions.
                   1335: The default is
                   1336: .Dq no .
                   1337: Note that
                   1338: .Xr login 1
                   1339: is never used for remote command execution.
                   1340: Note also, that if this is enabled,
                   1341: .Cm X11Forwarding
                   1342: will be disabled because
                   1343: .Xr login 1
                   1344: does not know how to handle
                   1345: .Xr xauth 1
1.15      jmc      1346: cookies.
                   1347: If
1.1       stevesk  1348: .Cm UsePrivilegeSeparation
                   1349: is specified, it will be disabled after authentication.
                   1350: .It Cm UsePrivilegeSeparation
                   1351: Specifies whether
1.52      jmc      1352: .Xr sshd 8
1.2       stevesk  1353: separates privileges by creating an unprivileged child process
1.15      jmc      1354: to deal with incoming network traffic.
                   1355: After successful authentication, another process will be created that has
                   1356: the privilege of the authenticated user.
                   1357: The goal of privilege separation is to prevent privilege
1.1       stevesk  1358: escalation by containing any corruption within the unprivileged processes.
                   1359: The default is
                   1360: .Dq yes .
1.134     djm      1361: If
                   1362: .Cm UsePrivilegeSeparation
                   1363: is set to
                   1364: .Dq sandbox
                   1365: then the pre-authentication unprivileged process is subject to additional
                   1366: restrictions.
1.137     djm      1367: .It Cm VersionAddendum
                   1368: Optionally specifies additional text to append to the SSH protocol banner
                   1369: sent by the server upon connection.
                   1370: The default is
                   1371: .Dq none .
1.1       stevesk  1372: .It Cm X11DisplayOffset
                   1373: Specifies the first display number available for
1.52      jmc      1374: .Xr sshd 8 Ns 's
1.1       stevesk  1375: X11 forwarding.
1.52      jmc      1376: This prevents sshd from interfering with real X11 servers.
1.1       stevesk  1377: The default is 10.
                   1378: .It Cm X11Forwarding
                   1379: Specifies whether X11 forwarding is permitted.
1.13      stevesk  1380: The argument must be
                   1381: .Dq yes
                   1382: or
                   1383: .Dq no .
1.1       stevesk  1384: The default is
                   1385: .Dq no .
1.13      stevesk  1386: .Pp
                   1387: When X11 forwarding is enabled, there may be additional exposure to
                   1388: the server and to client displays if the
1.52      jmc      1389: .Xr sshd 8
1.13      stevesk  1390: proxy display is configured to listen on the wildcard address (see
                   1391: .Cm X11UseLocalhost
1.52      jmc      1392: below), though this is not the default.
1.13      stevesk  1393: Additionally, the authentication spoofing and authentication data
                   1394: verification and substitution occur on the client side.
                   1395: The security risk of using X11 forwarding is that the client's X11
1.52      jmc      1396: display server may be exposed to attack when the SSH client requests
1.13      stevesk  1397: forwarding (see the warnings for
                   1398: .Cm ForwardX11
                   1399: in
1.19      jmc      1400: .Xr ssh_config 5 ) .
1.13      stevesk  1401: A system administrator may have a stance in which they want to
                   1402: protect clients that may expose themselves to attack by unwittingly
                   1403: requesting X11 forwarding, which can warrant a
                   1404: .Dq no
                   1405: setting.
                   1406: .Pp
                   1407: Note that disabling X11 forwarding does not prevent users from
                   1408: forwarding X11 traffic, as users can always install their own forwarders.
1.1       stevesk  1409: X11 forwarding is automatically disabled if
                   1410: .Cm UseLogin
                   1411: is enabled.
                   1412: .It Cm X11UseLocalhost
                   1413: Specifies whether
1.52      jmc      1414: .Xr sshd 8
1.1       stevesk  1415: should bind the X11 forwarding server to the loopback address or to
1.15      jmc      1416: the wildcard address.
                   1417: By default,
1.52      jmc      1418: sshd binds the forwarding server to the loopback address and sets the
1.1       stevesk  1419: hostname part of the
                   1420: .Ev DISPLAY
                   1421: environment variable to
                   1422: .Dq localhost .
1.8       stevesk  1423: This prevents remote hosts from connecting to the proxy display.
1.1       stevesk  1424: However, some older X11 clients may not function with this
                   1425: configuration.
                   1426: .Cm X11UseLocalhost
                   1427: may be set to
                   1428: .Dq no
                   1429: to specify that the forwarding server should be bound to the wildcard
                   1430: address.
                   1431: The argument must be
                   1432: .Dq yes
                   1433: or
                   1434: .Dq no .
                   1435: The default is
                   1436: .Dq yes .
                   1437: .It Cm XAuthLocation
1.11      stevesk  1438: Specifies the full pathname of the
1.1       stevesk  1439: .Xr xauth 1
                   1440: program.
                   1441: The default is
                   1442: .Pa /usr/X11R6/bin/xauth .
                   1443: .El
1.55      jmc      1444: .Sh TIME FORMATS
1.53      jmc      1445: .Xr sshd 8
1.1       stevesk  1446: command-line arguments and configuration file options that specify time
                   1447: may be expressed using a sequence of the form:
                   1448: .Sm off
1.7       stevesk  1449: .Ar time Op Ar qualifier ,
1.1       stevesk  1450: .Sm on
                   1451: where
                   1452: .Ar time
                   1453: is a positive integer value and
                   1454: .Ar qualifier
                   1455: is one of the following:
                   1456: .Pp
                   1457: .Bl -tag -width Ds -compact -offset indent
1.64      jmc      1458: .It Aq Cm none
1.1       stevesk  1459: seconds
                   1460: .It Cm s | Cm S
                   1461: seconds
                   1462: .It Cm m | Cm M
                   1463: minutes
                   1464: .It Cm h | Cm H
                   1465: hours
                   1466: .It Cm d | Cm D
                   1467: days
                   1468: .It Cm w | Cm W
                   1469: weeks
                   1470: .El
                   1471: .Pp
                   1472: Each member of the sequence is added together to calculate
                   1473: the total time value.
                   1474: .Pp
                   1475: Time format examples:
                   1476: .Pp
                   1477: .Bl -tag -width Ds -compact -offset indent
                   1478: .It 600
                   1479: 600 seconds (10 minutes)
                   1480: .It 10m
                   1481: 10 minutes
                   1482: .It 1h30m
                   1483: 1 hour 30 minutes (90 minutes)
                   1484: .El
                   1485: .Sh FILES
                   1486: .Bl -tag -width Ds
                   1487: .It Pa /etc/ssh/sshd_config
                   1488: Contains configuration data for
1.53      jmc      1489: .Xr sshd 8 .
1.1       stevesk  1490: This file should be writable by root only, but it is recommended
                   1491: (though not necessary) that it be world-readable.
                   1492: .El
1.19      jmc      1493: .Sh SEE ALSO
                   1494: .Xr sshd 8
1.1       stevesk  1495: .Sh AUTHORS
                   1496: OpenSSH is a derivative of the original and free
                   1497: ssh 1.2.12 release by Tatu Ylonen.
                   1498: Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
                   1499: Theo de Raadt and Dug Song
                   1500: removed many bugs, re-added newer features and
                   1501: created OpenSSH.
                   1502: Markus Friedl contributed the support for SSH
                   1503: protocol versions 1.5 and 2.0.
                   1504: Niels Provos and Markus Friedl contributed support
                   1505: for privilege separation.