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

1.1       stevesk     1: .\"  -*- nroff -*-
                      2: .\"
                      3: .\" Author: Tatu Ylonen <ylo@cs.hut.fi>
                      4: .\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
                      5: .\"                    All rights reserved
                      6: .\"
                      7: .\" As far as I am concerned, the code I have written for this software
                      8: .\" can be used freely for any purpose.  Any derived versions of this
                      9: .\" software must be clearly marked as such, and if the derived work is
                     10: .\" incompatible with the protocol description in the RFC file, it must be
                     11: .\" called by a name other than "ssh" or "Secure Shell".
                     12: .\"
                     13: .\" Copyright (c) 1999,2000 Markus Friedl.  All rights reserved.
                     14: .\" Copyright (c) 1999 Aaron Campbell.  All rights reserved.
                     15: .\" Copyright (c) 1999 Theo de Raadt.  All rights reserved.
                     16: .\"
                     17: .\" Redistribution and use in source and binary forms, with or without
                     18: .\" modification, are permitted provided that the following conditions
                     19: .\" are met:
                     20: .\" 1. Redistributions of source code must retain the above copyright
                     21: .\"    notice, this list of conditions and the following disclaimer.
                     22: .\" 2. Redistributions in binary form must reproduce the above copyright
                     23: .\"    notice, this list of conditions and the following disclaimer in the
                     24: .\"    documentation and/or other materials provided with the distribution.
                     25: .\"
                     26: .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
                     27: .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
                     28: .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
                     29: .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
                     30: .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
                     31: .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
                     32: .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
                     33: .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
                     34: .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
                     35: .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
                     36: .\"
1.85    ! djm        37: .\" $OpenBSD: sshd_config.5,v 1.84 2008/03/25 11:58:02 djm Exp $
        !            38: .Dd $Mdocdate: March 25 2008 $
1.1       stevesk    39: .Dt SSHD_CONFIG 5
                     40: .Os
                     41: .Sh NAME
                     42: .Nm sshd_config
                     43: .Nd OpenSSH SSH daemon configuration file
                     44: .Sh SYNOPSIS
1.71      jmc        45: .Nm /etc/ssh/sshd_config
1.1       stevesk    46: .Sh DESCRIPTION
1.53      jmc        47: .Xr sshd 8
1.1       stevesk    48: reads configuration data from
                     49: .Pa /etc/ssh/sshd_config
                     50: (or the file specified with
                     51: .Fl f
                     52: on the command line).
                     53: The file contains keyword-argument pairs, one per line.
                     54: Lines starting with
                     55: .Ql #
                     56: and empty lines are interpreted as comments.
1.56      dtucker    57: Arguments may optionally be enclosed in double quotes
                     58: .Pq \&"
                     59: in order to represent arguments containing spaces.
1.1       stevesk    60: .Pp
                     61: The possible
                     62: keywords and their meanings are as follows (note that
                     63: keywords are case-insensitive and arguments are case-sensitive):
                     64: .Bl -tag -width Ds
1.30      djm        65: .It Cm AcceptEnv
                     66: Specifies what environment variables sent by the client will be copied into
                     67: the session's
                     68: .Xr environ 7 .
                     69: See
                     70: .Cm SendEnv
                     71: in
                     72: .Xr ssh_config 5
                     73: for how to configure the client.
1.31      djm        74: Note that environment passing is only supported for protocol 2.
1.30      djm        75: Variables are specified by name, which may contain the wildcard characters
1.51      jmc        76: .Ql *
1.30      djm        77: and
                     78: .Ql \&? .
1.31      djm        79: Multiple environment variables may be separated by whitespace or spread
1.30      djm        80: across multiple
                     81: .Cm AcceptEnv
                     82: directives.
1.31      djm        83: Be warned that some environment variables could be used to bypass restricted
1.30      djm        84: user environments.
                     85: For this reason, care should be taken in the use of this directive.
                     86: The default is not to accept any environment variables.
1.37      djm        87: .It Cm AddressFamily
                     88: Specifies which address family should be used by
1.53      jmc        89: .Xr sshd 8 .
1.37      djm        90: Valid arguments are
                     91: .Dq any ,
                     92: .Dq inet
1.52      jmc        93: (use IPv4 only), or
1.37      djm        94: .Dq inet6
                     95: (use IPv6 only).
                     96: The default is
                     97: .Dq any .
1.1       stevesk    98: .It Cm AllowGroups
                     99: This keyword can be followed by a list of group name patterns, separated
                    100: by spaces.
                    101: If specified, login is allowed only for users whose primary
                    102: group or supplementary group list matches one of the patterns.
                    103: Only group names are valid; a numerical group ID is not recognized.
                    104: By default, login is allowed for all groups.
1.54      jmc       105: The allow/deny directives are processed in the following order:
                    106: .Cm DenyUsers ,
                    107: .Cm AllowUsers ,
                    108: .Cm DenyGroups ,
                    109: and finally
                    110: .Cm AllowGroups .
1.49      jmc       111: .Pp
                    112: See
                    113: .Sx PATTERNS
                    114: in
                    115: .Xr ssh_config 5
                    116: for more information on patterns.
1.1       stevesk   117: .It Cm AllowTcpForwarding
                    118: Specifies whether TCP forwarding is permitted.
                    119: The default is
                    120: .Dq yes .
                    121: Note that disabling TCP forwarding does not improve security unless
                    122: users are also denied shell access, as they can always install their
                    123: own forwarders.
                    124: .It Cm AllowUsers
                    125: This keyword can be followed by a list of user name patterns, separated
                    126: by spaces.
