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

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