blob: 446e59afdff88d451cc7bba16916aca18ad857cd [file] [log] [blame]
Ben Lindstrom9f049032002-06-21 00:59:05 +00001.\" -*- 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.\"
Damien Millere3beba22006-03-15 11:59:25 +110037.\" $OpenBSD: sshd_config.5,v 1.55 2006/02/26 18:01:13 jmc Exp $
Ben Lindstrom9f049032002-06-21 00:59:05 +000038.Dd September 25, 1999
39.Dt SSHD_CONFIG 5
40.Os
41.Sh NAME
42.Nm sshd_config
43.Nd OpenSSH SSH daemon configuration file
44.Sh SYNOPSIS
45.Bl -tag -width Ds -compact
46.It Pa /etc/ssh/sshd_config
47.El
48.Sh DESCRIPTION
Damien Millerf4f22b52006-03-15 11:57:25 +110049.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +000050reads configuration data from
51.Pa /etc/ssh/sshd_config
52(or the file specified with
53.Fl f
54on the command line).
55The file contains keyword-argument pairs, one per line.
56Lines starting with
57.Ql #
58and empty lines are interpreted as comments.
59.Pp
60The possible
61keywords and their meanings are as follows (note that
62keywords are case-insensitive and arguments are case-sensitive):
63.Bl -tag -width Ds
Darren Tucker46bc0752004-05-02 22:11:30 +100064.It Cm AcceptEnv
65Specifies what environment variables sent by the client will be copied into
66the session's
67.Xr environ 7 .
68See
69.Cm SendEnv
70in
71.Xr ssh_config 5
72for how to configure the client.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100073Note that environment passing is only supported for protocol 2.
Darren Tucker46bc0752004-05-02 22:11:30 +100074Variables are specified by name, which may contain the wildcard characters
Damien Miller208f1ed2006-03-15 11:56:03 +110075.Ql *
Darren Tucker46bc0752004-05-02 22:11:30 +100076and
77.Ql \&? .
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100078Multiple environment variables may be separated by whitespace or spread
Darren Tucker46bc0752004-05-02 22:11:30 +100079across multiple
80.Cm AcceptEnv
81directives.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100082Be warned that some environment variables could be used to bypass restricted
Darren Tucker46bc0752004-05-02 22:11:30 +100083user environments.
84For this reason, care should be taken in the use of this directive.
85The default is not to accept any environment variables.
Darren Tucker0f383232005-01-20 10:57:56 +110086.It Cm AddressFamily
87Specifies which address family should be used by
Damien Millerf4f22b52006-03-15 11:57:25 +110088.Xr sshd 8 .
Darren Tucker0f383232005-01-20 10:57:56 +110089Valid arguments are
90.Dq any ,
91.Dq inet
Damien Miller5b0d63f2006-03-15 11:56:56 +110092(use IPv4 only), or
Darren Tucker0f383232005-01-20 10:57:56 +110093.Dq inet6
94(use IPv6 only).
95The default is
96.Dq any .
Ben Lindstrom9f049032002-06-21 00:59:05 +000097.It Cm AllowGroups
98This keyword can be followed by a list of group name patterns, separated
99by spaces.
100If specified, login is allowed only for users whose primary
101group or supplementary group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000102Only group names are valid; a numerical group ID is not recognized.
103By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100104The allow/deny directives are processed in the following order:
105.Cm DenyUsers ,
106.Cm AllowUsers ,
107.Cm DenyGroups ,
108and finally
109.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100110.Pp
111See
112.Sx PATTERNS
113in
114.Xr ssh_config 5
115for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000116.It Cm AllowTcpForwarding
117Specifies whether TCP forwarding is permitted.
118The default is
119.Dq yes .
120Note that disabling TCP forwarding does not improve security unless
121users are also denied shell access, as they can always install their
122own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000123.It Cm AllowUsers
124This keyword can be followed by a list of user name patterns, separated
125by spaces.
Damien Miller5a93add2003-01-24 11:34:52 +1100126If specified, login is allowed only for user names that
Ben Lindstrom9f049032002-06-21 00:59:05 +0000127match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000128Only user names are valid; a numerical user ID is not recognized.
129By default, login is allowed for all users.
130If the pattern takes the form USER@HOST then USER and HOST
131are separately checked, restricting logins to particular
132users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100133The allow/deny directives are processed in the following order:
134.Cm DenyUsers ,
135.Cm AllowUsers ,
136.Cm DenyGroups ,
137and finally
138.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100139.Pp
140See
141.Sx PATTERNS
142in
143.Xr ssh_config 5
144for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000145.It Cm AuthorizedKeysFile
146Specifies the file that contains the public keys that can be used
147for user authentication.
148.Cm AuthorizedKeysFile
149may contain tokens of the form %T which are substituted during connection
Damien Miller5b0d63f2006-03-15 11:56:56 +1100150setup.
Damien Millerfbf486b2003-05-23 18:44:23 +1000151The following tokens are defined: %% is replaced by a literal '%',
Damien Miller5b0d63f2006-03-15 11:56:56 +1100152%h is replaced by the home directory of the user being authenticated, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000153%u is replaced by the username of that user.
154After expansion,
155.Cm AuthorizedKeysFile
156is taken to be an absolute path or one relative to the user's home
157directory.
158The default is
159.Dq .ssh/authorized_keys .
160.It Cm Banner
161In some jurisdictions, sending a warning message before authentication
162may be relevant for getting legal protection.
163The contents of the specified file are sent to the remote user before
164authentication is allowed.
165This option is only available for protocol version 2.
166By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000167.It Cm ChallengeResponseAuthentication
Damien Miller1faa7132006-03-15 11:55:31 +1100168Specifies whether challenge-response authentication is allowed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000169All authentication styles from
170.Xr login.conf 5
171are supported.
172The default is
173.Dq yes .
174.It Cm Ciphers
175Specifies the ciphers allowed for protocol version 2.
176Multiple ciphers must be comma-separated.
Damien Miller05202ff2004-06-15 10:30:39 +1000177The supported ciphers are
178.Dq 3des-cbc ,
179.Dq aes128-cbc ,
180.Dq aes192-cbc ,
181.Dq aes256-cbc ,
182.Dq aes128-ctr ,
183.Dq aes192-ctr ,
184.Dq aes256-ctr ,
Damien Miller3710f272005-05-26 12:19:17 +1000185.Dq arcfour128 ,
186.Dq arcfour256 ,
Damien Miller05202ff2004-06-15 10:30:39 +1000187.Dq arcfour ,
188.Dq blowfish-cbc ,
189and
190.Dq cast128-cbc .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100191The default is:
192.Bd -literal -offset 3n
193aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,
194arcfour256,arcfour,aes192-cbc,aes256-cbc,aes128-ctr,
195aes192-ctr,aes256-ctr
Ben Lindstrom9f049032002-06-21 00:59:05 +0000196.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +0000197.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100198Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000199sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100200.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000201receiving any messages back from the client.
202If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100203sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000204It is important to note that the use of client alive messages is very
205different from
Damien Miller12c150e2003-12-17 16:31:10 +1100206.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000207(below).
208The client alive messages are sent through the encrypted channel
209and therefore will not be spoofable.
210The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100211.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000212is spoofable.
213The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000214server depend on knowing when a connection has become inactive.
215.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000216The default value is 3.
217If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000218.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100219(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000220.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100221is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000222will be disconnected after approximately 45 seconds.
Damien Miller1594ad52005-05-26 12:12:19 +1000223.It Cm ClientAliveInterval
224Sets a timeout interval in seconds after which if no data has been received
225from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100226.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000227will send a message through the encrypted
228channel to request a response from the client.
229The default
230is 0, indicating that these messages will not be sent to the client.
231This option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000232.It Cm Compression
Damien Miller9786e6e2005-07-26 21:54:56 +1000233Specifies whether compression is allowed, or delayed until
234the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000235The argument must be
Damien Miller9786e6e2005-07-26 21:54:56 +1000236.Dq yes ,
237.Dq delayed ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000238or
239.Dq no .
240The default is
Damien Miller9786e6e2005-07-26 21:54:56 +1000241.Dq delayed .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000242.It Cm DenyGroups
243This keyword can be followed by a list of group name patterns, separated
244by spaces.
245Login is disallowed for users whose primary group or supplementary
246group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000247Only group names are valid; a numerical group ID is not recognized.
248By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100249The allow/deny directives are processed in the following order:
250.Cm DenyUsers ,
251.Cm AllowUsers ,
252.Cm DenyGroups ,
253and finally
254.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100255.Pp
256See
257.Sx PATTERNS
258in
259.Xr ssh_config 5
260for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000261.It Cm DenyUsers
262This keyword can be followed by a list of user name patterns, separated
263by spaces.
264Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000265Only user names are valid; a numerical user ID is not recognized.
266By default, login is allowed for all users.
267If the pattern takes the form USER@HOST then USER and HOST
268are separately checked, restricting logins to particular
269users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100270The allow/deny directives are processed in the following order:
271.Cm DenyUsers ,
272.Cm AllowUsers ,
273.Cm DenyGroups ,
274and finally
275.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100276.Pp
277See
278.Sx PATTERNS
279in
280.Xr ssh_config 5
281for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000282.It Cm GatewayPorts
283Specifies whether remote hosts are allowed to connect to ports
284forwarded for the client.
285By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100286.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000287binds remote port forwardings to the loopback address.
288This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000289.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100290can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100291should allow remote port forwardings to bind to non-loopback addresses, thus
292allowing other hosts to connect.
293The argument may be
294.Dq no
295to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000296.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100297to force remote port forwardings to bind to the wildcard address, or
298.Dq clientspecified
299to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000300The default is
301.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000302.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000303Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100304The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000305.Dq no .
306Note that this option applies to protocol version 2 only.
307.It Cm GSSAPICleanupCredentials
308Specifies whether to automatically destroy the user's credentials cache
309on logout.
310The default is
311.Dq yes .
312Note that this option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000313.It Cm HostbasedAuthentication
314Specifies whether rhosts or /etc/hosts.equiv authentication together
315with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100316(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000317This option is similar to
318.Cm RhostsRSAAuthentication
319and applies to protocol version 2 only.
320The default is
321.Dq no .
322.It Cm HostKey
323Specifies a file containing a private host key
324used by SSH.
325The default is
326.Pa /etc/ssh/ssh_host_key
327for protocol version 1, and
328.Pa /etc/ssh/ssh_host_rsa_key
329and
330.Pa /etc/ssh/ssh_host_dsa_key
331for protocol version 2.
332Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100333.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000334will refuse to use a file if it is group/world-accessible.
335It is possible to have multiple host key files.
336.Dq rsa1
337keys are used for version 1 and
338.Dq dsa
339or
340.Dq rsa
341are used for version 2 of the SSH protocol.
342.It Cm IgnoreRhosts
343Specifies that
344.Pa .rhosts
345and
346.Pa .shosts
347files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000348.Cm RhostsRSAAuthentication
349or
350.Cm HostbasedAuthentication .
351.Pp
352.Pa /etc/hosts.equiv
353and
354.Pa /etc/shosts.equiv
355are still used.
356The default is
357.Dq yes .
358.It Cm IgnoreUserKnownHosts
359Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100360.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000361should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000362.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000363during
364.Cm RhostsRSAAuthentication
365or
366.Cm HostbasedAuthentication .
367The default is
368.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000369.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000370Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000371.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000372will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000373To use this option, the server needs a
374Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100375The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000376.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100377.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000378If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100379an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100380The default is
Damien Miller8448e662004-03-08 23:13:15 +1100381.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000382.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100383If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000384the password will be validated via any additional local mechanism
385such as
386.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100387The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000388.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000389.It Cm KerberosTicketCleanup
390Specifies whether to automatically destroy the user's ticket cache
391file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100392The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000393.Dq yes .
394.It Cm KeyRegenerationInterval
395In protocol version 1, the ephemeral server key is automatically regenerated
396after this many seconds (if it has been used).
397The purpose of regeneration is to prevent
398decrypting captured sessions by later breaking into the machine and
399stealing the keys.
400The key is never stored anywhere.
401If the value is 0, the key is never regenerated.
402The default is 3600 (seconds).
403.It Cm ListenAddress
404Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100405.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000406should listen on.
407The following forms may be used:
408.Pp
409.Bl -item -offset indent -compact
410.It
411.Cm ListenAddress
412.Sm off
413.Ar host No | Ar IPv4_addr No | Ar IPv6_addr
414.Sm on
415.It
416.Cm ListenAddress
417.Sm off
418.Ar host No | Ar IPv4_addr No : Ar port
419.Sm on
420.It
421.Cm ListenAddress
422.Sm off
423.Oo
424.Ar host No | Ar IPv6_addr Oc : Ar port
425.Sm on
426.El
427.Pp
428If
429.Ar port
430is not specified,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100431sshd will listen on the address and all prior
Ben Lindstrom9f049032002-06-21 00:59:05 +0000432.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000433options specified.
434The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000435Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000436.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000437options are permitted.
438Additionally, any
Ben Lindstrom9f049032002-06-21 00:59:05 +0000439.Cm Port
Damien Miller5b0d63f2006-03-15 11:56:56 +1100440options must precede this option for non-port qualified addresses.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000441.It Cm LoginGraceTime
442The server disconnects after this time if the user has not
443successfully logged in.
444If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000445The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000446.It Cm LogLevel
447Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100448.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000449The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100450QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000451The default is INFO.
452DEBUG and DEBUG1 are equivalent.
453DEBUG2 and DEBUG3 each specify higher levels of debugging output.
454Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000455.It Cm MACs
456Specifies the available MAC (message authentication code) algorithms.
457The MAC algorithm is used in protocol version 2
458for data integrity protection.
459Multiple algorithms must be comma-separated.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100460The default is:
Ben Lindstrom9f049032002-06-21 00:59:05 +0000461.Dq hmac-md5,hmac-sha1,hmac-ripemd160,hmac-sha1-96,hmac-md5-96 .
Darren Tucker89413db2004-05-24 10:36:23 +1000462.It Cm MaxAuthTries
463Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +1000464connection.
465Once the number of failures reaches half this value,
466additional failures are logged.
467The default is 6.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000468.It Cm MaxStartups
469Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +1100470SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000471Additional connections will be dropped until authentication succeeds or the
472.Cm LoginGraceTime
473expires for a connection.
474The default is 10.
475.Pp
476Alternatively, random early drop can be enabled by specifying
477the three colon separated values
478.Dq start:rate:full
Damien Miller208f1ed2006-03-15 11:56:03 +1100479(e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +1100480.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000481will refuse connection attempts with a probability of
482.Dq rate/100
483(30%)
484if there are currently
485.Dq start
486(10)
487unauthenticated connections.
488The probability increases linearly and all connection attempts
489are refused if the number of unauthenticated connections reaches
490.Dq full
491(60).
492.It Cm PasswordAuthentication
493Specifies whether password authentication is allowed.
494The default is
495.Dq yes .
496.It Cm PermitEmptyPasswords
497When password authentication is allowed, it specifies whether the
498server allows login to accounts with empty password strings.
499The default is
500.Dq no .
501.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +1100502Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +0000503.Xr ssh 1 .
504The argument must be
505.Dq yes ,
506.Dq without-password ,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100507.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000508or
509.Dq no .
510The default is
511.Dq yes .
512.Pp
513If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100514.Dq without-password ,
Darren Tucker9dca0992005-02-01 19:16:45 +1100515password authentication is disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000516.Pp
517If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100518.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000519root login with public key authentication will be allowed,
520but only if the
521.Ar command
522option has been specified
523(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +1000524normally not allowed).
525All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000526.Pp
527If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100528.Dq no ,
Darren Tuckerb3509012005-01-20 11:01:46 +1100529root is not allowed to log in.
Damien Millerd27b9472005-12-13 19:29:02 +1100530.It Cm PermitTunnel
531Specifies whether
532.Xr tun 4
533device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +1100534The argument must be
535.Dq yes ,
536.Dq point-to-point ,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100537.Dq ethernet ,
Damien Miller7b58e802005-12-13 19:33:19 +1100538or
539.Dq no .
Damien Millerd27b9472005-12-13 19:29:02 +1100540The default is
541.Dq no .
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000542.It Cm PermitUserEnvironment
543Specifies whether
544.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000545and
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000546.Cm environment=
547options in
548.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000549are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +1100550.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000551The default is
552.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000553Enabling environment processing may enable users to bypass access
554restrictions in some configurations using mechanisms such as
555.Ev LD_PRELOAD .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000556.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +0000557Specifies the file that contains the process ID of the
Damien Millerf4f22b52006-03-15 11:57:25 +1100558SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000559The default is
560.Pa /var/run/sshd.pid .
561.It Cm Port
562Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100563.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000564listens on.
565The default is 22.
566Multiple options of this type are permitted.
567See also
568.Cm ListenAddress .
569.It Cm PrintLastLog
570Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100571.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +1100572should print the date and time of the last user login when a user logs
573in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000574The default is
575.Dq yes .
576.It Cm PrintMotd
577Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100578.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000579should print
580.Pa /etc/motd
581when a user logs in interactively.
582(On some systems it is also printed by the shell,
583.Pa /etc/profile ,
584or equivalent.)
585The default is
586.Dq yes .
587.It Cm Protocol
588Specifies the protocol versions
Damien Miller5b0d63f2006-03-15 11:56:56 +1100589.Xr sshd 8
Ben Lindstrom9c445542002-07-11 03:59:18 +0000590supports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000591The possible values are
Damien Miller5b0d63f2006-03-15 11:56:56 +1100592.Sq 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000593and
Damien Miller5b0d63f2006-03-15 11:56:56 +1100594.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000595Multiple versions must be comma-separated.
596The default is
597.Dq 2,1 .
Ben Lindstrom9c445542002-07-11 03:59:18 +0000598Note that the order of the protocol list does not indicate preference,
599because the client selects among multiple protocol versions offered
600by the server.
601Specifying
602.Dq 2,1
603is identical to
604.Dq 1,2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000605.It Cm PubkeyAuthentication
606Specifies whether public key authentication is allowed.
607The default is
608.Dq yes .
609Note that this option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000610.It Cm RhostsRSAAuthentication
611Specifies whether rhosts or /etc/hosts.equiv authentication together
612with successful RSA host authentication is allowed.
613The default is
614.Dq no .
615This option applies to protocol version 1 only.
616.It Cm RSAAuthentication
617Specifies whether pure RSA authentication is allowed.
618The default is
619.Dq yes .
620This option applies to protocol version 1 only.
621.It Cm ServerKeyBits
622Defines the number of bits in the ephemeral protocol version 1 server key.
623The minimum value is 512, and the default is 768.
624.It Cm StrictModes
625Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100626.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000627should check file modes and ownership of the
628user's files and home directory before accepting login.
629This is normally desirable because novices sometimes accidentally leave their
630directory or files world-writable.
631The default is
632.Dq yes .
633.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +1100634Configures an external subsystem (e.g. file transfer daemon).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000635Arguments should be a subsystem name and a command to execute upon subsystem
636request.
637The command
638.Xr sftp-server 8
639implements the
640.Dq sftp
641file transfer subsystem.
642By default no subsystems are defined.
643Note that this option applies to protocol version 2 only.
644.It Cm SyslogFacility
645Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100646.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000647The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
648LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
649The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +1100650.It Cm TCPKeepAlive
651Specifies whether the system should send TCP keepalive messages to the
652other side.
653If they are sent, death of the connection or crash of one
654of the machines will be properly noticed.
655However, this means that
656connections will die if the route is down temporarily, and some people
657find it annoying.
658On the other hand, if TCP keepalives are not sent,
659sessions may hang indefinitely on the server, leaving
660.Dq ghost
661users and consuming server resources.
662.Pp
663The default is
664.Dq yes
665(to send TCP keepalive messages), and the server will notice
666if the network goes down or the client host crashes.
667This avoids infinitely hanging sessions.
668.Pp
669To disable TCP keepalive messages, the value should be set to
670.Dq no .
Damien Miller3a961dc2003-06-03 10:25:48 +1000671.It Cm UseDNS
672Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100673.Xr sshd 8
Darren Tucker83d5a982005-03-31 21:33:50 +1000674should look up the remote host name and check that
Damien Miller3a961dc2003-06-03 10:25:48 +1000675the resolved host name for the remote IP address maps back to the
676very same IP address.
677The default is
678.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000679.It Cm UseLogin
680Specifies whether
681.Xr login 1
682is used for interactive login sessions.
683The default is
684.Dq no .
685Note that
686.Xr login 1
687is never used for remote command execution.
688Note also, that if this is enabled,
689.Cm X11Forwarding
690will be disabled because
691.Xr login 1
692does not know how to handle
693.Xr xauth 1
Damien Miller495dca32003-04-01 21:42:14 +1000694cookies.
695If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000696.Cm UsePrivilegeSeparation
697is specified, it will be disabled after authentication.
Damien Miller2e193e22003-05-14 15:13:03 +1000698.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +1000699Enables the Pluggable Authentication Module interface.
700If set to
701.Dq yes
702this will enable PAM authentication using
703.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +1100704and
705.Cm PasswordAuthentication
706in addition to PAM account and session module processing for all
707authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +1000708.Pp
709Because PAM challenge-response authentication usually serves an equivalent
710role to password authentication, you should disable either
711.Cm PasswordAuthentication
712or
713.Cm ChallengeResponseAuthentication.
714.Pp
715If
716.Cm UsePAM
717is enabled, you will not be able to run
718.Xr sshd 8
719as a non-root user.
720The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +1000721.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000722.It Cm UsePrivilegeSeparation
723Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100724.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000725separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +1000726to deal with incoming network traffic.
727After successful authentication, another process will be created that has
728the privilege of the authenticated user.
729The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +0000730escalation by containing any corruption within the unprivileged processes.
731The default is
732.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000733.It Cm X11DisplayOffset
734Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +1100735.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +0000736X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100737This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000738The default is 10.
739.It Cm X11Forwarding
740Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +1000741The argument must be
742.Dq yes
743or
744.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000745The default is
746.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +1000747.Pp
748When X11 forwarding is enabled, there may be additional exposure to
749the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +1100750.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +1000751proxy display is configured to listen on the wildcard address (see
752.Cm X11UseLocalhost
Damien Miller5b0d63f2006-03-15 11:56:56 +1100753below), though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +1000754Additionally, the authentication spoofing and authentication data
755verification and substitution occur on the client side.
756The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +1100757display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +1000758forwarding (see the warnings for
759.Cm ForwardX11
760in
Damien Millerf1ce5052003-06-11 22:04:39 +1000761.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +1000762A system administrator may have a stance in which they want to
763protect clients that may expose themselves to attack by unwittingly
764requesting X11 forwarding, which can warrant a
765.Dq no
766setting.
767.Pp
768Note that disabling X11 forwarding does not prevent users from
769forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000770X11 forwarding is automatically disabled if
771.Cm UseLogin
772is enabled.
773.It Cm X11UseLocalhost
774Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100775.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000776should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +1000777the wildcard address.
778By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100779sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +0000780hostname part of the
781.Ev DISPLAY
782environment variable to
783.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +0000784This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000785However, some older X11 clients may not function with this
786configuration.
787.Cm X11UseLocalhost
788may be set to
789.Dq no
790to specify that the forwarding server should be bound to the wildcard
791address.
792The argument must be
793.Dq yes
794or
795.Dq no .
796The default is
797.Dq yes .
798.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +1000799Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +0000800.Xr xauth 1
801program.
802The default is
803.Pa /usr/X11R6/bin/xauth .
804.El
Damien Millere3beba22006-03-15 11:59:25 +1100805.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +1100806.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000807command-line arguments and configuration file options that specify time
808may be expressed using a sequence of the form:
809.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +0000810.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000811.Sm on
812where
813.Ar time
814is a positive integer value and
815.Ar qualifier
816is one of the following:
817.Pp
818.Bl -tag -width Ds -compact -offset indent
819.It Cm <none>
820seconds
821.It Cm s | Cm S
822seconds
823.It Cm m | Cm M
824minutes
825.It Cm h | Cm H
826hours
827.It Cm d | Cm D
828days
829.It Cm w | Cm W
830weeks
831.El
832.Pp
833Each member of the sequence is added together to calculate
834the total time value.
835.Pp
836Time format examples:
837.Pp
838.Bl -tag -width Ds -compact -offset indent
839.It 600
840600 seconds (10 minutes)
841.It 10m
84210 minutes
843.It 1h30m
8441 hour 30 minutes (90 minutes)
845.El
846.Sh FILES
847.Bl -tag -width Ds
848.It Pa /etc/ssh/sshd_config
849Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +1100850.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000851This file should be writable by root only, but it is recommended
852(though not necessary) that it be world-readable.
853.El
Damien Millerf1ce5052003-06-11 22:04:39 +1000854.Sh SEE ALSO
855.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000856.Sh AUTHORS
857OpenSSH is a derivative of the original and free
858ssh 1.2.12 release by Tatu Ylonen.
859Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
860Theo de Raadt and Dug Song
861removed many bugs, re-added newer features and
862created OpenSSH.
863Markus Friedl contributed the support for SSH
864protocol versions 1.5 and 2.0.
865Niels Provos and Markus Friedl contributed support
866for privilege separation.