blob: a5260d3581d7112c669a9c140338979c9fd23fc9 [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 Miller30da3442010-05-10 11:58:03 +100037.\" $OpenBSD: sshd_config.5,v 1.121 2010/05/07 11:30:30 djm Exp $
38.Dd $Mdocdate: May 7 2010 $
Ben Lindstrom9f049032002-06-21 00:59:05 +000039.Dt SSHD_CONFIG 5
40.Os
41.Sh NAME
42.Nm sshd_config
43.Nd OpenSSH SSH daemon configuration file
44.Sh SYNOPSIS
Damien Millerd94fc722007-01-05 16:29:30 +110045.Nm /etc/ssh/sshd_config
Ben Lindstrom9f049032002-06-21 00:59:05 +000046.Sh DESCRIPTION
Damien Millerf4f22b52006-03-15 11:57:25 +110047.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +000048reads configuration data from
49.Pa /etc/ssh/sshd_config
50(or the file specified with
51.Fl f
52on the command line).
53The file contains keyword-argument pairs, one per line.
54Lines starting with
55.Ql #
56and empty lines are interpreted as comments.
Damien Miller306d1182006-03-15 12:05:59 +110057Arguments may optionally be enclosed in double quotes
58.Pq \&"
59in order to represent arguments containing spaces.
Ben Lindstrom9f049032002-06-21 00:59:05 +000060.Pp
61The possible
62keywords and their meanings are as follows (note that
63keywords are case-insensitive and arguments are case-sensitive):
64.Bl -tag -width Ds
Darren Tucker46bc0752004-05-02 22:11:30 +100065.It Cm AcceptEnv
66Specifies what environment variables sent by the client will be copied into
67the session's
68.Xr environ 7 .
69See
70.Cm SendEnv
71in
72.Xr ssh_config 5
73for how to configure the client.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100074Note that environment passing is only supported for protocol 2.
Darren Tucker46bc0752004-05-02 22:11:30 +100075Variables are specified by name, which may contain the wildcard characters
Damien Miller208f1ed2006-03-15 11:56:03 +110076.Ql *
Darren Tucker46bc0752004-05-02 22:11:30 +100077and
78.Ql \&? .
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100079Multiple environment variables may be separated by whitespace or spread
Darren Tucker46bc0752004-05-02 22:11:30 +100080across multiple
81.Cm AcceptEnv
82directives.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100083Be warned that some environment variables could be used to bypass restricted
Darren Tucker46bc0752004-05-02 22:11:30 +100084user environments.
85For this reason, care should be taken in the use of this directive.
86The default is not to accept any environment variables.
Darren Tucker0f383232005-01-20 10:57:56 +110087.It Cm AddressFamily
88Specifies which address family should be used by
Damien Millerf4f22b52006-03-15 11:57:25 +110089.Xr sshd 8 .
Darren Tucker0f383232005-01-20 10:57:56 +110090Valid arguments are
91.Dq any ,
92.Dq inet
Damien Miller5b0d63f2006-03-15 11:56:56 +110093(use IPv4 only), or
Darren Tucker0f383232005-01-20 10:57:56 +110094.Dq inet6
95(use IPv6 only).
96The default is
97.Dq any .
Damien Millere9890192008-05-19 14:59:02 +100098.It Cm AllowAgentForwarding
99Specifies whether
100.Xr ssh-agent 1
101forwarding is permitted.
102The default is
103.Dq yes .
104Note that disabling agent forwarding does not improve security
105unless users are also denied shell access, as they can always install
106their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000107.It Cm AllowGroups
108This keyword can be followed by a list of group name patterns, separated
109by spaces.
110If specified, login is allowed only for users whose primary
111group or supplementary group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000112Only group names are valid; a numerical group ID is not recognized.
113By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100114The allow/deny directives are processed in the following order:
115.Cm DenyUsers ,
116.Cm AllowUsers ,
117.Cm DenyGroups ,
118and finally
119.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100120.Pp
121See
122.Sx PATTERNS
123in
124.Xr ssh_config 5
125for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000126.It Cm AllowTcpForwarding
127Specifies whether TCP forwarding is permitted.
128The default is
129.Dq yes .
130Note that disabling TCP forwarding does not improve security unless
131users are also denied shell access, as they can always install their
132own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000133.It Cm AllowUsers
134This keyword can be followed by a list of user name patterns, separated
135by spaces.
Damien Miller5a93add2003-01-24 11:34:52 +1100136If specified, login is allowed only for user names that
Ben Lindstrom9f049032002-06-21 00:59:05 +0000137match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000138Only user names are valid; a numerical user ID is not recognized.
139By default, login is allowed for all users.
140If the pattern takes the form USER@HOST then USER and HOST
141are separately checked, restricting logins to particular
142users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100143The allow/deny directives are processed in the following order:
144.Cm DenyUsers ,
145.Cm AllowUsers ,
146.Cm DenyGroups ,
147and finally
148.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100149.Pp
150See
151.Sx PATTERNS
152in
153.Xr ssh_config 5
154for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000155.It Cm AuthorizedKeysFile
156Specifies the file that contains the public keys that can be used
157for user authentication.
158.Cm AuthorizedKeysFile
159may contain tokens of the form %T which are substituted during connection
Damien Miller5b0d63f2006-03-15 11:56:56 +1100160setup.
Damien Millerfbf486b2003-05-23 18:44:23 +1000161The following tokens are defined: %% is replaced by a literal '%',
Damien Miller5b0d63f2006-03-15 11:56:56 +1100162%h is replaced by the home directory of the user being authenticated, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000163%u is replaced by the username of that user.
164After expansion,
165.Cm AuthorizedKeysFile
166is taken to be an absolute path or one relative to the user's home
167directory.
168The default is
169.Dq .ssh/authorized_keys .
Damien Miller30da3442010-05-10 11:58:03 +1000170.It Cm AuthorizedPrincipalsFile
171Specifies a file that lists principal names that are accepted for
172certificate authentication.
173When using certificates signed by a key listed in
174.Cm TrustedUserCAKeys ,
175this file lists names, one of which must appear in the certificate for it
176to be accepted for authentication.
177Names are listed one per line; empty lines and comments starting with
178.Ql #
179are ignored.
180.Pp
181.Cm AuthorizedPrincipalsFile
182may contain tokens of the form %T which are substituted during connection
183setup.
184The following tokens are defined: %% is replaced by a literal '%',
185%h is replaced by the home directory of the user being authenticated, and
186%u is replaced by the username of that user.
187After expansion,
188.Cm AuthorizedPrincipalsFile
189is taken to be an absolute path or one relative to the user's home
190directory.
191.Pp
192The default is not to use a principals file - in this case, the username
193of the user must appear in a certificate's principals list for it to be
194accepted.
195Note that
196.Cm AuthorizedPrincipalsFile
197is only used when authentication proceeds using a CA listed in
198.Cm TrustedUserCAKeys
199and is not consulted for certification authorities trusted via
200.Pa ~/.ssh/authorized_keys ,
201though the
202.Cm principals=
203key option offers a similar facility (see
204.Xr sshd 8
205for details).
206.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000207.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000208The contents of the specified file are sent to the remote user before
209authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000210If the argument is
211.Dq none
212then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000213This option is only available for protocol version 2.
214By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000215.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000216Specifies whether challenge-response authentication is allowed (e.g. via
217PAM or though authentication styles supported in
218.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000219The default is
220.Dq yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100221.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100222Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100223.Xr chroot 2
224to after authentication.
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100225All components of the pathname must be root-owned directories that are
Damien Millerd8cb1f12008-02-10 22:40:12 +1100226not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000227After the chroot,
228.Xr sshd 8
229changes the working directory to the user's home directory.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100230.Pp
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100231The pathname may contain the following tokens that are expanded at runtime once
Damien Millerd8cb1f12008-02-10 22:40:12 +1100232the connecting user has been authenticated: %% is replaced by a literal '%',
233%h is replaced by the home directory of the user being authenticated, and
234%u is replaced by the username of that user.
235.Pp
236The
237.Cm ChrootDirectory
238must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000239user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100240For an interactive session this requires at least a shell, typically
241.Xr sh 1 ,
242and basic
243.Pa /dev
244nodes such as
245.Xr null 4 ,
246.Xr zero 4 ,
247.Xr stdin 4 ,
248.Xr stdout 4 ,
249.Xr stderr 4 ,
250.Xr arandom 4
251and
252.Xr tty 4
253devices.
254For file transfer sessions using
Darren Tuckerf92077f2009-06-21 17:56:25 +1000255.Dq sftp ,
Damien Millerd8cb1f12008-02-10 22:40:12 +1100256no additional configuration of the environment is necessary if the
Darren Tuckerf92077f2009-06-21 17:56:25 +1000257in-process sftp server is used,
258though sessions which use logging do require
Darren Tucker00fcd712009-06-21 17:56:00 +1000259.Pa /dev/log
260inside the chroot directory (see
261.Xr sftp-server 8
262for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100263.Pp
264The default is not to
265.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000266.It Cm Ciphers
267Specifies the ciphers allowed for protocol version 2.
268Multiple ciphers must be comma-separated.
Damien Miller05202ff2004-06-15 10:30:39 +1000269The supported ciphers are
270.Dq 3des-cbc ,
271.Dq aes128-cbc ,
272.Dq aes192-cbc ,
273.Dq aes256-cbc ,
274.Dq aes128-ctr ,
275.Dq aes192-ctr ,
276.Dq aes256-ctr ,
Damien Miller3710f272005-05-26 12:19:17 +1000277.Dq arcfour128 ,
278.Dq arcfour256 ,
Damien Miller05202ff2004-06-15 10:30:39 +1000279.Dq arcfour ,
280.Dq blowfish-cbc ,
281and
282.Dq cast128-cbc .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100283The default is:
284.Bd -literal -offset 3n
Damien Miller9aa72ba2009-01-28 16:34:00 +1100285aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,
286aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,
287aes256-cbc,arcfour
Ben Lindstrom9f049032002-06-21 00:59:05 +0000288.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +0000289.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100290Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000291sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100292.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000293receiving any messages back from the client.
294If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100295sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000296It is important to note that the use of client alive messages is very
297different from
Damien Miller12c150e2003-12-17 16:31:10 +1100298.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000299(below).
300The client alive messages are sent through the encrypted channel
301and therefore will not be spoofable.
302The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100303.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000304is spoofable.
305The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000306server depend on knowing when a connection has become inactive.
307.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000308The default value is 3.
309If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000310.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100311(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000312.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100313is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000314will be disconnected after approximately 45 seconds.
Damien Millercc3e8ba2006-03-15 12:06:55 +1100315This option applies to protocol version 2 only.
Damien Miller1594ad52005-05-26 12:12:19 +1000316.It Cm ClientAliveInterval
317Sets a timeout interval in seconds after which if no data has been received
318from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100319.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000320will send a message through the encrypted
321channel to request a response from the client.
322The default
323is 0, indicating that these messages will not be sent to the client.
324This option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000325.It Cm Compression
Damien Miller9786e6e2005-07-26 21:54:56 +1000326Specifies whether compression is allowed, or delayed until
327the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000328The argument must be
Damien Miller9786e6e2005-07-26 21:54:56 +1000329.Dq yes ,
330.Dq delayed ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000331or
332.Dq no .
333The default is
Damien Miller9786e6e2005-07-26 21:54:56 +1000334.Dq delayed .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000335.It Cm DenyGroups
336This keyword can be followed by a list of group name patterns, separated
337by spaces.
338Login is disallowed for users whose primary group or supplementary
339group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000340Only group names are valid; a numerical group ID is not recognized.
341By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100342The allow/deny directives are processed in the following order:
343.Cm DenyUsers ,
344.Cm AllowUsers ,
345.Cm DenyGroups ,
346and finally
347.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100348.Pp
349See
350.Sx PATTERNS
351in
352.Xr ssh_config 5
353for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000354.It Cm DenyUsers
355This keyword can be followed by a list of user name patterns, separated
356by spaces.
357Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000358Only user names are valid; a numerical user ID is not recognized.
359By default, login is allowed for all users.
360If the pattern takes the form USER@HOST then USER and HOST
361are separately checked, restricting logins to particular
362users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100363The allow/deny directives are processed in the following order:
364.Cm DenyUsers ,
365.Cm AllowUsers ,
366.Cm DenyGroups ,
367and finally
368.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100369.Pp
370See
371.Sx PATTERNS
372in
373.Xr ssh_config 5
374for more information on patterns.
Damien Millere2754432006-07-24 14:06:47 +1000375.It Cm ForceCommand
376Forces the execution of the command specified by
377.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100378ignoring any command supplied by the client and
379.Pa ~/.ssh/rc
380if present.
Damien Millere2754432006-07-24 14:06:47 +1000381The command is invoked by using the user's login shell with the -c option.
382This applies to shell, command, or subsystem execution.
383It is most useful inside a
384.Cm Match
385block.
386The command originally supplied by the client is available in the
387.Ev SSH_ORIGINAL_COMMAND
388environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100389Specifying a command of
390.Dq internal-sftp
391will force the use of an in-process sftp server that requires no support
392files when used with
393.Cm ChrootDirectory .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000394.It Cm GatewayPorts
395Specifies whether remote hosts are allowed to connect to ports
396forwarded for the client.
397By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100398.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000399binds remote port forwardings to the loopback address.
400This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000401.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100402can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100403should allow remote port forwardings to bind to non-loopback addresses, thus
404allowing other hosts to connect.
405The argument may be
406.Dq no
407to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000408.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100409to force remote port forwardings to bind to the wildcard address, or
410.Dq clientspecified
411to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000412The default is
413.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000414.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000415Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100416The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000417.Dq no .
418Note that this option applies to protocol version 2 only.
419.It Cm GSSAPICleanupCredentials
420Specifies whether to automatically destroy the user's credentials cache
421on logout.
422The default is
423.Dq yes .
424Note that this option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000425.It Cm HostbasedAuthentication
426Specifies whether rhosts or /etc/hosts.equiv authentication together
427with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100428(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000429This option is similar to
430.Cm RhostsRSAAuthentication
431and applies to protocol version 2 only.
432The default is
433.Dq no .
Damien Millerb594f382006-08-30 11:06:34 +1000434.It Cm HostbasedUsesNameFromPacketOnly
435Specifies whether or not the server will attempt to perform a reverse
436name lookup when matching the name in the
437.Pa ~/.shosts ,
438.Pa ~/.rhosts ,
439and
440.Pa /etc/hosts.equiv
441files during
442.Cm HostbasedAuthentication .
443A setting of
444.Dq yes
445means that
446.Xr sshd 8
447uses the name supplied by the client rather than
448attempting to resolve the name from the TCP connection itself.
449The default is
450.Dq no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100451.It Cm HostCertificate
452Specifies a file containing a public host certificate.
453The certificate's public key must match a private host key already specified
454by
455.Cm HostKey .
456The default behaviour of
457.Xr sshd 8
458is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000459.It Cm HostKey
460Specifies a file containing a private host key
461used by SSH.
462The default is
463.Pa /etc/ssh/ssh_host_key
464for protocol version 1, and
465.Pa /etc/ssh/ssh_host_rsa_key
466and
467.Pa /etc/ssh/ssh_host_dsa_key
468for protocol version 2.
469Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100470.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000471will refuse to use a file if it is group/world-accessible.
472It is possible to have multiple host key files.
473.Dq rsa1
474keys are used for version 1 and
475.Dq dsa
476or
477.Dq rsa
478are used for version 2 of the SSH protocol.
479.It Cm IgnoreRhosts
480Specifies that
481.Pa .rhosts
482and
483.Pa .shosts
484files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000485.Cm RhostsRSAAuthentication
486or
487.Cm HostbasedAuthentication .
488.Pp
489.Pa /etc/hosts.equiv
490and
491.Pa /etc/shosts.equiv
492are still used.
493The default is
494.Dq yes .
495.It Cm IgnoreUserKnownHosts
496Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100497.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000498should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000499.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000500during
501.Cm RhostsRSAAuthentication
502or
503.Cm HostbasedAuthentication .
504The default is
505.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000506.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000507Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000508.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000509will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000510To use this option, the server needs a
511Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100512The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000513.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100514.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000515If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100516an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100517The default is
Damien Miller8448e662004-03-08 23:13:15 +1100518.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000519.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100520If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000521the password will be validated via any additional local mechanism
522such as
523.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100524The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000525.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000526.It Cm KerberosTicketCleanup
527Specifies whether to automatically destroy the user's ticket cache
528file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100529The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000530.Dq yes .
531.It Cm KeyRegenerationInterval
532In protocol version 1, the ephemeral server key is automatically regenerated
533after this many seconds (if it has been used).
534The purpose of regeneration is to prevent
535decrypting captured sessions by later breaking into the machine and
536stealing the keys.
537The key is never stored anywhere.
538If the value is 0, the key is never regenerated.
539The default is 3600 (seconds).
540.It Cm ListenAddress
541Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100542.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000543should listen on.
544The following forms may be used:
545.Pp
546.Bl -item -offset indent -compact
547.It
548.Cm ListenAddress
549.Sm off
550.Ar host No | Ar IPv4_addr No | Ar IPv6_addr
551.Sm on
552.It
553.Cm ListenAddress
554.Sm off
555.Ar host No | Ar IPv4_addr No : Ar port
556.Sm on
557.It
558.Cm ListenAddress
559.Sm off
560.Oo
561.Ar host No | Ar IPv6_addr Oc : Ar port
562.Sm on
563.El
564.Pp
565If
566.Ar port
567is not specified,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100568sshd will listen on the address and all prior
Ben Lindstrom9f049032002-06-21 00:59:05 +0000569.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000570options specified.
571The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000572Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000573.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000574options are permitted.
575Additionally, any
Ben Lindstrom9f049032002-06-21 00:59:05 +0000576.Cm Port
Damien Miller5b0d63f2006-03-15 11:56:56 +1100577options must precede this option for non-port qualified addresses.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000578.It Cm LoginGraceTime
579The server disconnects after this time if the user has not
580successfully logged in.
581If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000582The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000583.It Cm LogLevel
584Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100585.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000586The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100587QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000588The default is INFO.
589DEBUG and DEBUG1 are equivalent.
590DEBUG2 and DEBUG3 each specify higher levels of debugging output.
591Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000592.It Cm MACs
593Specifies the available MAC (message authentication code) algorithms.
594The MAC algorithm is used in protocol version 2
595for data integrity protection.
596Multiple algorithms must be comma-separated.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100597The default is:
Damien Miller22b7b492007-06-11 14:07:12 +1000598.Bd -literal -offset indent
599hmac-md5,hmac-sha1,umac-64@openssh.com,
600hmac-ripemd160,hmac-sha1-96,hmac-md5-96
601.Ed
Darren Tucker45150472006-07-12 22:34:17 +1000602.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +1000603Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +1000604If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +1000605.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000606line are satisfied, the keywords on the following lines override those
607set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +1000608.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000609line or the end of the file.
Darren Tucker7a3935d2008-06-10 22:59:10 +1000610.Pp
Damien Millerd04f3572006-07-24 13:46:50 +1000611The arguments to
Darren Tucker45150472006-07-12 22:34:17 +1000612.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000613are one or more criteria-pattern pairs.
Darren Tucker45150472006-07-12 22:34:17 +1000614The available criteria are
615.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +1000616.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +1000617.Cm Host ,
618and
619.Cm Address .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000620The match patterns may consist of single entries or comma-separated
621lists and may use the wildcard and negation operators described in the
Darren Tuckerb06cc4a2008-06-10 22:59:53 +1000622.Sx PATTERNS
Darren Tucker7a3935d2008-06-10 22:59:10 +1000623section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +1000624.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000625.Pp
626The patterns in an
627.Cm Address
628criteria may additionally contain addresses to match in CIDR
Darren Tucker6a2a4002008-06-10 23:03:04 +1000629address/masklen format, e.g.\&
Darren Tucker7a3935d2008-06-10 22:59:10 +1000630.Dq 192.0.2.0/24
631or
632.Dq 3ffe:ffff::/32 .
633Note that the mask length provided must be consistent with the address -
634it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +1000635or one with bits set in this host portion of the address.
636For example,
Darren Tucker7a3935d2008-06-10 22:59:10 +1000637.Dq 192.0.2.0/33
638and
Darren Tucker6a2a4002008-06-10 23:03:04 +1000639.Dq 192.0.2.0/8
Darren Tucker7a3935d2008-06-10 22:59:10 +1000640respectively.
641.Pp
Darren Tucker45150472006-07-12 22:34:17 +1000642Only a subset of keywords may be used on the lines following a
643.Cm Match
644keyword.
645Available keywords are
Damien Miller17819012009-01-28 16:20:17 +1100646.Cm AllowAgentForwarding ,
Damien Miller9b439df2006-07-24 14:04:00 +1000647.Cm AllowTcpForwarding ,
Darren Tucker1629c072007-02-19 22:25:37 +1100648.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +1000649.Cm ChrootDirectory ,
Damien Millere2754432006-07-24 14:06:47 +1000650.Cm ForceCommand ,
Damien Miller9b439df2006-07-24 14:04:00 +1000651.Cm GatewayPorts ,
Damien Miller25434de2008-05-19 14:29:08 +1000652.Cm GSSAPIAuthentication ,
653.Cm HostbasedAuthentication ,
Darren Tucker1d75f222007-03-01 21:31:28 +1100654.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +1100655.Cm KerberosAuthentication ,
Damien Miller307c1d12008-06-16 07:56:20 +1000656.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +1000657.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +1100658.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +1100659.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +1000660.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +1100661.Cm PermitRootLogin ,
Darren Tucker1477ea12009-10-07 08:36:05 +1100662.Cm PubkeyAuthentication ,
Darren Tucker1629c072007-02-19 22:25:37 +1100663.Cm RhostsRSAAuthentication ,
664.Cm RSAAuthentication ,
Damien Millerd1de9952006-07-24 14:05:48 +1000665.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +1100666.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +1000667and
Damien Miller0296ae82009-02-23 11:00:24 +1100668.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +1000669.It Cm MaxAuthTries
670Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +1000671connection.
672Once the number of failures reaches half this value,
673additional failures are logged.
674The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +1000675.It Cm MaxSessions
676Specifies the maximum number of open sessions permitted per network connection.
677The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000678.It Cm MaxStartups
679Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +1100680SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000681Additional connections will be dropped until authentication succeeds or the
682.Cm LoginGraceTime
683expires for a connection.
684The default is 10.
685.Pp
686Alternatively, random early drop can be enabled by specifying
687the three colon separated values
688.Dq start:rate:full
Damien Miller208f1ed2006-03-15 11:56:03 +1100689(e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +1100690.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000691will refuse connection attempts with a probability of
692.Dq rate/100
693(30%)
694if there are currently
695.Dq start
696(10)
697unauthenticated connections.
698The probability increases linearly and all connection attempts
699are refused if the number of unauthenticated connections reaches
700.Dq full
701(60).
702.It Cm PasswordAuthentication
703Specifies whether password authentication is allowed.
704The default is
705.Dq yes .
706.It Cm PermitEmptyPasswords
707When password authentication is allowed, it specifies whether the
708server allows login to accounts with empty password strings.
709The default is
710.Dq no .
Damien Miller9b439df2006-07-24 14:04:00 +1000711.It Cm PermitOpen
712Specifies the destinations to which TCP port forwarding is permitted.
713The forwarding specification must be one of the following forms:
714.Pp
715.Bl -item -offset indent -compact
716.It
717.Cm PermitOpen
718.Sm off
719.Ar host : port
720.Sm on
721.It
722.Cm PermitOpen
723.Sm off
724.Ar IPv4_addr : port
725.Sm on
726.It
727.Cm PermitOpen
728.Sm off
729.Ar \&[ IPv6_addr \&] : port
730.Sm on
731.El
732.Pp
Damien Millera765cf42006-07-24 14:08:13 +1000733Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +1000734An argument of
735.Dq any
736can be used to remove all restrictions and permit any forwarding requests.
Damien Miller65bc2c42006-07-24 14:04:16 +1000737By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000738.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +1100739Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +0000740.Xr ssh 1 .
741The argument must be
742.Dq yes ,
743.Dq without-password ,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100744.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000745or
746.Dq no .
747The default is
748.Dq yes .
749.Pp
750If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100751.Dq without-password ,
Darren Tucker9dca0992005-02-01 19:16:45 +1100752password authentication is disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000753.Pp
754If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100755.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000756root login with public key authentication will be allowed,
757but only if the
758.Ar command
759option has been specified
760(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +1000761normally not allowed).
762All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000763.Pp
764If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100765.Dq no ,
Darren Tuckerb3509012005-01-20 11:01:46 +1100766root is not allowed to log in.
Damien Millerd27b9472005-12-13 19:29:02 +1100767.It Cm PermitTunnel
768Specifies whether
769.Xr tun 4
770device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +1100771The argument must be
772.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +1000773.Dq point-to-point
774(layer 3),
775.Dq ethernet
776(layer 2), or
Damien Miller7b58e802005-12-13 19:33:19 +1100777.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +1000778Specifying
779.Dq yes
780permits both
781.Dq point-to-point
782and
783.Dq ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +1100784The default is
785.Dq no .
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000786.It Cm PermitUserEnvironment
787Specifies whether
788.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000789and
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000790.Cm environment=
791options in
792.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000793are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +1100794.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000795The default is
796.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000797Enabling environment processing may enable users to bypass access
798restrictions in some configurations using mechanisms such as
799.Ev LD_PRELOAD .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000800.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +0000801Specifies the file that contains the process ID of the
Damien Millerf4f22b52006-03-15 11:57:25 +1100802SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000803The default is
804.Pa /var/run/sshd.pid .
805.It Cm Port
806Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100807.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000808listens on.
809The default is 22.
810Multiple options of this type are permitted.
811See also
812.Cm ListenAddress .
813.It Cm PrintLastLog
814Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100815.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +1100816should print the date and time of the last user login when a user logs
817in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000818The default is
819.Dq yes .
820.It Cm PrintMotd
821Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100822.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000823should print
824.Pa /etc/motd
825when a user logs in interactively.
826(On some systems it is also printed by the shell,
827.Pa /etc/profile ,
828or equivalent.)
829The default is
830.Dq yes .
831.It Cm Protocol
832Specifies the protocol versions
Damien Miller5b0d63f2006-03-15 11:56:56 +1100833.Xr sshd 8
Ben Lindstrom9c445542002-07-11 03:59:18 +0000834supports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000835The possible values are
Damien Miller5b0d63f2006-03-15 11:56:56 +1100836.Sq 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000837and
Damien Miller5b0d63f2006-03-15 11:56:56 +1100838.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000839Multiple versions must be comma-separated.
840The default is
Darren Tucker7a4a7652009-10-11 21:51:40 +1100841.Sq 2 .
Ben Lindstrom9c445542002-07-11 03:59:18 +0000842Note that the order of the protocol list does not indicate preference,
843because the client selects among multiple protocol versions offered
844by the server.
845Specifying
846.Dq 2,1
847is identical to
848.Dq 1,2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000849.It Cm PubkeyAuthentication
850Specifies whether public key authentication is allowed.
851The default is
852.Dq yes .
853Note that this option applies to protocol version 2 only.
Damien Miller1aed65e2010-03-04 21:53:35 +1100854.It Cm RevokedKeys
855Specifies a list of revoked public keys.
856Keys listed in this file will be refused for public key authentication.
857Note that if this file is not readable, then public key authentication will
858be refused for all users.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000859.It Cm RhostsRSAAuthentication
860Specifies whether rhosts or /etc/hosts.equiv authentication together
861with successful RSA host authentication is allowed.
862The default is
863.Dq no .
864This option applies to protocol version 1 only.
865.It Cm RSAAuthentication
866Specifies whether pure RSA authentication is allowed.
867The default is
868.Dq yes .
869This option applies to protocol version 1 only.
870.It Cm ServerKeyBits
871Defines the number of bits in the ephemeral protocol version 1 server key.
Darren Tucker7499b0c2008-07-02 22:35:43 +1000872The minimum value is 512, and the default is 1024.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000873.It Cm StrictModes
874Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100875.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000876should check file modes and ownership of the
877user's files and home directory before accepting login.
878This is normally desirable because novices sometimes accidentally leave their
879directory or files world-writable.
880The default is
881.Dq yes .
Darren Tuckerf788a912010-01-08 17:06:47 +1100882Note that this does not apply to
883.Cm ChrootDirectory ,
884whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000885.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +1100886Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +1000887Arguments should be a subsystem name and a command (with optional arguments)
888to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100889.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000890The command
891.Xr sftp-server 8
892implements the
893.Dq sftp
894file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100895.Pp
896Alternately the name
897.Dq internal-sftp
898implements an in-process
899.Dq sftp
900server.
901This may simplify configurations using
902.Cm ChrootDirectory
903to force a different filesystem root on clients.
904.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000905By default no subsystems are defined.
906Note that this option applies to protocol version 2 only.
907.It Cm SyslogFacility
908Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100909.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000910The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
911LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
912The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +1100913.It Cm TCPKeepAlive
914Specifies whether the system should send TCP keepalive messages to the
915other side.
916If they are sent, death of the connection or crash of one
917of the machines will be properly noticed.
918However, this means that
919connections will die if the route is down temporarily, and some people
920find it annoying.
921On the other hand, if TCP keepalives are not sent,
922sessions may hang indefinitely on the server, leaving
923.Dq ghost
924users and consuming server resources.
925.Pp
926The default is
927.Dq yes
928(to send TCP keepalive messages), and the server will notice
929if the network goes down or the client host crashes.
930This avoids infinitely hanging sessions.
931.Pp
932To disable TCP keepalive messages, the value should be set to
933.Dq no .
Damien Miller1aed65e2010-03-04 21:53:35 +1100934.It Cm TrustedUserCAKeys
935Specifies a file containing public keys of certificate authorities that are
Damien Millerc6db99e2010-03-05 10:41:45 +1100936trusted to sign user certificates for authentication.
Damien Miller72b33822010-03-05 07:39:01 +1100937Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +1100938.Ql #
939are allowed.
940If a certificate is presented for authentication and has its signing CA key
941listed in this file, then it may be used for authentication for any user
942listed in the certificate's principals list.
943Note that certificates that lack a list of principals will not be permitted
944for authentication using
945.Cm TrustedUserCAKeys .
Damien Miller72b33822010-03-05 07:39:01 +1100946For more details on certificates, see the
Damien Miller1aed65e2010-03-04 21:53:35 +1100947.Sx CERTIFICATES
948section in
949.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +1000950.It Cm UseDNS
951Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100952.Xr sshd 8
Darren Tucker83d5a982005-03-31 21:33:50 +1000953should look up the remote host name and check that
Damien Miller3a961dc2003-06-03 10:25:48 +1000954the resolved host name for the remote IP address maps back to the
955very same IP address.
956The default is
957.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000958.It Cm UseLogin
959Specifies whether
960.Xr login 1
961is used for interactive login sessions.
962The default is
963.Dq no .
964Note that
965.Xr login 1
966is never used for remote command execution.
967Note also, that if this is enabled,
968.Cm X11Forwarding
969will be disabled because
970.Xr login 1
971does not know how to handle
972.Xr xauth 1
Damien Miller495dca32003-04-01 21:42:14 +1000973cookies.
974If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000975.Cm UsePrivilegeSeparation
976is specified, it will be disabled after authentication.
Damien Miller2e193e22003-05-14 15:13:03 +1000977.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +1000978Enables the Pluggable Authentication Module interface.
979If set to
980.Dq yes
981this will enable PAM authentication using
982.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +1100983and
984.Cm PasswordAuthentication
985in addition to PAM account and session module processing for all
986authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +1000987.Pp
988Because PAM challenge-response authentication usually serves an equivalent
989role to password authentication, you should disable either
990.Cm PasswordAuthentication
991or
992.Cm ChallengeResponseAuthentication.
993.Pp
994If
995.Cm UsePAM
996is enabled, you will not be able to run
997.Xr sshd 8
998as a non-root user.
999The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +10001000.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001001.It Cm UsePrivilegeSeparation
1002Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001003.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001004separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +10001005to deal with incoming network traffic.
1006After successful authentication, another process will be created that has
1007the privilege of the authenticated user.
1008The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +00001009escalation by containing any corruption within the unprivileged processes.
1010The default is
1011.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001012.It Cm X11DisplayOffset
1013Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001014.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001015X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001016This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001017The default is 10.
1018.It Cm X11Forwarding
1019Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001020The argument must be
1021.Dq yes
1022or
1023.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001024The default is
1025.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +10001026.Pp
1027When X11 forwarding is enabled, there may be additional exposure to
1028the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001029.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001030proxy display is configured to listen on the wildcard address (see
1031.Cm X11UseLocalhost
Damien Miller5b0d63f2006-03-15 11:56:56 +11001032below), though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001033Additionally, the authentication spoofing and authentication data
1034verification and substitution occur on the client side.
1035The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001036display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001037forwarding (see the warnings for
1038.Cm ForwardX11
1039in
Damien Millerf1ce5052003-06-11 22:04:39 +10001040.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001041A system administrator may have a stance in which they want to
1042protect clients that may expose themselves to attack by unwittingly
1043requesting X11 forwarding, which can warrant a
1044.Dq no
1045setting.
1046.Pp
1047Note that disabling X11 forwarding does not prevent users from
1048forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001049X11 forwarding is automatically disabled if
1050.Cm UseLogin
1051is enabled.
1052.It Cm X11UseLocalhost
1053Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001054.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001055should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001056the wildcard address.
1057By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001058sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001059hostname part of the
1060.Ev DISPLAY
1061environment variable to
1062.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001063This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001064However, some older X11 clients may not function with this
1065configuration.
1066.Cm X11UseLocalhost
1067may be set to
1068.Dq no
1069to specify that the forwarding server should be bound to the wildcard
1070address.
1071The argument must be
1072.Dq yes
1073or
1074.Dq no .
1075The default is
1076.Dq yes .
1077.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001078Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001079.Xr xauth 1
1080program.
1081The default is
1082.Pa /usr/X11R6/bin/xauth .
1083.El
Damien Millere3beba22006-03-15 11:59:25 +11001084.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001085.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001086command-line arguments and configuration file options that specify time
1087may be expressed using a sequence of the form:
1088.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001089.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001090.Sm on
1091where
1092.Ar time
1093is a positive integer value and
1094.Ar qualifier
1095is one of the following:
1096.Pp
1097.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001098.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001099seconds
1100.It Cm s | Cm S
1101seconds
1102.It Cm m | Cm M
1103minutes
1104.It Cm h | Cm H
1105hours
1106.It Cm d | Cm D
1107days
1108.It Cm w | Cm W
1109weeks
1110.El
1111.Pp
1112Each member of the sequence is added together to calculate
1113the total time value.
1114.Pp
1115Time format examples:
1116.Pp
1117.Bl -tag -width Ds -compact -offset indent
1118.It 600
1119600 seconds (10 minutes)
1120.It 10m
112110 minutes
1122.It 1h30m
11231 hour 30 minutes (90 minutes)
1124.El
1125.Sh FILES
1126.Bl -tag -width Ds
1127.It Pa /etc/ssh/sshd_config
1128Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001129.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001130This file should be writable by root only, but it is recommended
1131(though not necessary) that it be world-readable.
1132.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001133.Sh SEE ALSO
1134.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001135.Sh AUTHORS
1136OpenSSH is a derivative of the original and free
1137ssh 1.2.12 release by Tatu Ylonen.
1138Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1139Theo de Raadt and Dug Song
1140removed many bugs, re-added newer features and
1141created OpenSSH.
1142Markus Friedl contributed the support for SSH
1143protocol versions 1.5 and 2.0.
1144Niels Provos and Markus Friedl contributed support
1145for privilege separation.