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

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