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

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