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

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