1.14      jmc       127: If specified, login is allowed only for user names that
1.1       stevesk   128: match one of the patterns.
                    129: Only user names are valid; a numerical user ID is not recognized.
                    130: By default, login is allowed for all users.
                    131: If the pattern takes the form USER@HOST then USER and HOST
                    132: are separately checked, restricting logins to particular
                    133: users from particular hosts.
1.54      jmc       134: The allow/deny directives are processed in the following order:
                    135: .Cm DenyUsers ,
                    136: .Cm AllowUsers ,
                    137: .Cm DenyGroups ,
                    138: and finally
                    139: .Cm AllowGroups .
1.49      jmc       140: .Pp
                    141: See
                    142: .Sx PATTERNS
                    143: in
                    144: .Xr ssh_config 5
                    145: for more information on patterns.
1.1       stevesk   146: .It Cm AuthorizedKeysFile
                    147: Specifies the file that contains the public keys that can be used
                    148: for user authentication.
                    149: .Cm AuthorizedKeysFile
                    150: may contain tokens of the form %T which are substituted during connection
1.52      jmc       151: setup.
1.17      jmc       152: The following tokens are defined: %% is replaced by a literal '%',
1.52      jmc       153: %h is replaced by the home directory of the user being authenticated, and
1.1       stevesk   154: %u is replaced by the username of that user.
                    155: After expansion,
                    156: .Cm AuthorizedKeysFile
                    157: is taken to be an absolute path or one relative to the user's home
                    158: directory.
                    159: The default is
                    160: .Dq .ssh/authorized_keys .
                    161: .It Cm Banner
                    162: The contents of the specified file are sent to the remote user before
                    163: authentication is allowed.
1.78      djm       164: If the argument is
                    165: .Dq none
                    166: then no banner is displayed.
1.1       stevesk   167: This option is only available for protocol version 2.
                    168: By default, no banner is displayed.
                    169: .It Cm ChallengeResponseAuthentication
1.50      jmc       170: Specifies whether challenge-response authentication is allowed.
1.1       stevesk   171: All authentication styles from
                    172: .Xr login.conf 5
                    173: are supported.
                    174: The default is
                    175: .Dq yes .
1.80      djm       176: .It Cm ChrootDirectory
                    177: Specifies a path to
                    178: .Xr chroot 2
                    179: to after authentication.
                    180: This path, and all its components, must be root-owned directories that are
                    181: not writable by any other user or group.
                    182: .Pp
                    183: The path may contain the following tokens that are expanded at runtime once
                    184: the connecting user has been authenticated: %% is replaced by a literal '%',
                    185: %h is replaced by the home directory of the user being authenticated, and
                    186: %u is replaced by the username of that user.
                    187: .Pp
                    188: The
                    189: .Cm ChrootDirectory
                    190: must contain the necessary files and directories to support the
                    191: users' session.
                    192: For an interactive session this requires at least a shell, typically
                    193: .Xr sh 1 ,
                    194: and basic
                    195: .Pa /dev
                    196: nodes such as
                    197: .Xr null 4 ,
                    198: .Xr zero 4 ,
                    199: .Xr stdin 4 ,
                    200: .Xr stdout 4 ,
                    201: .Xr stderr 4 ,
                    202: .Xr arandom 4
                    203: and
                    204: .Xr tty 4
                    205: devices.
                    206: For file transfer sessions using
                    207: .Dq sftp ,
                    208: no additional configuration of the environment is necessary if the
                    209: in-process sftp server is used (see
                    210: .Cm Subsystem
1.81      jmc       211: for details).
1.80      djm       212: .Pp
1.85    ! djm       213: Please note that there are many ways to misconfigure a chroot environment
        !           214: in ways that compromise security.
        !           215: These include:
        !           216: .Pp
        !           217: .Bl -dash -offset indent -compact
        !           218: .It
        !           219: Making unsafe setuid binaries available;
        !           220: .It
        !           221: Having missing or incorrect configuration files in the chroot's
        !           222: .Pa /etc
        !           223: directory;
        !           224: .It
        !           225: Hard-linking files between the chroot and outside;
        !           226: .It
        !           227: Leaving unnecessary
        !           228: .Pa /dev
        !           229: nodes accessible inside the chroot (especially those for physical drives);
        !           230: .It
        !           231: Executing scripts or binaries inside the chroot from outside, either
        !           232: directly or through facilities such as
        !           233: .Xr cron 8 .
        !           234: .El
        !           235: .Pp
1.80      djm       236: The default is not to
                    237: .Xr chroot 2 .
1.1       stevesk   238: .It Cm Ciphers
                    239: Specifies the ciphers allowed for protocol version 2.
                    240: Multiple ciphers must be comma-separated.
1.34      dtucker   241: The supported ciphers are
                    242: .Dq 3des-cbc ,
                    243: .Dq aes128-cbc ,
                    244: .Dq aes192-cbc ,
                    245: .Dq aes256-cbc ,
                    246: .Dq aes128-ctr ,
                    247: .Dq aes192-ctr ,
                    248: .Dq aes256-ctr ,
1.43      djm       249: .Dq arcfour128 ,
                    250: .Dq arcfour256 ,
1.34      dtucker   251: .Dq arcfour ,
                    252: .Dq blowfish-cbc ,
                    253: and
                    254: .Dq cast128-cbc .
1.52      jmc       255: The default is:
                    256: .Bd -literal -offset 3n
                    257: aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,
                    258: arcfour256,arcfour,aes192-cbc,aes256-cbc,aes128-ctr,
                    259: aes192-ctr,aes256-ctr
