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