blob: e0768230eefff456004b6ed201fce187d1437aba [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 Miller0c2079d2006-03-15 11:54:21 +110037.\" $OpenBSD: sshd_config.5,v 1.49 2006/02/24 10:33:54 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
49.Nm sshd
50reads 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
75.Ql \&*
76and
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
88.Nm sshd .
89Valid arguments are
90.Dq any ,
91.Dq inet
92(use IPv4 only) or
93.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 Miller0c2079d2006-03-15 11:54:21 +1100104.Pp
105See
106.Sx PATTERNS
107in
108.Xr ssh_config 5
109for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000110.It Cm AllowTcpForwarding
111Specifies whether TCP forwarding is permitted.
112The default is
113.Dq yes .
114Note that disabling TCP forwarding does not improve security unless
115users are also denied shell access, as they can always install their
116own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000117.It Cm AllowUsers
118This keyword can be followed by a list of user name patterns, separated
119by spaces.
Damien Miller5a93add2003-01-24 11:34:52 +1100120If specified, login is allowed only for user names that
Ben Lindstrom9f049032002-06-21 00:59:05 +0000121match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000122Only user names are valid; a numerical user ID is not recognized.
123By default, login is allowed for all users.
124If the pattern takes the form USER@HOST then USER and HOST
125are separately checked, restricting logins to particular
126users from particular hosts.
Damien Miller0c2079d2006-03-15 11:54:21 +1100127.Pp
128See
129.Sx PATTERNS
130in
131.Xr ssh_config 5
132for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000133.It Cm AuthorizedKeysFile
134Specifies the file that contains the public keys that can be used
135for user authentication.
136.Cm AuthorizedKeysFile
137may contain tokens of the form %T which are substituted during connection
Damien Millerfbf486b2003-05-23 18:44:23 +1000138set-up.
139The following tokens are defined: %% is replaced by a literal '%',
Ben Lindstrom9f049032002-06-21 00:59:05 +0000140%h is replaced by the home directory of the user being authenticated and
141%u is replaced by the username of that user.
142After expansion,
143.Cm AuthorizedKeysFile
144is taken to be an absolute path or one relative to the user's home
145directory.
146The default is
147.Dq .ssh/authorized_keys .
148.It Cm Banner
149In some jurisdictions, sending a warning message before authentication
150may be relevant for getting legal protection.
151The contents of the specified file are sent to the remote user before
152authentication is allowed.
153This option is only available for protocol version 2.
154By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000155.It Cm ChallengeResponseAuthentication
156Specifies whether challenge response authentication is allowed.
157All authentication styles from
158.Xr login.conf 5
159are supported.
160The default is
161.Dq yes .
162.It Cm Ciphers
163Specifies the ciphers allowed for protocol version 2.
164Multiple ciphers must be comma-separated.
Damien Miller05202ff2004-06-15 10:30:39 +1000165The supported ciphers are
166.Dq 3des-cbc ,
167.Dq aes128-cbc ,
168.Dq aes192-cbc ,
169.Dq aes256-cbc ,
170.Dq aes128-ctr ,
171.Dq aes192-ctr ,
172.Dq aes256-ctr ,
Damien Miller3710f272005-05-26 12:19:17 +1000173.Dq arcfour128 ,
174.Dq arcfour256 ,
Damien Miller05202ff2004-06-15 10:30:39 +1000175.Dq arcfour ,
176.Dq blowfish-cbc ,
177and
178.Dq cast128-cbc .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000179The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000180.Bd -literal
Damien Miller3710f272005-05-26 12:19:17 +1000181 ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour128,
182 arcfour256,arcfour,aes192-cbc,aes256-cbc,aes128-ctr,
183 aes192-ctr,aes256-ctr''
Ben Lindstrom9f049032002-06-21 00:59:05 +0000184.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +0000185.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100186Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000187sent without
188.Nm sshd
Damien Millerfbf486b2003-05-23 18:44:23 +1000189receiving any messages back from the client.
190If this threshold is reached while client alive messages are being sent,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000191.Nm sshd
Damien Millerfbf486b2003-05-23 18:44:23 +1000192will disconnect the client, terminating the session.
193It is important to note that the use of client alive messages is very
194different from
Damien Miller12c150e2003-12-17 16:31:10 +1100195.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000196(below).
197The client alive messages are sent through the encrypted channel
198and therefore will not be spoofable.
199The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100200.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000201is spoofable.
202The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000203server depend on knowing when a connection has become inactive.
204.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000205The default value is 3.
206If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000207.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100208(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000209.Cm ClientAliveCountMax
210is left at the default, unresponsive ssh clients
211will be disconnected after approximately 45 seconds.
Damien Miller1594ad52005-05-26 12:12:19 +1000212.It Cm ClientAliveInterval
213Sets a timeout interval in seconds after which if no data has been received
214from the client,
215.Nm sshd
216will send a message through the encrypted
217channel to request a response from the client.
218The default
219is 0, indicating that these messages will not be sent to the client.
220This option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000221.It Cm Compression
Damien Miller9786e6e2005-07-26 21:54:56 +1000222Specifies whether compression is allowed, or delayed until
223the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000224The argument must be
Damien Miller9786e6e2005-07-26 21:54:56 +1000225.Dq yes ,
226.Dq delayed ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000227or
228.Dq no .
229The default is
Damien Miller9786e6e2005-07-26 21:54:56 +1000230.Dq delayed .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000231.It Cm DenyGroups
232This keyword can be followed by a list of group name patterns, separated
233by spaces.
234Login is disallowed for users whose primary group or supplementary
235group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000236Only group names are valid; a numerical group ID is not recognized.
237By default, login is allowed for all groups.
Damien Miller0c2079d2006-03-15 11:54:21 +1100238.Pp
239See
240.Sx PATTERNS
241in
242.Xr ssh_config 5
243for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000244.It Cm DenyUsers
245This keyword can be followed by a list of user name patterns, separated
246by spaces.
247Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000248Only user names are valid; a numerical user ID is not recognized.
249By default, login is allowed for all users.
250If the pattern takes the form USER@HOST then USER and HOST
251are separately checked, restricting logins to particular
252users from particular hosts.
Damien Miller0c2079d2006-03-15 11:54:21 +1100253.Pp
254See
255.Sx PATTERNS
256in
257.Xr ssh_config 5
258for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000259.It Cm GatewayPorts
260Specifies whether remote hosts are allowed to connect to ports
261forwarded for the client.
262By default,
263.Nm sshd
Damien Miller495dca32003-04-01 21:42:14 +1000264binds remote port forwardings to the loopback address.
265This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000266.Cm GatewayPorts
267can be used to specify that
268.Nm sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100269should allow remote port forwardings to bind to non-loopback addresses, thus
270allowing other hosts to connect.
271The argument may be
272.Dq no
273to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000274.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100275to force remote port forwardings to bind to the wildcard address, or
276.Dq clientspecified
277to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000278The default is
279.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000280.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000281Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100282The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000283.Dq no .
284Note that this option applies to protocol version 2 only.
285.It Cm GSSAPICleanupCredentials
286Specifies whether to automatically destroy the user's credentials cache
287on logout.
288The default is
289.Dq yes .
290Note that this option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000291.It Cm HostbasedAuthentication
292Specifies whether rhosts or /etc/hosts.equiv authentication together
293with successful public key client host authentication is allowed
294(hostbased authentication).
295This option is similar to
296.Cm RhostsRSAAuthentication
297and applies to protocol version 2 only.
298The default is
299.Dq no .
300.It Cm HostKey
301Specifies a file containing a private host key
302used by SSH.
303The default is
304.Pa /etc/ssh/ssh_host_key
305for protocol version 1, and
306.Pa /etc/ssh/ssh_host_rsa_key
307and
308.Pa /etc/ssh/ssh_host_dsa_key
309for protocol version 2.
310Note that
311.Nm sshd
312will refuse to use a file if it is group/world-accessible.
313It is possible to have multiple host key files.
314.Dq rsa1
315keys are used for version 1 and
316.Dq dsa
317or
318.Dq rsa
319are used for version 2 of the SSH protocol.
320.It Cm IgnoreRhosts
321Specifies that
322.Pa .rhosts
323and
324.Pa .shosts
325files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000326.Cm RhostsRSAAuthentication
327or
328.Cm HostbasedAuthentication .
329.Pp
330.Pa /etc/hosts.equiv
331and
332.Pa /etc/shosts.equiv
333are still used.
334The default is
335.Dq yes .
336.It Cm IgnoreUserKnownHosts
337Specifies whether
338.Nm sshd
339should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000340.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000341during
342.Cm RhostsRSAAuthentication
343or
344.Cm HostbasedAuthentication .
345The default is
346.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000347.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000348Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000349.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000350will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000351To use this option, the server needs a
352Kerberos servtab which allows the verification of the KDC's identity.
353Default is
354.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100355.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000356If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100357an AFS token before accessing the user's home directory.
358Default is
359.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000360.It Cm KerberosOrLocalPasswd
361If set then if password authentication through Kerberos fails then
362the password will be validated via any additional local mechanism
363such as
364.Pa /etc/passwd .
365Default is
366.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000367.It Cm KerberosTicketCleanup
368Specifies whether to automatically destroy the user's ticket cache
369file on logout.
370Default is
371.Dq yes .
372.It Cm KeyRegenerationInterval
373In protocol version 1, the ephemeral server key is automatically regenerated
374after this many seconds (if it has been used).
375The purpose of regeneration is to prevent
376decrypting captured sessions by later breaking into the machine and
377stealing the keys.
378The key is never stored anywhere.
379If the value is 0, the key is never regenerated.
380The default is 3600 (seconds).
381.It Cm ListenAddress
382Specifies the local addresses
383.Nm sshd
384should listen on.
385The following forms may be used:
386.Pp
387.Bl -item -offset indent -compact
388.It
389.Cm ListenAddress
390.Sm off
391.Ar host No | Ar IPv4_addr No | Ar IPv6_addr
392.Sm on
393.It
394.Cm ListenAddress
395.Sm off
396.Ar host No | Ar IPv4_addr No : Ar port
397.Sm on
398.It
399.Cm ListenAddress
400.Sm off
401.Oo
402.Ar host No | Ar IPv6_addr Oc : Ar port
403.Sm on
404.El
405.Pp
406If
407.Ar port
408is not specified,
409.Nm sshd
410will listen on the address and all prior
411.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000412options specified.
413The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000414Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000415.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000416options are permitted.
417Additionally, any
Ben Lindstrom9f049032002-06-21 00:59:05 +0000418.Cm Port
419options must precede this option for non port qualified addresses.
420.It Cm LoginGraceTime
421The server disconnects after this time if the user has not
422successfully logged in.
423If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000424The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000425.It Cm LogLevel
426Gives the verbosity level that is used when logging messages from
427.Nm sshd .
428The possible values are:
429QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2 and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000430The default is INFO.
431DEBUG and DEBUG1 are equivalent.
432DEBUG2 and DEBUG3 each specify higher levels of debugging output.
433Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000434.It Cm MACs
435Specifies the available MAC (message authentication code) algorithms.
436The MAC algorithm is used in protocol version 2
437for data integrity protection.
438Multiple algorithms must be comma-separated.
439The default is
440.Dq hmac-md5,hmac-sha1,hmac-ripemd160,hmac-sha1-96,hmac-md5-96 .
Darren Tucker89413db2004-05-24 10:36:23 +1000441.It Cm MaxAuthTries
442Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +1000443connection.
444Once the number of failures reaches half this value,
445additional failures are logged.
446The default is 6.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000447.It Cm MaxStartups
448Specifies the maximum number of concurrent unauthenticated connections to the
449.Nm sshd
450daemon.
451Additional connections will be dropped until authentication succeeds or the
452.Cm LoginGraceTime
453expires for a connection.
454The default is 10.
455.Pp
456Alternatively, random early drop can be enabled by specifying
457the three colon separated values
458.Dq start:rate:full
459(e.g., "10:30:60").
460.Nm sshd
461will refuse connection attempts with a probability of
462.Dq rate/100
463(30%)
464if there are currently
465.Dq start
466(10)
467unauthenticated connections.
468The probability increases linearly and all connection attempts
469are refused if the number of unauthenticated connections reaches
470.Dq full
471(60).
472.It Cm PasswordAuthentication
473Specifies whether password authentication is allowed.
474The default is
475.Dq yes .
476.It Cm PermitEmptyPasswords
477When password authentication is allowed, it specifies whether the
478server allows login to accounts with empty password strings.
479The default is
480.Dq no .
481.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +1100482Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +0000483.Xr ssh 1 .
484The argument must be
485.Dq yes ,
486.Dq without-password ,
487.Dq forced-commands-only
488or
489.Dq no .
490The default is
491.Dq yes .
492.Pp
493If this option is set to
494.Dq without-password
Darren Tucker9dca0992005-02-01 19:16:45 +1100495password authentication is disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000496.Pp
497If this option is set to
498.Dq forced-commands-only
499root login with public key authentication will be allowed,
500but only if the
501.Ar command
502option has been specified
503(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +1000504normally not allowed).
505All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000506.Pp
507If this option is set to
508.Dq no
Darren Tuckerb3509012005-01-20 11:01:46 +1100509root is not allowed to log in.
Damien Millerd27b9472005-12-13 19:29:02 +1100510.It Cm PermitTunnel
511Specifies whether
512.Xr tun 4
513device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +1100514The argument must be
515.Dq yes ,
516.Dq point-to-point ,
517.Dq ethernet
518or
519.Dq no .
Damien Millerd27b9472005-12-13 19:29:02 +1100520The default is
521.Dq no .
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000522.It Cm PermitUserEnvironment
523Specifies whether
524.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000525and
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000526.Cm environment=
527options in
528.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000529are processed by
530.Nm sshd .
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000531The default is
532.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000533Enabling environment processing may enable users to bypass access
534restrictions in some configurations using mechanisms such as
535.Ev LD_PRELOAD .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000536.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +0000537Specifies the file that contains the process ID of the
Ben Lindstrom9f049032002-06-21 00:59:05 +0000538.Nm sshd
539daemon.
540The default is
541.Pa /var/run/sshd.pid .
542.It Cm Port
543Specifies the port number that
544.Nm sshd
545listens on.
546The default is 22.
547Multiple options of this type are permitted.
548See also
549.Cm ListenAddress .
550.It Cm PrintLastLog
551Specifies whether
552.Nm sshd
Darren Tucker7cc5c232004-11-05 20:06:59 +1100553should print the date and time of the last user login when a user logs
554in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000555The default is
556.Dq yes .
557.It Cm PrintMotd
558Specifies whether
559.Nm sshd
560should print
561.Pa /etc/motd
562when a user logs in interactively.
563(On some systems it is also printed by the shell,
564.Pa /etc/profile ,
565or equivalent.)
566The default is
567.Dq yes .
568.It Cm Protocol
569Specifies the protocol versions
570.Nm sshd
Ben Lindstrom9c445542002-07-11 03:59:18 +0000571supports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000572The possible values are
573.Dq 1
574and
575.Dq 2 .
576Multiple versions must be comma-separated.
577The default is
578.Dq 2,1 .
Ben Lindstrom9c445542002-07-11 03:59:18 +0000579Note that the order of the protocol list does not indicate preference,
580because the client selects among multiple protocol versions offered
581by the server.
582Specifying
583.Dq 2,1
584is identical to
585.Dq 1,2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000586.It Cm PubkeyAuthentication
587Specifies whether public key authentication is allowed.
588The default is
589.Dq yes .
590Note that this option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000591.It Cm RhostsRSAAuthentication
592Specifies whether rhosts or /etc/hosts.equiv authentication together
593with successful RSA host authentication is allowed.
594The default is
595.Dq no .
596This option applies to protocol version 1 only.
597.It Cm RSAAuthentication
598Specifies whether pure RSA authentication is allowed.
599The default is
600.Dq yes .
601This option applies to protocol version 1 only.
602.It Cm ServerKeyBits
603Defines the number of bits in the ephemeral protocol version 1 server key.
604The minimum value is 512, and the default is 768.
605.It Cm StrictModes
606Specifies whether
607.Nm sshd
608should check file modes and ownership of the
609user's files and home directory before accepting login.
610This is normally desirable because novices sometimes accidentally leave their
611directory or files world-writable.
612The default is
613.Dq yes .
614.It Cm Subsystem
615Configures an external subsystem (e.g., file transfer daemon).
616Arguments should be a subsystem name and a command to execute upon subsystem
617request.
618The command
619.Xr sftp-server 8
620implements the
621.Dq sftp
622file transfer subsystem.
623By default no subsystems are defined.
624Note that this option applies to protocol version 2 only.
625.It Cm SyslogFacility
626Gives the facility code that is used when logging messages from
627.Nm sshd .
628The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
629LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
630The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +1100631.It Cm TCPKeepAlive
632Specifies whether the system should send TCP keepalive messages to the
633other side.
634If they are sent, death of the connection or crash of one
635of the machines will be properly noticed.
636However, this means that
637connections will die if the route is down temporarily, and some people
638find it annoying.
639On the other hand, if TCP keepalives are not sent,
640sessions may hang indefinitely on the server, leaving
641.Dq ghost
642users and consuming server resources.
643.Pp
644The default is
645.Dq yes
646(to send TCP keepalive messages), and the server will notice
647if the network goes down or the client host crashes.
648This avoids infinitely hanging sessions.
649.Pp
650To disable TCP keepalive messages, the value should be set to
651.Dq no .
Damien Miller3a961dc2003-06-03 10:25:48 +1000652.It Cm UseDNS
653Specifies whether
654.Nm sshd
Darren Tucker83d5a982005-03-31 21:33:50 +1000655should look up the remote host name and check that
Damien Miller3a961dc2003-06-03 10:25:48 +1000656the resolved host name for the remote IP address maps back to the
657very same IP address.
658The default is
659.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000660.It Cm UseLogin
661Specifies whether
662.Xr login 1
663is used for interactive login sessions.
664The default is
665.Dq no .
666Note that
667.Xr login 1
668is never used for remote command execution.
669Note also, that if this is enabled,
670.Cm X11Forwarding
671will be disabled because
672.Xr login 1
673does not know how to handle
674.Xr xauth 1
Damien Miller495dca32003-04-01 21:42:14 +1000675cookies.
676If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000677.Cm UsePrivilegeSeparation
678is specified, it will be disabled after authentication.
Damien Miller2e193e22003-05-14 15:13:03 +1000679.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +1000680Enables the Pluggable Authentication Module interface.
681If set to
682.Dq yes
683this will enable PAM authentication using
684.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +1100685and
686.Cm PasswordAuthentication
687in addition to PAM account and session module processing for all
688authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +1000689.Pp
690Because PAM challenge-response authentication usually serves an equivalent
691role to password authentication, you should disable either
692.Cm PasswordAuthentication
693or
694.Cm ChallengeResponseAuthentication.
695.Pp
696If
697.Cm UsePAM
698is enabled, you will not be able to run
699.Xr sshd 8
700as a non-root user.
701The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +1000702.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000703.It Cm UsePrivilegeSeparation
704Specifies whether
705.Nm sshd
706separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +1000707to deal with incoming network traffic.
708After successful authentication, another process will be created that has
709the privilege of the authenticated user.
710The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +0000711escalation by containing any corruption within the unprivileged processes.
712The default is
713.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000714.It Cm X11DisplayOffset
715Specifies the first display number available for
716.Nm sshd Ns 's
717X11 forwarding.
718This prevents
719.Nm sshd
720from interfering with real X11 servers.
721The default is 10.
722.It Cm X11Forwarding
723Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +1000724The argument must be
725.Dq yes
726or
727.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000728The default is
729.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +1000730.Pp
731When X11 forwarding is enabled, there may be additional exposure to
732the server and to client displays if the
733.Nm sshd
734proxy display is configured to listen on the wildcard address (see
735.Cm X11UseLocalhost
736below), however this is not the default.
737Additionally, the authentication spoofing and authentication data
738verification and substitution occur on the client side.
739The security risk of using X11 forwarding is that the client's X11
740display server may be exposed to attack when the ssh client requests
741forwarding (see the warnings for
742.Cm ForwardX11
743in
Damien Millerf1ce5052003-06-11 22:04:39 +1000744.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +1000745A system administrator may have a stance in which they want to
746protect clients that may expose themselves to attack by unwittingly
747requesting X11 forwarding, which can warrant a
748.Dq no
749setting.
750.Pp
751Note that disabling X11 forwarding does not prevent users from
752forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000753X11 forwarding is automatically disabled if
754.Cm UseLogin
755is enabled.
756.It Cm X11UseLocalhost
757Specifies whether
758.Nm sshd
759should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +1000760the wildcard address.
761By default,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000762.Nm sshd
763binds the forwarding server to the loopback address and sets the
764hostname part of the
765.Ev DISPLAY
766environment variable to
767.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +0000768This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000769However, some older X11 clients may not function with this
770configuration.
771.Cm X11UseLocalhost
772may be set to
773.Dq no
774to specify that the forwarding server should be bound to the wildcard
775address.
776The argument must be
777.Dq yes
778or
779.Dq no .
780The default is
781.Dq yes .
782.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +1000783Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +0000784.Xr xauth 1
785program.
786The default is
787.Pa /usr/X11R6/bin/xauth .
788.El
789.Ss Time Formats
Ben Lindstrom9f049032002-06-21 00:59:05 +0000790.Nm sshd
791command-line arguments and configuration file options that specify time
792may be expressed using a sequence of the form:
793.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +0000794.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000795.Sm on
796where
797.Ar time
798is a positive integer value and
799.Ar qualifier
800is one of the following:
801.Pp
802.Bl -tag -width Ds -compact -offset indent
803.It Cm <none>
804seconds
805.It Cm s | Cm S
806seconds
807.It Cm m | Cm M
808minutes
809.It Cm h | Cm H
810hours
811.It Cm d | Cm D
812days
813.It Cm w | Cm W
814weeks
815.El
816.Pp
817Each member of the sequence is added together to calculate
818the total time value.
819.Pp
820Time format examples:
821.Pp
822.Bl -tag -width Ds -compact -offset indent
823.It 600
824600 seconds (10 minutes)
825.It 10m
82610 minutes
827.It 1h30m
8281 hour 30 minutes (90 minutes)
829.El
830.Sh FILES
831.Bl -tag -width Ds
832.It Pa /etc/ssh/sshd_config
833Contains configuration data for
834.Nm sshd .
835This file should be writable by root only, but it is recommended
836(though not necessary) that it be world-readable.
837.El
Damien Millerf1ce5052003-06-11 22:04:39 +1000838.Sh SEE ALSO
839.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000840.Sh AUTHORS
841OpenSSH is a derivative of the original and free
842ssh 1.2.12 release by Tatu Ylonen.
843Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
844Theo de Raadt and Dug Song
845removed many bugs, re-added newer features and
846created OpenSSH.
847Markus Friedl contributed the support for SSH
848protocol versions 1.5 and 2.0.
849Niels Provos and Markus Friedl contributed support
850for privilege separation.