1.1       stevesk   260: .Ed
                    261: .It Cm ClientAliveCountMax
1.48      jmc       262: Sets the number of client alive messages (see below) which may be
1.1       stevesk   263: sent without
1.52      jmc       264: .Xr sshd 8
1.17      jmc       265: receiving any messages back from the client.
                    266: If this threshold is reached while client alive messages are being sent,
1.52      jmc       267: sshd will disconnect the client, terminating the session.
1.17      jmc       268: It is important to note that the use of client alive messages is very
                    269: different from
1.27      markus    270: .Cm TCPKeepAlive
1.17      jmc       271: (below).
                    272: The client alive messages are sent through the encrypted channel
                    273: and therefore will not be spoofable.
                    274: The TCP keepalive option enabled by
1.27      markus    275: .Cm TCPKeepAlive
1.17      jmc       276: is spoofable.
                    277: The client alive mechanism is valuable when the client or
1.1       stevesk   278: server depend on knowing when a connection has become inactive.
                    279: .Pp
1.17      jmc       280: The default value is 3.
                    281: If
1.1       stevesk   282: .Cm ClientAliveInterval
1.48      jmc       283: (see below) is set to 15, and
1.1       stevesk   284: .Cm ClientAliveCountMax
1.52      jmc       285: is left at the default, unresponsive SSH clients
1.1       stevesk   286: will be disconnected after approximately 45 seconds.
1.57      markus    287: This option applies to protocol version 2 only.
1.42      djm       288: .It Cm ClientAliveInterval
                    289: Sets a timeout interval in seconds after which if no data has been received
                    290: from the client,
1.52      jmc       291: .Xr sshd 8
1.42      djm       292: will send a message through the encrypted
                    293: channel to request a response from the client.
                    294: The default
                    295: is 0, indicating that these messages will not be sent to the client.
                    296: This option applies to protocol version 2 only.
1.3       markus    297: .It Cm Compression
1.44      markus    298: Specifies whether compression is allowed, or delayed until
                    299: the user has authenticated successfully.
1.3       markus    300: The argument must be
1.44      markus    301: .Dq yes ,
                    302: .Dq delayed ,
1.3       markus    303: or
                    304: .Dq no .
                    305: The default is
1.44      markus    306: .Dq delayed .
1.1       stevesk   307: .It Cm DenyGroups
                    308: This keyword can be followed by a list of group name patterns, separated
                    309: by spaces.
                    310: Login is disallowed for users whose primary group or supplementary
                    311: group list matches one of the patterns.
                    312: Only group names are valid; a numerical group ID is not recognized.
                    313: By default, login is allowed for all groups.
1.54      jmc       314: The allow/deny directives are processed in the following order:
                    315: .Cm DenyUsers ,
                    316: .Cm AllowUsers ,
                    317: .Cm DenyGroups ,
                    318: and finally
                    319: .Cm AllowGroups .
1.49      jmc       320: .Pp
                    321: See
                    322: .Sx PATTERNS
                    323: in
                    324: .Xr ssh_config 5
                    325: for more information on patterns.
1.1       stevesk   326: .It Cm DenyUsers
                    327: This keyword can be followed by a list of user name patterns, separated
                    328: by spaces.
                    329: Login is disallowed for user names that match one of the patterns.
                    330: Only user names are valid; a numerical user ID is not recognized.
                    331: By default, login is allowed for all users.
                    332: If the pattern takes the form USER@HOST then USER and HOST
                    333: are separately checked, restricting logins to particular
                    334: users from particular hosts.
1.54      jmc       335: The allow/deny directives are processed in the following order:
                    336: .Cm DenyUsers ,
                    337: .Cm AllowUsers ,
                    338: .Cm DenyGroups ,
                    339: and finally
                    340: .Cm AllowGroups .
1.49      jmc       341: .Pp
                    342: See
                    343: .Sx PATTERNS
                    344: in
                    345: .Xr ssh_config 5
                    346: for more information on patterns.
1.67      dtucker   347: .It Cm ForceCommand
                    348: Forces the execution of the command specified by
                    349: .Cm ForceCommand ,
1.84      djm       350: ignoring any command supplied by the client and
                    351: .Pa ~/.ssh/rc
                    352: if present.
1.67      dtucker   353: The command is invoked by using the user's login shell with the -c option.
                    354: This applies to shell, command, or subsystem execution.
                    355: It is most useful inside a
                    356: .Cm Match
                    357: block.
                    358: The command originally supplied by the client is available in the
                    359: .Ev SSH_ORIGINAL_COMMAND
                    360: environment variable.
1.82      djm       361: Specifying a command of
                    362: .Dq internal-sftp
                    363: will force the use of an in-process sftp server that requires no support
                    364: files when used with
                    365: .Cm ChrootDirectory .
1.85    ! djm       366: Note that
        !           367: .Dq internal-sftp
        !           368: is only supported when
        !           369: .Cm UsePrivilegeSeparation
        !           370: is enabled.
1.1       stevesk   371: .It Cm GatewayPorts
                    372: Specifies whether remote hosts are allowed to connect to ports
                    373: forwarded for the client.
                    374: By default,
1.52      jmc       375: .Xr sshd 8
1.15      jmc       376: binds remote port forwardings to the loopback address.
                    377: This prevents other remote hosts from connecting to forwarded ports.
1.1       stevesk   378: .Cm GatewayPorts
1.52      jmc       379: can be used to specify that sshd
1.39      djm       380: should allow remote port forwardings to bind to non-loopback addresses, thus
                    381: allowing other hosts to connect.
                    382: The argument may be
                    383: .Dq no
                    384: to force remote port forwardings to be available to the local host only,
