blob: b702e5ad4c157e48c5d48b9f94f6394297869e0f [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.\"
Darren Tucker46bc0752004-05-02 22:11:30 +100037.\" $OpenBSD: sshd_config.5,v 1.30 2004/04/27 09:46:37 djm 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.
73Note that environment passingis only supported for protocol 2.
74Variables are specified by name, which may contain the wildcard characters
75.Ql \&*
76and
77.Ql \&? .
78Multiple environment variables may be seperated by whitespace or spread
79across multiple
80.Cm AcceptEnv
81directives.
82Be warned that some enviornment variables could be used to bypass restricted
83user environments.
84For this reason, care should be taken in the use of this directive.
85The default is not to accept any environment variables.
86.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +000087.It Cm AllowGroups
88This keyword can be followed by a list of group name patterns, separated
89by spaces.
90If specified, login is allowed only for users whose primary
91group or supplementary group list matches one of the patterns.
92.Ql \&*
93and
Damien Miller049245d2003-05-14 13:44:42 +100094.Ql \&?
Ben Lindstrom9f049032002-06-21 00:59:05 +000095can be used as
96wildcards in the patterns.
97Only group names are valid; a numerical group ID is not recognized.
98By default, login is allowed for all groups.
99.Pp
100.It Cm AllowTcpForwarding
101Specifies whether TCP forwarding is permitted.
102The default is
103.Dq yes .
104Note that disabling TCP forwarding does not improve security unless
105users are also denied shell access, as they can always install their
106own forwarders.
107.Pp
108.It Cm AllowUsers
109This keyword can be followed by a list of user name patterns, separated
110by spaces.
Damien Miller5a93add2003-01-24 11:34:52 +1100111If specified, login is allowed only for user names that
Ben Lindstrom9f049032002-06-21 00:59:05 +0000112match one of the patterns.
113.Ql \&*
114and
Damien Miller049245d2003-05-14 13:44:42 +1000115.Ql \&?
Ben Lindstrom9f049032002-06-21 00:59:05 +0000116can be used as
117wildcards in the patterns.
118Only user names are valid; a numerical user ID is not recognized.
119By default, login is allowed for all users.
120If the pattern takes the form USER@HOST then USER and HOST
121are separately checked, restricting logins to particular
122users from particular hosts.
123.Pp
124.It Cm AuthorizedKeysFile
125Specifies the file that contains the public keys that can be used
126for user authentication.
127.Cm AuthorizedKeysFile
128may contain tokens of the form %T which are substituted during connection
Damien Millerfbf486b2003-05-23 18:44:23 +1000129set-up.
130The following tokens are defined: %% is replaced by a literal '%',
Ben Lindstrom9f049032002-06-21 00:59:05 +0000131%h is replaced by the home directory of the user being authenticated and
132%u is replaced by the username of that user.
133After expansion,
134.Cm AuthorizedKeysFile
135is taken to be an absolute path or one relative to the user's home
136directory.
137The default is
138.Dq .ssh/authorized_keys .
139.It Cm Banner
140In some jurisdictions, sending a warning message before authentication
141may be relevant for getting legal protection.
142The contents of the specified file are sent to the remote user before
143authentication is allowed.
144This option is only available for protocol version 2.
145By default, no banner is displayed.
146.Pp
147.It Cm ChallengeResponseAuthentication
148Specifies whether challenge response authentication is allowed.
149All authentication styles from
150.Xr login.conf 5
151are supported.
152The default is
153.Dq yes .
154.It Cm Ciphers
155Specifies the ciphers allowed for protocol version 2.
156Multiple ciphers must be comma-separated.
157The default is
158.Pp
159.Bd -literal
160 ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour,
Darren Tucker91cf2612003-06-22 20:46:53 +1000161 aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr''
Ben Lindstrom9f049032002-06-21 00:59:05 +0000162.Ed
163.It Cm ClientAliveInterval
164Sets a timeout interval in seconds after which if no data has been received
165from the client,
166.Nm sshd
167will send a message through the encrypted
168channel to request a response from the client.
169The default
170is 0, indicating that these messages will not be sent to the client.
171This option applies to protocol version 2 only.
172.It Cm ClientAliveCountMax
173Sets the number of client alive messages (see above) which may be
174sent without
175.Nm sshd
Damien Millerfbf486b2003-05-23 18:44:23 +1000176receiving any messages back from the client.
177If this threshold is reached while client alive messages are being sent,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000178.Nm sshd
Damien Millerfbf486b2003-05-23 18:44:23 +1000179will disconnect the client, terminating the session.
180It is important to note that the use of client alive messages is very
181different from
Damien Miller12c150e2003-12-17 16:31:10 +1100182.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000183(below).
184The client alive messages are sent through the encrypted channel
185and therefore will not be spoofable.
186The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100187.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000188is spoofable.
189The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000190server depend on knowing when a connection has become inactive.
191.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000192The default value is 3.
193If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000194.Cm ClientAliveInterval
195(above) is set to 15, and
196.Cm ClientAliveCountMax
197is left at the default, unresponsive ssh clients
198will be disconnected after approximately 45 seconds.
199.It Cm Compression
200Specifies whether compression is allowed.
201The argument must be
202.Dq yes
203or
204.Dq no .
205The default is
206.Dq yes .
207.It Cm DenyGroups
208This keyword can be followed by a list of group name patterns, separated
209by spaces.
210Login is disallowed for users whose primary group or supplementary
211group list matches one of the patterns.
212.Ql \&*
213and
Damien Miller049245d2003-05-14 13:44:42 +1000214.Ql \&?
Ben Lindstrom9f049032002-06-21 00:59:05 +0000215can be used as
216wildcards in the patterns.
217Only group names are valid; a numerical group ID is not recognized.
218By default, login is allowed for all groups.
219.Pp
220.It Cm DenyUsers
221This keyword can be followed by a list of user name patterns, separated
222by spaces.
223Login is disallowed for user names that match one of the patterns.
224.Ql \&*
225and
Damien Miller049245d2003-05-14 13:44:42 +1000226.Ql \&?
Ben Lindstrom9f049032002-06-21 00:59:05 +0000227can be used as wildcards in the patterns.
228Only user names are valid; a numerical user ID is not recognized.
229By default, login is allowed for all users.
230If the pattern takes the form USER@HOST then USER and HOST
231are separately checked, restricting logins to particular
232users from particular hosts.
233.It Cm GatewayPorts
234Specifies whether remote hosts are allowed to connect to ports
235forwarded for the client.
236By default,
237.Nm sshd
Damien Miller495dca32003-04-01 21:42:14 +1000238binds remote port forwardings to the loopback address.
239This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000240.Cm GatewayPorts
241can be used to specify that
242.Nm sshd
243should bind remote port forwardings to the wildcard address,
244thus allowing remote hosts to connect to forwarded ports.
245The argument must be
246.Dq yes
247or
248.Dq no .
249The default is
250.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000251.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000252Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100253The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000254.Dq no .
255Note that this option applies to protocol version 2 only.
256.It Cm GSSAPICleanupCredentials
257Specifies whether to automatically destroy the user's credentials cache
258on logout.
259The default is
260.Dq yes .
261Note that this option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000262.It Cm HostbasedAuthentication
263Specifies whether rhosts or /etc/hosts.equiv authentication together
264with successful public key client host authentication is allowed
265(hostbased authentication).
266This option is similar to
267.Cm RhostsRSAAuthentication
268and applies to protocol version 2 only.
269The default is
270.Dq no .
271.It Cm HostKey
272Specifies a file containing a private host key
273used by SSH.
274The default is
275.Pa /etc/ssh/ssh_host_key
276for protocol version 1, and
277.Pa /etc/ssh/ssh_host_rsa_key
278and
279.Pa /etc/ssh/ssh_host_dsa_key
280for protocol version 2.
281Note that
282.Nm sshd
283will refuse to use a file if it is group/world-accessible.
284It is possible to have multiple host key files.
285.Dq rsa1
286keys are used for version 1 and
287.Dq dsa
288or
289.Dq rsa
290are used for version 2 of the SSH protocol.
291.It Cm IgnoreRhosts
292Specifies that
293.Pa .rhosts
294and
295.Pa .shosts
296files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000297.Cm RhostsRSAAuthentication
298or
299.Cm HostbasedAuthentication .
300.Pp
301.Pa /etc/hosts.equiv
302and
303.Pa /etc/shosts.equiv
304are still used.
305The default is
306.Dq yes .
307.It Cm IgnoreUserKnownHosts
308Specifies whether
309.Nm sshd
310should ignore the user's
311.Pa $HOME/.ssh/known_hosts
312during
313.Cm RhostsRSAAuthentication
314or
315.Cm HostbasedAuthentication .
316The default is
317.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000318.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000319Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000320.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000321will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000322To use this option, the server needs a
323Kerberos servtab which allows the verification of the KDC's identity.
324Default is
325.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100326.It Cm KerberosGetAFSToken
327If AFS is active and the user has a Kerberos 5 TGT, attempt to aquire
328an AFS token before accessing the user's home directory.
329Default is
330.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000331.It Cm KerberosOrLocalPasswd
332If set then if password authentication through Kerberos fails then
333the password will be validated via any additional local mechanism
334such as
335.Pa /etc/passwd .
336Default is
337.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000338.It Cm KerberosTicketCleanup
339Specifies whether to automatically destroy the user's ticket cache
340file on logout.
341Default is
342.Dq yes .
343.It Cm KeyRegenerationInterval
344In protocol version 1, the ephemeral server key is automatically regenerated
345after this many seconds (if it has been used).
346The purpose of regeneration is to prevent
347decrypting captured sessions by later breaking into the machine and
348stealing the keys.
349The key is never stored anywhere.
350If the value is 0, the key is never regenerated.
351The default is 3600 (seconds).
352.It Cm ListenAddress
353Specifies the local addresses
354.Nm sshd
355should listen on.
356The following forms may be used:
357.Pp
358.Bl -item -offset indent -compact
359.It
360.Cm ListenAddress
361.Sm off
362.Ar host No | Ar IPv4_addr No | Ar IPv6_addr
363.Sm on
364.It
365.Cm ListenAddress
366.Sm off
367.Ar host No | Ar IPv4_addr No : Ar port
368.Sm on
369.It
370.Cm ListenAddress
371.Sm off
372.Oo
373.Ar host No | Ar IPv6_addr Oc : Ar port
374.Sm on
375.El
376.Pp
377If
378.Ar port
379is not specified,
380.Nm sshd
381will listen on the address and all prior
382.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000383options specified.
384The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000385Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000386.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000387options are permitted.
388Additionally, any
Ben Lindstrom9f049032002-06-21 00:59:05 +0000389.Cm Port
390options must precede this option for non port qualified addresses.
391.It Cm LoginGraceTime
392The server disconnects after this time if the user has not
393successfully logged in.
394If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000395The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000396.It Cm LogLevel
397Gives the verbosity level that is used when logging messages from
398.Nm sshd .
399The possible values are:
400QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2 and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000401The default is INFO.
402DEBUG and DEBUG1 are equivalent.
403DEBUG2 and DEBUG3 each specify higher levels of debugging output.
404Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000405.It Cm MACs
406Specifies the available MAC (message authentication code) algorithms.
407The MAC algorithm is used in protocol version 2
408for data integrity protection.
409Multiple algorithms must be comma-separated.
410The default is
411.Dq hmac-md5,hmac-sha1,hmac-ripemd160,hmac-sha1-96,hmac-md5-96 .
412.It Cm MaxStartups
413Specifies the maximum number of concurrent unauthenticated connections to the
414.Nm sshd
415daemon.
416Additional connections will be dropped until authentication succeeds or the
417.Cm LoginGraceTime
418expires for a connection.
419The default is 10.
420.Pp
421Alternatively, random early drop can be enabled by specifying
422the three colon separated values
423.Dq start:rate:full
424(e.g., "10:30:60").
425.Nm sshd
426will refuse connection attempts with a probability of
427.Dq rate/100
428(30%)
429if there are currently
430.Dq start
431(10)
432unauthenticated connections.
433The probability increases linearly and all connection attempts
434are refused if the number of unauthenticated connections reaches
435.Dq full
436(60).
437.It Cm PasswordAuthentication
438Specifies whether password authentication is allowed.
439The default is
440.Dq yes .
441.It Cm PermitEmptyPasswords
442When password authentication is allowed, it specifies whether the
443server allows login to accounts with empty password strings.
444The default is
445.Dq no .
446.It Cm PermitRootLogin
447Specifies whether root can login using
448.Xr ssh 1 .
449The argument must be
450.Dq yes ,
451.Dq without-password ,
452.Dq forced-commands-only
453or
454.Dq no .
455The default is
456.Dq yes .
457.Pp
458If this option is set to
459.Dq without-password
Darren Tucker96cc26b2004-04-14 13:04:35 +1000460password authentication is disabled for root. Note that other authentication
461methods (e.g., keyboard-interactive/PAM) may still allow root to login using
462a password.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000463.Pp
464If this option is set to
465.Dq forced-commands-only
466root login with public key authentication will be allowed,
467but only if the
468.Ar command
469option has been specified
470(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +1000471normally not allowed).
472All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000473.Pp
474If this option is set to
475.Dq no
476root is not allowed to login.
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000477.It Cm PermitUserEnvironment
478Specifies whether
479.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000480and
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000481.Cm environment=
482options in
483.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000484are processed by
485.Nm sshd .
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000486The default is
487.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000488Enabling environment processing may enable users to bypass access
489restrictions in some configurations using mechanisms such as
490.Ev LD_PRELOAD .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000491.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +0000492Specifies the file that contains the process ID of the
Ben Lindstrom9f049032002-06-21 00:59:05 +0000493.Nm sshd
494daemon.
495The default is
496.Pa /var/run/sshd.pid .
497.It Cm Port
498Specifies the port number that
499.Nm sshd
500listens on.
501The default is 22.
502Multiple options of this type are permitted.
503See also
504.Cm ListenAddress .
505.It Cm PrintLastLog
506Specifies whether
507.Nm sshd
508should print the date and time when the user last logged in.
509The default is
510.Dq yes .
511.It Cm PrintMotd
512Specifies whether
513.Nm sshd
514should print
515.Pa /etc/motd
516when a user logs in interactively.
517(On some systems it is also printed by the shell,
518.Pa /etc/profile ,
519or equivalent.)
520The default is
521.Dq yes .
522.It Cm Protocol
523Specifies the protocol versions
524.Nm sshd
Ben Lindstrom9c445542002-07-11 03:59:18 +0000525supports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000526The possible values are
527.Dq 1
528and
529.Dq 2 .
530Multiple versions must be comma-separated.
531The default is
532.Dq 2,1 .
Ben Lindstrom9c445542002-07-11 03:59:18 +0000533Note that the order of the protocol list does not indicate preference,
534because the client selects among multiple protocol versions offered
535by the server.
536Specifying
537.Dq 2,1
538is identical to
539.Dq 1,2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000540.It Cm PubkeyAuthentication
541Specifies whether public key authentication is allowed.
542The default is
543.Dq yes .
544Note that this option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000545.It Cm RhostsRSAAuthentication
546Specifies whether rhosts or /etc/hosts.equiv authentication together
547with successful RSA host authentication is allowed.
548The default is
549.Dq no .
550This option applies to protocol version 1 only.
551.It Cm RSAAuthentication
552Specifies whether pure RSA authentication is allowed.
553The default is
554.Dq yes .
555This option applies to protocol version 1 only.
556.It Cm ServerKeyBits
557Defines the number of bits in the ephemeral protocol version 1 server key.
558The minimum value is 512, and the default is 768.
559.It Cm StrictModes
560Specifies whether
561.Nm sshd
562should check file modes and ownership of the
563user's files and home directory before accepting login.
564This is normally desirable because novices sometimes accidentally leave their
565directory or files world-writable.
566The default is
567.Dq yes .
568.It Cm Subsystem
569Configures an external subsystem (e.g., file transfer daemon).
570Arguments should be a subsystem name and a command to execute upon subsystem
571request.
572The command
573.Xr sftp-server 8
574implements the
575.Dq sftp
576file transfer subsystem.
577By default no subsystems are defined.
578Note that this option applies to protocol version 2 only.
579.It Cm SyslogFacility
580Gives the facility code that is used when logging messages from
581.Nm sshd .
582The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
583LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
584The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +1100585.It Cm TCPKeepAlive
586Specifies whether the system should send TCP keepalive messages to the
587other side.
588If they are sent, death of the connection or crash of one
589of the machines will be properly noticed.
590However, this means that
591connections will die if the route is down temporarily, and some people
592find it annoying.
593On the other hand, if TCP keepalives are not sent,
594sessions may hang indefinitely on the server, leaving
595.Dq ghost
596users and consuming server resources.
597.Pp
598The default is
599.Dq yes
600(to send TCP keepalive messages), and the server will notice
601if the network goes down or the client host crashes.
602This avoids infinitely hanging sessions.
603.Pp
604To disable TCP keepalive messages, the value should be set to
605.Dq no .
Damien Miller3a961dc2003-06-03 10:25:48 +1000606.It Cm UseDNS
607Specifies whether
608.Nm sshd
609should lookup the remote host name and check that
610the resolved host name for the remote IP address maps back to the
611very same IP address.
612The default is
613.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000614.It Cm UseLogin
615Specifies whether
616.Xr login 1
617is used for interactive login sessions.
618The default is
619.Dq no .
620Note that
621.Xr login 1
622is never used for remote command execution.
623Note also, that if this is enabled,
624.Cm X11Forwarding
625will be disabled because
626.Xr login 1
627does not know how to handle
628.Xr xauth 1
Damien Miller495dca32003-04-01 21:42:14 +1000629cookies.
630If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000631.Cm UsePrivilegeSeparation
632is specified, it will be disabled after authentication.
Damien Miller2e193e22003-05-14 15:13:03 +1000633.It Cm UsePAM
Damien Millera8e06ce2003-11-21 23:48:55 +1100634Enables PAM authentication (via challenge-response) and session set up.
635If you enable this, you should probably disable
Damien Miller2e193e22003-05-14 15:13:03 +1000636.Cm PasswordAuthentication .
Damien Millera8e06ce2003-11-21 23:48:55 +1100637If you enable
Damien Miller2e193e22003-05-14 15:13:03 +1000638.CM UsePAM
Darren Tucker6c0c0702003-10-09 14:13:53 +1000639then you will not be able to run sshd as a non-root user. The default is
640.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000641.It Cm UsePrivilegeSeparation
642Specifies whether
643.Nm sshd
644separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +1000645to deal with incoming network traffic.
646After successful authentication, another process will be created that has
647the privilege of the authenticated user.
648The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +0000649escalation by containing any corruption within the unprivileged processes.
650The default is
651.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000652.It Cm X11DisplayOffset
653Specifies the first display number available for
654.Nm sshd Ns 's
655X11 forwarding.
656This prevents
657.Nm sshd
658from interfering with real X11 servers.
659The default is 10.
660.It Cm X11Forwarding
661Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +1000662The argument must be
663.Dq yes
664or
665.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000666The default is
667.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +1000668.Pp
669When X11 forwarding is enabled, there may be additional exposure to
670the server and to client displays if the
671.Nm sshd
672proxy display is configured to listen on the wildcard address (see
673.Cm X11UseLocalhost
674below), however this is not the default.
675Additionally, the authentication spoofing and authentication data
676verification and substitution occur on the client side.
677The security risk of using X11 forwarding is that the client's X11
678display server may be exposed to attack when the ssh client requests
679forwarding (see the warnings for
680.Cm ForwardX11
681in
Damien Millerf1ce5052003-06-11 22:04:39 +1000682.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +1000683A system administrator may have a stance in which they want to
684protect clients that may expose themselves to attack by unwittingly
685requesting X11 forwarding, which can warrant a
686.Dq no
687setting.
688.Pp
689Note that disabling X11 forwarding does not prevent users from
690forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000691X11 forwarding is automatically disabled if
692.Cm UseLogin
693is enabled.
694.It Cm X11UseLocalhost
695Specifies whether
696.Nm sshd
697should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +1000698the wildcard address.
699By default,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000700.Nm sshd
701binds the forwarding server to the loopback address and sets the
702hostname part of the
703.Ev DISPLAY
704environment variable to
705.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +0000706This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000707However, some older X11 clients may not function with this
708configuration.
709.Cm X11UseLocalhost
710may be set to
711.Dq no
712to specify that the forwarding server should be bound to the wildcard
713address.
714The argument must be
715.Dq yes
716or
717.Dq no .
718The default is
719.Dq yes .
720.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +1000721Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +0000722.Xr xauth 1
723program.
724The default is
725.Pa /usr/X11R6/bin/xauth .
726.El
727.Ss Time Formats
Ben Lindstrom9f049032002-06-21 00:59:05 +0000728.Nm sshd
729command-line arguments and configuration file options that specify time
730may be expressed using a sequence of the form:
731.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +0000732.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000733.Sm on
734where
735.Ar time
736is a positive integer value and
737.Ar qualifier
738is one of the following:
739.Pp
740.Bl -tag -width Ds -compact -offset indent
741.It Cm <none>
742seconds
743.It Cm s | Cm S
744seconds
745.It Cm m | Cm M
746minutes
747.It Cm h | Cm H
748hours
749.It Cm d | Cm D
750days
751.It Cm w | Cm W
752weeks
753.El
754.Pp
755Each member of the sequence is added together to calculate
756the total time value.
757.Pp
758Time format examples:
759.Pp
760.Bl -tag -width Ds -compact -offset indent
761.It 600
762600 seconds (10 minutes)
763.It 10m
76410 minutes
765.It 1h30m
7661 hour 30 minutes (90 minutes)
767.El
768.Sh FILES
769.Bl -tag -width Ds
770.It Pa /etc/ssh/sshd_config
771Contains configuration data for
772.Nm sshd .
773This file should be writable by root only, but it is recommended
774(though not necessary) that it be world-readable.
775.El
Damien Millerf1ce5052003-06-11 22:04:39 +1000776.Sh SEE ALSO
777.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000778.Sh AUTHORS
779OpenSSH is a derivative of the original and free
780ssh 1.2.12 release by Tatu Ylonen.
781Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
782Theo de Raadt and Dug Song
783removed many bugs, re-added newer features and
784created OpenSSH.
785Markus Friedl contributed the support for SSH
786protocol versions 1.5 and 2.0.
787Niels Provos and Markus Friedl contributed support
788for privilege separation.