1.1       stevesk   385: .Dq yes
1.39      djm       386: to force remote port forwardings to bind to the wildcard address, or
                    387: .Dq clientspecified
                    388: to allow the client to select the address to which the forwarding is bound.
1.1       stevesk   389: The default is
                    390: .Dq no .
1.23      markus    391: .It Cm GSSAPIAuthentication
1.25      markus    392: Specifies whether user authentication based on GSSAPI is allowed.
1.26      djm       393: The default is
1.23      markus    394: .Dq no .
                    395: Note that this option applies to protocol version 2 only.
                    396: .It Cm GSSAPICleanupCredentials
                    397: Specifies whether to automatically destroy the user's credentials cache
                    398: on logout.
                    399: The default is
                    400: .Dq yes .
                    401: Note that this option applies to protocol version 2 only.
1.1       stevesk   402: .It Cm HostbasedAuthentication
                    403: Specifies whether rhosts or /etc/hosts.equiv authentication together
                    404: with successful public key client host authentication is allowed
1.50      jmc       405: (host-based authentication).
1.1       stevesk   406: This option is similar to
                    407: .Cm RhostsRSAAuthentication
                    408: and applies to protocol version 2 only.
1.70      dtucker   409: The default is
                    410: .Dq no .
                    411: .It Cm HostbasedUsesNameFromPacketOnly
                    412: Specifies whether or not the server will attempt to perform a reverse
                    413: name lookup when matching the name in the
                    414: .Pa ~/.shosts ,
                    415: .Pa ~/.rhosts ,
                    416: and
                    417: .Pa /etc/hosts.equiv
                    418: files during
                    419: .Cm HostbasedAuthentication .
                    420: A setting of
                    421: .Dq yes
                    422: means that
                    423: .Xr sshd 8
                    424: uses the name supplied by the client rather than
                    425: attempting to resolve the name from the TCP connection itself.
1.1       stevesk   426: The default is
                    427: .Dq no .
                    428: .It Cm HostKey
                    429: Specifies a file containing a private host key
                    430: used by SSH.
                    431: The default is
                    432: .Pa /etc/ssh/ssh_host_key
                    433: for protocol version 1, and
                    434: .Pa /etc/ssh/ssh_host_rsa_key
                    435: and
                    436: .Pa /etc/ssh/ssh_host_dsa_key
                    437: for protocol version 2.
                    438: Note that
1.52      jmc       439: .Xr sshd 8
1.1       stevesk   440: will refuse to use a file if it is group/world-accessible.
                    441: It is possible to have multiple host key files.
                    442: .Dq rsa1
                    443: keys are used for version 1 and
                    444: .Dq dsa
                    445: or
                    446: .Dq rsa
                    447: are used for version 2 of the SSH protocol.
                    448: .It Cm IgnoreRhosts
                    449: Specifies that
                    450: .Pa .rhosts
                    451: and
                    452: .Pa .shosts
                    453: files will not be used in
                    454: .Cm RhostsRSAAuthentication
                    455: or
                    456: .Cm HostbasedAuthentication .
                    457: .Pp
                    458: .Pa /etc/hosts.equiv
                    459: and
                    460: .Pa /etc/shosts.equiv
                    461: are still used.
                    462: The default is
                    463: .Dq yes .
                    464: .It Cm IgnoreUserKnownHosts
                    465: Specifies whether
1.52      jmc       466: .Xr sshd 8
1.1       stevesk   467: should ignore the user's
1.41      djm       468: .Pa ~/.ssh/known_hosts
1.1       stevesk   469: during
                    470: .Cm RhostsRSAAuthentication
                    471: or
                    472: .Cm HostbasedAuthentication .
                    473: The default is
                    474: .Dq no .
                    475: .It Cm KerberosAuthentication
1.24      markus    476: Specifies whether the password provided by the user for
1.1       stevesk   477: .Cm PasswordAuthentication
1.24      markus    478: will be validated through the Kerberos KDC.
1.1       stevesk   479: To use this option, the server needs a
                    480: Kerberos servtab which allows the verification of the KDC's identity.
1.52      jmc       481: The default is
1.29      dtucker   482: .Dq no .
                    483: .It Cm KerberosGetAFSToken
1.45      djm       484: If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
1.29      dtucker   485: an AFS token before accessing the user's home directory.
1.52      jmc       486: The default is
1.1       stevesk   487: .Dq no .
                    488: .It Cm KerberosOrLocalPasswd
1.52      jmc       489: If password authentication through Kerberos fails then
1.1       stevesk   490: the password will be validated via any additional local mechanism
                    491: such as
                    492: .Pa /etc/passwd .
1.52      jmc       493: The default is
1.1       stevesk   494: .Dq yes .
                    495: .It Cm KerberosTicketCleanup
                    496: Specifies whether to automatically destroy the user's ticket cache
                    497: file on logout.
1.52      jmc       498: The default is
1.1       stevesk   499: .Dq yes .
                    500: .It Cm KeyRegenerationInterval
                    501: In protocol version 1, the ephemeral server key is automatically regenerated
                    502: after this many seconds (if it has been used).
                    503: The purpose of regeneration is to prevent
                    504: decrypting captured sessions by later breaking into the machine and
                    505: stealing the keys.
                    506: The key is never stored anywhere.
                    507: If the value is 0, the key is never regenerated.
                    508: The default is 3600 (seconds).
                    509: .It Cm ListenAddress
                    510: Specifies the local addresses
1.52      jmc       511: .Xr sshd 8
1.1       stevesk   512: should listen on.
                    513: The following forms may be used:
                    514: .Pp
                    515: .Bl -item -offset indent -compact
                    516: .It
                    517: .Cm ListenAddress
                    518: .Sm off
                    519: .Ar host No | Ar IPv4_addr No | Ar IPv6_addr
                    520: .Sm on
                    521: .It
                    522: .Cm ListenAddress
                    523: .Sm off
                    524: .Ar host No | Ar IPv4_addr No : Ar port
                    525: .Sm on
                    526: .It
                    527: .Cm ListenAddress
                    528: .Sm off
                    529: .Oo
                    530: .Ar host No | Ar IPv6_addr Oc : Ar port
                    531: .Sm on
                    532: .El
                    533: .Pp
                    534: If
                    535: .Ar port
                    536: is not specified,
1.52      jmc       537: sshd will listen on the address and all prior
1.1       stevesk   538: .Cm Port
1.17      jmc       539: options specified.
                    540: The default is to listen on all local addresses.
1.15      jmc       541: Multiple
1.1       stevesk   542: .Cm ListenAddress
1.17      jmc       543: options are permitted.
                    544: Additionally, any
1.1       stevesk   545: .Cm Port
1.52      jmc       546: options must precede this option for non-port qualified addresses.
1.1       stevesk   547: .It Cm LoginGraceTime
                    548: The server disconnects after this time if the user has not
                    549: successfully logged in.
                    550: If the value is 0, there is no time limit.
1.12      stevesk   551: The default is 120 seconds.
1.1       stevesk   552: .It Cm LogLevel
                    553: Gives the verbosity level that is used when logging messages from
1.53      jmc       554: .Xr sshd 8 .
1.1       stevesk   555: The possible values are:
1.52      jmc       556: QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
1.15      jmc       557: The default is INFO.
                    558: DEBUG and DEBUG1 are equivalent.
                    559: DEBUG2 and DEBUG3 each specify higher levels of debugging output.
                    560: Logging with a DEBUG level violates the privacy of users and is not recommended.
1.1       stevesk   561: .It Cm MACs
                    562: Specifies the available MAC (message authentication code) algorithms.
                    563: The MAC algorithm is used in protocol version 2
                    564: for data integrity protection.
                    565: Multiple algorithms must be comma-separated.
1.52      jmc       566: The default is:
1.77      jmc       567: .Bd -literal -offset indent
                    568: hmac-md5,hmac-sha1,umac-64@openssh.com,
                    569: hmac-ripemd160,hmac-sha1-96,hmac-md5-96
                    570: .Ed
1.60      dtucker   571: .It Cm Match
1.61      jmc       572: Introduces a conditional block.
1.65      dtucker   573: If all of the criteria on the
1.60      dtucker   574: .Cm Match
1.65      dtucker   575: line are satisfied, the keywords on the following lines override those
                    576: set in the global section of the config file, until either another
1.60      dtucker   577: .Cm Match
1.65      dtucker   578: line or the end of the file.
1.61      jmc       579: The arguments to
1.60      dtucker   580: .Cm Match
1.65      dtucker   581: are one or more criteria-pattern pairs.
1.60      dtucker   582: The available criteria are
                    583: .Cm User ,
1.69      dtucker   584: .Cm Group ,
1.60      dtucker   585: .Cm Host ,
                    586: and
                    587: .Cm Address .
                    588: Only a subset of keywords may be used on the lines following a
                    589: .Cm Match
                    590: keyword.
                    591: Available keywords are
1.62      dtucker   592: .Cm AllowTcpForwarding ,
1.72      dtucker   593: .Cm Banner ,
1.85    ! djm       594: .Cm ChrootDirectory ,
1.67      dtucker   595: .Cm ForceCommand ,
1.62      dtucker   596: .Cm GatewayPorts ,
1.72      dtucker   597: .Cm GSSApiAuthentication ,
1.74      jmc       598: .Cm KbdInteractiveAuthentication ,
1.72      dtucker   599: .Cm KerberosAuthentication ,
                    600: .Cm PasswordAuthentication ,
1.66      dtucker   601: .Cm PermitOpen ,
1.79      dtucker   602: .Cm PermitRootLogin ,
1.72      dtucker   603: .Cm RhostsRSAAuthentication ,
                    604: .Cm RSAAuthentication ,
1.66      dtucker   605: .Cm X11DisplayOffset ,
                    606: .Cm X11Forwarding ,
1.60      dtucker   607: and
1.66      dtucker   608: .Cm X11UseLocalHost .
1.33      dtucker   609: .It Cm MaxAuthTries
                    610: Specifies the maximum number of authentication attempts permitted per
1.35      jmc       611: connection.
                    612: Once the number of failures reaches half this value,
                    613: additional failures are logged.
                    614: The default is 6.
1.1       stevesk   615: .It Cm MaxStartups
                    616: Specifies the maximum number of concurrent unauthenticated connections to the
1.52      jmc       617: SSH daemon.
1.1       stevesk   618: Additional connections will be dropped until authentication succeeds or the
                    619: .Cm LoginGraceTime
                    620: expires for a connection.
                    621: The default is 10.
                    622: .Pp
                    623: Alternatively, random early drop can be enabled by specifying
                    624: the three colon separated values
                    625: .Dq start:rate:full
1.51      jmc       626: (e.g. "10:30:60").
1.53      jmc       627: .Xr sshd 8
1.1       stevesk   628: will refuse connection attempts with a probability of
                    629: .Dq rate/100
                    630: (30%)
                    631: if there are currently
                    632: .Dq start
                    633: (10)
                    634: unauthenticated connections.
                    635: The probability increases linearly and all connection attempts
                    636: are refused if the number of unauthenticated connections reaches
                    637: .Dq full
                    638: (60).
                    639: .It Cm PasswordAuthentication
                    640: Specifies whether password authentication is allowed.
                    641: The default is
                    642: .Dq yes .
                    643: .It Cm PermitEmptyPasswords
                    644: When password authentication is allowed, it specifies whether the
                    645: server allows login to accounts with empty password strings.
                    646: The default is
                    647: .Dq no .
1.62      dtucker   648: .It Cm PermitOpen
                    649: Specifies the destinations to which TCP port forwarding is permitted.
                    650: The forwarding specification must be one of the following forms:
                    651: .Pp
                    652: .Bl -item -offset indent -compact
                    653: .It
                    654: .Cm PermitOpen
                    655: .Sm off
                    656: .Ar host : port
                    657: .Sm on
                    658: .It
                    659: .Cm PermitOpen
                    660: .Sm off
                    661: .Ar IPv4_addr : port
                    662: .Sm on
                    663: .It
                    664: .Cm PermitOpen
                    665: .Sm off
                    666: .Ar \&[ IPv6_addr \&] : port
                    667: .Sm on
                    668: .El
                    669: .Pp
1.68      dtucker   670: Multiple forwards may be specified by separating them with whitespace.
1.62      dtucker   671: An argument of
                    672: .Dq any
                    673: can be used to remove all restrictions and permit any forwarding requests.
1.63      jmc       674: By default all port forwarding requests are permitted.
1.1       stevesk   675: .It Cm PermitRootLogin
1.38      jmc       676: Specifies whether root can log in using
1.1       stevesk   677: .Xr ssh 1 .
                    678: The argument must be
                    679: .Dq yes ,
                    680: .Dq without-password ,
1.52      jmc       681: .Dq forced-commands-only ,
1.1       stevesk   682: or
                    683: .Dq no .
                    684: The default is
                    685: .Dq yes .
                    686: .Pp
                    687: If this option is set to
1.52      jmc       688: .Dq without-password ,
1.1       stevesk   689: password authentication is disabled for root.
                    690: .Pp
                    691: If this option is set to
1.52      jmc       692: .Dq forced-commands-only ,
1.1       stevesk   693: root login with public key authentication will be allowed,
                    694: but only if the
                    695: .Ar command
                    696: option has been specified
                    697: (which may be useful for taking remote backups even if root login is
1.17      jmc       698: normally not allowed).
                    699: All other authentication methods are disabled for root.
1.1       stevesk   700: .Pp
                    701: If this option is set to
1.52      jmc       702: .Dq no ,
1.38      jmc       703: root is not allowed to log in.
1.46      reyk      704: .It Cm PermitTunnel
                    705: Specifies whether
                    706: .Xr tun 4
                    707: device forwarding is allowed.
1.47      reyk      708: The argument must be
                    709: .Dq yes ,
1.58      stevesk   710: .Dq point-to-point
                    711: (layer 3),
                    712: .Dq ethernet
                    713: (layer 2), or
1.47      reyk      714: .Dq no .
1.58      stevesk   715: Specifying
                    716: .Dq yes
                    717: permits both
                    718: .Dq point-to-point
                    719: and
                    720: .Dq ethernet .
1.46      reyk      721: The default is
                    722: .Dq no .
1.6       markus    723: .It Cm PermitUserEnvironment
                    724: Specifies whether
                    725: .Pa ~/.ssh/environment
1.9       stevesk   726: and
1.6       markus    727: .Cm environment=
                    728: options in
                    729: .Pa ~/.ssh/authorized_keys
1.9       stevesk   730: are processed by
1.52      jmc       731: .Xr sshd 8 .
1.6       markus    732: The default is
                    733: .Dq no .
1.9       stevesk   734: Enabling environment processing may enable users to bypass access
                    735: restrictions in some configurations using mechanisms such as
                    736: .Ev LD_PRELOAD .
1.1       stevesk   737: .It Cm PidFile
1.4       stevesk   738: Specifies the file that contains the process ID of the
1.53      jmc       739: SSH daemon.
1.1       stevesk   740: The default is
                    741: .Pa /var/run/sshd.pid .
                    742: .It Cm Port
                    743: Specifies the port number that
1.52      jmc       744: .Xr sshd 8
1.1       stevesk   745: listens on.
                    746: The default is 22.
                    747: Multiple options of this type are permitted.
                    748: See also
                    749: .Cm ListenAddress .
                    750: .It Cm PrintLastLog
                    751: Specifies whether
1.52      jmc       752: .Xr sshd 8
1.36      jaredy    753: should print the date and time of the last user login when a user logs
                    754: in interactively.
1.1       stevesk   755: The default is
                    756: .Dq yes .
                    757: .It Cm PrintMotd
                    758: Specifies whether
1.52      jmc       759: .Xr sshd 8
1.1       stevesk   760: should print
                    761: .Pa /etc/motd
                    762: when a user logs in interactively.
                    763: (On some systems it is also printed by the shell,
                    764: .Pa /etc/profile ,
                    765: or equivalent.)
                    766: The default is
                    767: .Dq yes .
                    768: .It Cm Protocol
                    769: Specifies the protocol versions
1.52      jmc       770: .Xr sshd 8
1.5       stevesk   771: supports.
1.1       stevesk   772: The possible values are
1.52      jmc       773: .Sq 1
1.1       stevesk   774: and
1.52      jmc       775: .Sq 2 .
1.1       stevesk   776: Multiple versions must be comma-separated.
                    777: The default is
                    778: .Dq 2,1 .
1.5       stevesk   779: Note that the order of the protocol list does not indicate preference,
                    780: because the client selects among multiple protocol versions offered
                    781: by the server.
                    782: Specifying
                    783: .Dq 2,1
                    784: is identical to
                    785: .Dq 1,2 .
1.1       stevesk   786: .It Cm PubkeyAuthentication
                    787: Specifies whether public key authentication is allowed.
                    788: The default is
                    789: .Dq yes .
                    790: Note that this option applies to protocol version 2 only.
                    791: .It Cm RhostsRSAAuthentication
                    792: Specifies whether rhosts or /etc/hosts.equiv authentication together
                    793: with successful RSA host authentication is allowed.
                    794: The default is
                    795: .Dq no .
                    796: This option applies to protocol version 1 only.
                    797: .It Cm RSAAuthentication
                    798: Specifies whether pure RSA authentication is allowed.
                    799: The default is
                    800: .Dq yes .
                    801: This option applies to protocol version 1 only.
                    802: .It Cm ServerKeyBits
                    803: Defines the number of bits in the ephemeral protocol version 1 server key.
                    804: The minimum value is 512, and the default is 768.
                    805: .It Cm StrictModes
                    806: Specifies whether
1.52      jmc       807: .Xr sshd 8
1.1       stevesk   808: should check file modes and ownership of the
                    809: user's files and home directory before accepting login.
                    810: This is normally desirable because novices sometimes accidentally leave their
                    811: directory or files world-writable.
                    812: The default is
                    813: .Dq yes .
                    814: .It Cm Subsystem
1.51      jmc       815: Configures an external subsystem (e.g. file transfer daemon).
1.59      djm       816: Arguments should be a subsystem name and a command (with optional arguments)
                    817: to execute upon subsystem request.
1.80      djm       818: .Pp
1.1       stevesk   819: The command
                    820: .Xr sftp-server 8
                    821: implements the
                    822: .Dq sftp
                    823: file transfer subsystem.
1.80      djm       824: .Pp
                    825: Alternately the name
                    826: .Dq internal-sftp
                    827: implements an in-process
                    828: .Dq sftp
                    829: server.
                    830: This may simplify configurations using
                    831: .Cm ChrootDirectory
                    832: to force a different filesystem root on clients.
1.85    ! djm       833: Note that
        !           834: .Dq internal-sftp
        !           835: is only supported when
        !           836: .Cm UsePrivilegeSeparation
        !           837: is enabled.
1.80      djm       838: .Pp
1.1       stevesk   839: By default no subsystems are defined.
                    840: Note that this option applies to protocol version 2 only.
                    841: .It Cm SyslogFacility
                    842: Gives the facility code that is used when logging messages from
1.53      jmc       843: .Xr sshd 8 .
1.1       stevesk   844: The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
                    845: LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
                    846: The default is AUTH.
1.27      markus    847: .It Cm TCPKeepAlive
                    848: Specifies whether the system should send TCP keepalive messages to the
                    849: other side.
                    850: If they are sent, death of the connection or crash of one
                    851: of the machines will be properly noticed.
                    852: However, this means that
                    853: connections will die if the route is down temporarily, and some people
                    854: find it annoying.
                    855: On the other hand, if TCP keepalives are not sent,
                    856: sessions may hang indefinitely on the server, leaving
                    857: .Dq ghost
                    858: users and consuming server resources.
                    859: .Pp
                    860: The default is
                    861: .Dq yes
                    862: (to send TCP keepalive messages), and the server will notice
                    863: if the network goes down or the client host crashes.
                    864: This avoids infinitely hanging sessions.
                    865: .Pp
                    866: To disable TCP keepalive messages, the value should be set to
                    867: .Dq no .
1.18      markus    868: .It Cm UseDNS
                    869: Specifies whether
1.52      jmc       870: .Xr sshd 8
1.40      jmc       871: should look up the remote host name and check that
1.18      markus    872: the resolved host name for the remote IP address maps back to the
                    873: very same IP address.
                    874: The default is
                    875: .Dq yes .
1.1       stevesk   876: .It Cm UseLogin
                    877: Specifies whether
                    878: .Xr login 1
                    879: is used for interactive login sessions.
                    880: The default is
                    881: .Dq no .
                    882: Note that
                    883: .Xr login 1
                    884: is never used for remote command execution.
                    885: Note also, that if this is enabled,
                    886: .Cm X11Forwarding
                    887: will be disabled because
                    888: .Xr login 1
                    889: does not know how to handle
                    890: .Xr xauth 1
1.15      jmc       891: cookies.
                    892: If
1.1       stevesk   893: .Cm UsePrivilegeSeparation
                    894: is specified, it will be disabled after authentication.
                    895: .It Cm UsePrivilegeSeparation
                    896: Specifies whether
1.52      jmc       897: .Xr sshd 8
1.2       stevesk   898: separates privileges by creating an unprivileged child process
1.15      jmc       899: to deal with incoming network traffic.
                    900: After successful authentication, another process will be created that has
                    901: the privilege of the authenticated user.
                    902: The goal of privilege separation is to prevent privilege
1.1       stevesk   903: escalation by containing any corruption within the unprivileged processes.
                    904: The default is
                    905: .Dq yes .
                    906: .It Cm X11DisplayOffset
                    907: Specifies the first display number available for
1.52      jmc       908: .Xr sshd 8 Ns 's
1.1       stevesk   909: X11 forwarding.
1.52      jmc       910: This prevents sshd from interfering with real X11 servers.
1.1       stevesk   911: The default is 10.
                    912: .It Cm X11Forwarding
                    913: Specifies whether X11 forwarding is permitted.
1.13      stevesk   914: The argument must be
                    915: .Dq yes
                    916: or
                    917: .Dq no .
1.1       stevesk   918: The default is
                    919: .Dq no .
1.13      stevesk   920: .Pp
                    921: When X11 forwarding is enabled, there may be additional exposure to
                    922: the server and to client displays if the
1.52      jmc       923: .Xr sshd 8
1.13      stevesk   924: proxy display is configured to listen on the wildcard address (see
                    925: .Cm X11UseLocalhost
1.52      jmc       926: below), though this is not the default.
1.13      stevesk   927: Additionally, the authentication spoofing and authentication data
                    928: verification and substitution occur on the client side.
                    929: The security risk of using X11 forwarding is that the client's X11
1.52      jmc       930: display server may be exposed to attack when the SSH client requests
1.13      stevesk   931: forwarding (see the warnings for
                    932: .Cm ForwardX11
                    933: in
1.19      jmc       934: .Xr ssh_config 5 ) .
1.13      stevesk   935: A system administrator may have a stance in which they want to
                    936: protect clients that may expose themselves to attack by unwittingly
                    937: requesting X11 forwarding, which can warrant a
                    938: .Dq no
                    939: setting.
                    940: .Pp
                    941: Note that disabling X11 forwarding does not prevent users from
                    942: forwarding X11 traffic, as users can always install their own forwarders.
1.1       stevesk   943: X11 forwarding is automatically disabled if
                    944: .Cm UseLogin
                    945: is enabled.
                    946: .It Cm X11UseLocalhost
                    947: Specifies whether
1.52      jmc       948: .Xr sshd 8
1.1       stevesk   949: should bind the X11 forwarding server to the loopback address or to
1.15      jmc       950: the wildcard address.
                    951: By default,
1.52      jmc       952: sshd binds the forwarding server to the loopback address and sets the
1.1       stevesk   953: hostname part of the
                    954: .Ev DISPLAY
                    955: environment variable to
                    956: .Dq localhost .
1.8       stevesk   957: This prevents remote hosts from connecting to the proxy display.
1.1       stevesk   958: However, some older X11 clients may not function with this
                    959: configuration.
                    960: .Cm X11UseLocalhost
                    961: may be set to
                    962: .Dq no
                    963: to specify that the forwarding server should be bound to the wildcard
                    964: address.
                    965: The argument must be
                    966: .Dq yes
                    967: or
                    968: .Dq no .
                    969: The default is
                    970: .Dq yes .
                    971: .It Cm XAuthLocation
1.11      stevesk   972: Specifies the full pathname of the
1.1       stevesk   973: .Xr xauth 1
                    974: program.
                    975: The default is
                    976: .Pa /usr/X11R6/bin/xauth .
                    977: .El
1.55      jmc       978: .Sh TIME FORMATS
1.53      jmc       979: .Xr sshd 8
1.1       stevesk   980: command-line arguments and configuration file options that specify time
                    981: may be expressed using a sequence of the form:
                    982: .Sm off
1.7       stevesk   983: .Ar time Op Ar qualifier ,
1.1       stevesk   984: .Sm on
                    985: where
                    986: .Ar time
                    987: is a positive integer value and
                    988: .Ar qualifier
                    989: is one of the following:
                    990: .Pp
                    991: .Bl -tag -width Ds -compact -offset indent
1.64      jmc       992: .It Aq Cm none
1.1       stevesk   993: seconds
                    994: .It Cm s | Cm S
                    995: seconds
                    996: .It Cm m | Cm M
                    997: minutes
                    998: .It Cm h | Cm H
                    999: hours
                   1000: .It Cm d | Cm D
                   1001: days
                   1002: .It Cm w | Cm W
                   1003: weeks
                   1004: .El
                   1005: .Pp
                   1006: Each member of the sequence is added together to calculate
                   1007: the total time value.
                   1008: .Pp
                   1009: Time format examples:
                   1010: .Pp
                   1011: .Bl -tag -width Ds -compact -offset indent
                   1012: .It 600
                   1013: 600 seconds (10 minutes)
                   1014: .It 10m
                   1015: 10 minutes
                   1016: .It 1h30m
                   1017: 1 hour 30 minutes (90 minutes)
                   1018: .El
                   1019: .Sh FILES
                   1020: .Bl -tag -width Ds
                   1021: .It Pa /etc/ssh/sshd_config
                   1022: Contains configuration data for
1.53      jmc      1023: .Xr sshd 8 .
1.1       stevesk  1024: This file should be writable by root only, but it is recommended
                   1025: (though not necessary) that it be world-readable.
                   1026: .El
1.19      jmc      1027: .Sh SEE ALSO
                   1028: .Xr sshd 8
1.1       stevesk  1029: .Sh AUTHORS
                   1030: OpenSSH is a derivative of the original and free
                   1031: ssh 1.2.12 release by Tatu Ylonen.
                   1032: Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
                   1033: Theo de Raadt and Dug Song
                   1034: removed many bugs, re-added newer features and
                   1035: created OpenSSH.
                   1036: Markus Friedl contributed the support for SSH
                   1037: protocol versions 1.5 and 2.0.
                   1038: Niels Provos and Markus Friedl contributed support
                   1039: for privilege separation.