blob: c3d6df30a60f884d25e3deae60fe2c13572c6ae2 [file] [log] [blame]
Ben Lindstrom9f049032002-06-21 00:59:05 +00001.\"
2.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
3.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4.\" All rights reserved
5.\"
6.\" As far as I am concerned, the code I have written for this software
7.\" can be used freely for any purpose. Any derived versions of this
8.\" software must be clearly marked as such, and if the derived work is
9.\" incompatible with the protocol description in the RFC file, it must be
10.\" called by a name other than "ssh" or "Secure Shell".
11.\"
12.\" Copyright (c) 1999,2000 Markus Friedl. All rights reserved.
13.\" Copyright (c) 1999 Aaron Campbell. All rights reserved.
14.\" Copyright (c) 1999 Theo de Raadt. All rights reserved.
15.\"
16.\" Redistribution and use in source and binary forms, with or without
17.\" modification, are permitted provided that the following conditions
18.\" are met:
19.\" 1. Redistributions of source code must retain the above copyright
20.\" notice, this list of conditions and the following disclaimer.
21.\" 2. Redistributions in binary form must reproduce the above copyright
22.\" notice, this list of conditions and the following disclaimer in the
23.\" documentation and/or other materials provided with the distribution.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
26.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
29.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35.\"
Damien Miller928362d2010-12-26 14:26:45 +110036.\" $OpenBSD: sshd_config.5,v 1.131 2010/12/08 04:02:47 djm Exp $
37.Dd $Mdocdate: December 8 2010 $
Ben Lindstrom9f049032002-06-21 00:59:05 +000038.Dt SSHD_CONFIG 5
39.Os
40.Sh NAME
41.Nm sshd_config
42.Nd OpenSSH SSH daemon configuration file
43.Sh SYNOPSIS
Damien Millerd94fc722007-01-05 16:29:30 +110044.Nm /etc/ssh/sshd_config
Ben Lindstrom9f049032002-06-21 00:59:05 +000045.Sh DESCRIPTION
Damien Millerf4f22b52006-03-15 11:57:25 +110046.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +000047reads configuration data from
48.Pa /etc/ssh/sshd_config
49(or the file specified with
50.Fl f
51on the command line).
52The file contains keyword-argument pairs, one per line.
53Lines starting with
54.Ql #
55and empty lines are interpreted as comments.
Damien Miller306d1182006-03-15 12:05:59 +110056Arguments may optionally be enclosed in double quotes
57.Pq \&"
58in order to represent arguments containing spaces.
Ben Lindstrom9f049032002-06-21 00:59:05 +000059.Pp
60The possible
61keywords and their meanings are as follows (note that
62keywords are case-insensitive and arguments are case-sensitive):
63.Bl -tag -width Ds
Darren Tucker46bc0752004-05-02 22:11:30 +100064.It Cm AcceptEnv
65Specifies what environment variables sent by the client will be copied into
66the session's
67.Xr environ 7 .
68See
69.Cm SendEnv
70in
71.Xr ssh_config 5
72for how to configure the client.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100073Note that environment passing is only supported for protocol 2.
Darren Tucker46bc0752004-05-02 22:11:30 +100074Variables are specified by name, which may contain the wildcard characters
Damien Miller208f1ed2006-03-15 11:56:03 +110075.Ql *
Darren Tucker46bc0752004-05-02 22:11:30 +100076and
77.Ql \&? .
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100078Multiple environment variables may be separated by whitespace or spread
Darren Tucker46bc0752004-05-02 22:11:30 +100079across multiple
80.Cm AcceptEnv
81directives.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100082Be warned that some environment variables could be used to bypass restricted
Darren Tucker46bc0752004-05-02 22:11:30 +100083user environments.
84For this reason, care should be taken in the use of this directive.
85The default is not to accept any environment variables.
Darren Tucker0f383232005-01-20 10:57:56 +110086.It Cm AddressFamily
87Specifies which address family should be used by
Damien Millerf4f22b52006-03-15 11:57:25 +110088.Xr sshd 8 .
Darren Tucker0f383232005-01-20 10:57:56 +110089Valid arguments are
90.Dq any ,
91.Dq inet
Damien Miller5b0d63f2006-03-15 11:56:56 +110092(use IPv4 only), or
Darren Tucker0f383232005-01-20 10:57:56 +110093.Dq inet6
94(use IPv6 only).
95The default is
96.Dq any .
Damien Millere9890192008-05-19 14:59:02 +100097.It Cm AllowAgentForwarding
98Specifies whether
99.Xr ssh-agent 1
100forwarding is permitted.
101The default is
102.Dq yes .
103Note that disabling agent forwarding does not improve security
104unless users are also denied shell access, as they can always install
105their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000106.It Cm AllowGroups
107This keyword can be followed by a list of group name patterns, separated
108by spaces.
109If specified, login is allowed only for users whose primary
110group or supplementary group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000111Only group names are valid; a numerical group ID is not recognized.
112By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100113The allow/deny directives are processed in the following order:
114.Cm DenyUsers ,
115.Cm AllowUsers ,
116.Cm DenyGroups ,
117and finally
118.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100119.Pp
120See
121.Sx PATTERNS
122in
123.Xr ssh_config 5
124for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000125.It Cm AllowTcpForwarding
126Specifies whether TCP forwarding is permitted.
127The default is
128.Dq yes .
129Note that disabling TCP forwarding does not improve security unless
130users are also denied shell access, as they can always install their
131own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000132.It Cm AllowUsers
133This keyword can be followed by a list of user name patterns, separated
134by spaces.
Damien Miller5a93add2003-01-24 11:34:52 +1100135If specified, login is allowed only for user names that
Ben Lindstrom9f049032002-06-21 00:59:05 +0000136match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000137Only user names are valid; a numerical user ID is not recognized.
138By default, login is allowed for all users.
139If the pattern takes the form USER@HOST then USER and HOST
140are separately checked, restricting logins to particular
141users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100142The allow/deny directives are processed in the following order:
143.Cm DenyUsers ,
144.Cm AllowUsers ,
145.Cm DenyGroups ,
146and finally
147.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100148.Pp
149See
150.Sx PATTERNS
151in
152.Xr ssh_config 5
153for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000154.It Cm AuthorizedKeysFile
155Specifies the file that contains the public keys that can be used
156for user authentication.
Damien Miller6018a362010-07-02 13:35:19 +1000157The format is described in the
158.Sx AUTHORIZED_KEYS FILE FORMAT
159section of
160.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000161.Cm AuthorizedKeysFile
162may contain tokens of the form %T which are substituted during connection
Damien Miller5b0d63f2006-03-15 11:56:56 +1100163setup.
Damien Millerfbf486b2003-05-23 18:44:23 +1000164The following tokens are defined: %% is replaced by a literal '%',
Damien Miller5b0d63f2006-03-15 11:56:56 +1100165%h is replaced by the home directory of the user being authenticated, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000166%u is replaced by the username of that user.
167After expansion,
168.Cm AuthorizedKeysFile
169is taken to be an absolute path or one relative to the user's home
170directory.
171The default is
172.Dq .ssh/authorized_keys .
Damien Miller30da3442010-05-10 11:58:03 +1000173.It Cm AuthorizedPrincipalsFile
174Specifies a file that lists principal names that are accepted for
175certificate authentication.
176When using certificates signed by a key listed in
177.Cm TrustedUserCAKeys ,
178this file lists names, one of which must appear in the certificate for it
179to be accepted for authentication.
Damien Millerd59dab82010-07-02 13:37:17 +1000180Names are listed one per line preceded by key options (as described
Damien Miller6018a362010-07-02 13:35:19 +1000181in
182.Sx AUTHORIZED_KEYS FILE FORMAT
183in
Damien Millerd59dab82010-07-02 13:37:17 +1000184.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000185Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000186.Ql #
187are ignored.
188.Pp
189.Cm AuthorizedPrincipalsFile
190may contain tokens of the form %T which are substituted during connection
191setup.
192The following tokens are defined: %% is replaced by a literal '%',
193%h is replaced by the home directory of the user being authenticated, and
194%u is replaced by the username of that user.
195After expansion,
196.Cm AuthorizedPrincipalsFile
197is taken to be an absolute path or one relative to the user's home
198directory.
199.Pp
Damien Miller81d3fc52010-05-10 11:58:45 +1000200The default is not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000201of the user must appear in a certificate's principals list for it to be
202accepted.
203Note that
204.Cm AuthorizedPrincipalsFile
205is only used when authentication proceeds using a CA listed in
206.Cm TrustedUserCAKeys
207and is not consulted for certification authorities trusted via
208.Pa ~/.ssh/authorized_keys ,
209though the
210.Cm principals=
211key option offers a similar facility (see
212.Xr sshd 8
213for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000214.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000215The contents of the specified file are sent to the remote user before
216authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000217If the argument is
218.Dq none
219then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000220This option is only available for protocol version 2.
221By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000222.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000223Specifies whether challenge-response authentication is allowed (e.g. via
224PAM or though authentication styles supported in
225.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000226The default is
227.Dq yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100228.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100229Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100230.Xr chroot 2
231to after authentication.
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100232All components of the pathname must be root-owned directories that are
Damien Millerd8cb1f12008-02-10 22:40:12 +1100233not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000234After the chroot,
235.Xr sshd 8
236changes the working directory to the user's home directory.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100237.Pp
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100238The pathname may contain the following tokens that are expanded at runtime once
Damien Millerd8cb1f12008-02-10 22:40:12 +1100239the connecting user has been authenticated: %% is replaced by a literal '%',
240%h is replaced by the home directory of the user being authenticated, and
241%u is replaced by the username of that user.
242.Pp
243The
244.Cm ChrootDirectory
245must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000246user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100247For an interactive session this requires at least a shell, typically
248.Xr sh 1 ,
249and basic
250.Pa /dev
251nodes such as
252.Xr null 4 ,
253.Xr zero 4 ,
254.Xr stdin 4 ,
255.Xr stdout 4 ,
256.Xr stderr 4 ,
257.Xr arandom 4
258and
259.Xr tty 4
260devices.
261For file transfer sessions using
Darren Tuckerf92077f2009-06-21 17:56:25 +1000262.Dq sftp ,
Damien Millerd8cb1f12008-02-10 22:40:12 +1100263no additional configuration of the environment is necessary if the
Darren Tuckerf92077f2009-06-21 17:56:25 +1000264in-process sftp server is used,
265though sessions which use logging do require
Darren Tucker00fcd712009-06-21 17:56:00 +1000266.Pa /dev/log
267inside the chroot directory (see
268.Xr sftp-server 8
269for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100270.Pp
271The default is not to
272.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000273.It Cm Ciphers
274Specifies the ciphers allowed for protocol version 2.
275Multiple ciphers must be comma-separated.
Damien Miller05202ff2004-06-15 10:30:39 +1000276The supported ciphers are
277.Dq 3des-cbc ,
278.Dq aes128-cbc ,
279.Dq aes192-cbc ,
280.Dq aes256-cbc ,
281.Dq aes128-ctr ,
282.Dq aes192-ctr ,
283.Dq aes256-ctr ,
Damien Miller3710f272005-05-26 12:19:17 +1000284.Dq arcfour128 ,
285.Dq arcfour256 ,
Damien Miller05202ff2004-06-15 10:30:39 +1000286.Dq arcfour ,
287.Dq blowfish-cbc ,
288and
289.Dq cast128-cbc .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100290The default is:
291.Bd -literal -offset 3n
Damien Miller9aa72ba2009-01-28 16:34:00 +1100292aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,
293aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,
294aes256-cbc,arcfour
Ben Lindstrom9f049032002-06-21 00:59:05 +0000295.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +0000296.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100297Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000298sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100299.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000300receiving any messages back from the client.
301If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100302sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000303It is important to note that the use of client alive messages is very
304different from
Damien Miller12c150e2003-12-17 16:31:10 +1100305.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000306(below).
307The client alive messages are sent through the encrypted channel
308and therefore will not be spoofable.
309The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100310.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000311is spoofable.
312The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000313server depend on knowing when a connection has become inactive.
314.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000315The default value is 3.
316If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000317.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100318(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000319.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100320is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000321will be disconnected after approximately 45 seconds.
Damien Millercc3e8ba2006-03-15 12:06:55 +1100322This option applies to protocol version 2 only.
Damien Miller1594ad52005-05-26 12:12:19 +1000323.It Cm ClientAliveInterval
324Sets a timeout interval in seconds after which if no data has been received
325from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100326.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000327will send a message through the encrypted
328channel to request a response from the client.
329The default
330is 0, indicating that these messages will not be sent to the client.
331This option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000332.It Cm Compression
Damien Miller9786e6e2005-07-26 21:54:56 +1000333Specifies whether compression is allowed, or delayed until
334the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000335The argument must be
Damien Miller9786e6e2005-07-26 21:54:56 +1000336.Dq yes ,
337.Dq delayed ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000338or
339.Dq no .
340The default is
Damien Miller9786e6e2005-07-26 21:54:56 +1000341.Dq delayed .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000342.It Cm DenyGroups
343This keyword can be followed by a list of group name patterns, separated
344by spaces.
345Login is disallowed for users whose primary group or supplementary
346group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000347Only group names are valid; a numerical group ID is not recognized.
348By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100349The allow/deny directives are processed in the following order:
350.Cm DenyUsers ,
351.Cm AllowUsers ,
352.Cm DenyGroups ,
353and finally
354.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100355.Pp
356See
357.Sx PATTERNS
358in
359.Xr ssh_config 5
360for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000361.It Cm DenyUsers
362This keyword can be followed by a list of user name patterns, separated
363by spaces.
364Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000365Only user names are valid; a numerical user ID is not recognized.
366By default, login is allowed for all users.
367If the pattern takes the form USER@HOST then USER and HOST
368are separately checked, restricting logins to particular
369users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100370The allow/deny directives are processed in the following order:
371.Cm DenyUsers ,
372.Cm AllowUsers ,
373.Cm DenyGroups ,
374and finally
375.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100376.Pp
377See
378.Sx PATTERNS
379in
380.Xr ssh_config 5
381for more information on patterns.
Damien Millere2754432006-07-24 14:06:47 +1000382.It Cm ForceCommand
383Forces the execution of the command specified by
384.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100385ignoring any command supplied by the client and
386.Pa ~/.ssh/rc
387if present.
Damien Millere2754432006-07-24 14:06:47 +1000388The command is invoked by using the user's login shell with the -c option.
389This applies to shell, command, or subsystem execution.
390It is most useful inside a
391.Cm Match
392block.
393The command originally supplied by the client is available in the
394.Ev SSH_ORIGINAL_COMMAND
395environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100396Specifying a command of
397.Dq internal-sftp
398will force the use of an in-process sftp server that requires no support
399files when used with
400.Cm ChrootDirectory .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000401.It Cm GatewayPorts
402Specifies whether remote hosts are allowed to connect to ports
403forwarded for the client.
404By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100405.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000406binds remote port forwardings to the loopback address.
407This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000408.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100409can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100410should allow remote port forwardings to bind to non-loopback addresses, thus
411allowing other hosts to connect.
412The argument may be
413.Dq no
414to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000415.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100416to force remote port forwardings to bind to the wildcard address, or
417.Dq clientspecified
418to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000419The default is
420.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000421.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000422Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100423The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000424.Dq no .
425Note that this option applies to protocol version 2 only.
426.It Cm GSSAPICleanupCredentials
427Specifies whether to automatically destroy the user's credentials cache
428on logout.
429The default is
430.Dq yes .
431Note that this option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000432.It Cm HostbasedAuthentication
433Specifies whether rhosts or /etc/hosts.equiv authentication together
434with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100435(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000436This option is similar to
437.Cm RhostsRSAAuthentication
438and applies to protocol version 2 only.
439The default is
440.Dq no .
Damien Millerb594f382006-08-30 11:06:34 +1000441.It Cm HostbasedUsesNameFromPacketOnly
442Specifies whether or not the server will attempt to perform a reverse
443name lookup when matching the name in the
444.Pa ~/.shosts ,
445.Pa ~/.rhosts ,
446and
447.Pa /etc/hosts.equiv
448files during
449.Cm HostbasedAuthentication .
450A setting of
451.Dq yes
452means that
453.Xr sshd 8
454uses the name supplied by the client rather than
455attempting to resolve the name from the TCP connection itself.
456The default is
457.Dq no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100458.It Cm HostCertificate
459Specifies a file containing a public host certificate.
460The certificate's public key must match a private host key already specified
461by
462.Cm HostKey .
463The default behaviour of
464.Xr sshd 8
465is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000466.It Cm HostKey
467Specifies a file containing a private host key
468used by SSH.
469The default is
470.Pa /etc/ssh/ssh_host_key
471for protocol version 1, and
Damien Millereb8b60e2010-08-31 22:41:14 +1000472.Pa /etc/ssh/ssh_host_dsa_key ,
473.Pa /etc/ssh/ssh_host_ecdsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000474and
Damien Millereb8b60e2010-08-31 22:41:14 +1000475.Pa /etc/ssh/ssh_host_rsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000476for protocol version 2.
477Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100478.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000479will refuse to use a file if it is group/world-accessible.
480It is possible to have multiple host key files.
481.Dq rsa1
482keys are used for version 1 and
Damien Millereb8b60e2010-08-31 22:41:14 +1000483.Dq dsa ,
484.Dq ecdsa
Ben Lindstrom9f049032002-06-21 00:59:05 +0000485or
486.Dq rsa
487are used for version 2 of the SSH protocol.
488.It Cm IgnoreRhosts
489Specifies that
490.Pa .rhosts
491and
492.Pa .shosts
493files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000494.Cm RhostsRSAAuthentication
495or
496.Cm HostbasedAuthentication .
497.Pp
498.Pa /etc/hosts.equiv
499and
500.Pa /etc/shosts.equiv
501are still used.
502The default is
503.Dq yes .
504.It Cm IgnoreUserKnownHosts
505Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100506.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000507should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000508.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000509during
510.Cm RhostsRSAAuthentication
511or
512.Cm HostbasedAuthentication .
513The default is
514.Dq no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100515.It Cm IPQoS
516Specifies the IPv4 type-of-service or DSCP class for the connection.
517Accepted values are
518.Dq af11 ,
519.Dq af12 ,
520.Dq af13 ,
521.Dq af14 ,
522.Dq af22 ,
523.Dq af23 ,
524.Dq af31 ,
525.Dq af32 ,
526.Dq af33 ,
527.Dq af41 ,
528.Dq af42 ,
529.Dq af43 ,
530.Dq cs0 ,
531.Dq cs1 ,
532.Dq cs2 ,
533.Dq cs3 ,
534.Dq cs4 ,
535.Dq cs5 ,
536.Dq cs6 ,
537.Dq cs7 ,
538.Dq ef ,
539.Dq lowdelay ,
540.Dq throughput ,
541.Dq reliability ,
542or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +1100543This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100544If one argument is specified, it is used as the packet class unconditionally.
545If two values are specified, the first is automatically selected for
546interactive sessions and the second for non-interactive sessions.
547The default is
548.Dq lowdelay
549for interactive sessions and
550.Dq throughput
551for non-interactive sessions.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000552.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000553Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000554.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000555will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000556To use this option, the server needs a
557Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100558The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000559.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100560.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000561If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100562an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100563The default is
Damien Miller8448e662004-03-08 23:13:15 +1100564.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000565.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100566If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000567the password will be validated via any additional local mechanism
568such as
569.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100570The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000571.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000572.It Cm KerberosTicketCleanup
573Specifies whether to automatically destroy the user's ticket cache
574file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100575The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000576.Dq yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000577.It Cm KexAlgorithms
578Specifies the available KEX (Key Exchange) algorithms.
579Multiple algorithms must be comma-separated.
580The default is
581.Dq ecdh-sha2-nistp256 ,
582.Dq ecdh-sha2-nistp384 ,
583.Dq ecdh-sha2-nistp521 ,
Damien Miller0a184732010-11-20 15:21:03 +1100584.Dq diffie-hellman-group-exchange-sha256 ,
Damien Millerd5f62bf2010-09-24 22:11:14 +1000585.Dq diffie-hellman-group-exchange-sha1 ,
586.Dq diffie-hellman-group14-sha1 ,
587.Dq diffie-hellman-group1-sha1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000588.It Cm KeyRegenerationInterval
589In protocol version 1, the ephemeral server key is automatically regenerated
590after this many seconds (if it has been used).
591The purpose of regeneration is to prevent
592decrypting captured sessions by later breaking into the machine and
593stealing the keys.
594The key is never stored anywhere.
595If the value is 0, the key is never regenerated.
596The default is 3600 (seconds).
597.It Cm ListenAddress
598Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100599.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000600should listen on.
601The following forms may be used:
602.Pp
603.Bl -item -offset indent -compact
604.It
605.Cm ListenAddress
606.Sm off
607.Ar host No | Ar IPv4_addr No | Ar IPv6_addr
608.Sm on
609.It
610.Cm ListenAddress
611.Sm off
612.Ar host No | Ar IPv4_addr No : Ar port
613.Sm on
614.It
615.Cm ListenAddress
616.Sm off
617.Oo
618.Ar host No | Ar IPv6_addr Oc : Ar port
619.Sm on
620.El
621.Pp
622If
623.Ar port
624is not specified,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100625sshd will listen on the address and all prior
Ben Lindstrom9f049032002-06-21 00:59:05 +0000626.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000627options specified.
628The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000629Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000630.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000631options are permitted.
632Additionally, any
Ben Lindstrom9f049032002-06-21 00:59:05 +0000633.Cm Port
Damien Miller5b0d63f2006-03-15 11:56:56 +1100634options must precede this option for non-port qualified addresses.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000635.It Cm LoginGraceTime
636The server disconnects after this time if the user has not
637successfully logged in.
638If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000639The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000640.It Cm LogLevel
641Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100642.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000643The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100644QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000645The default is INFO.
646DEBUG and DEBUG1 are equivalent.
647DEBUG2 and DEBUG3 each specify higher levels of debugging output.
648Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000649.It Cm MACs
650Specifies the available MAC (message authentication code) algorithms.
651The MAC algorithm is used in protocol version 2
652for data integrity protection.
653Multiple algorithms must be comma-separated.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100654The default is:
Damien Miller22b7b492007-06-11 14:07:12 +1000655.Bd -literal -offset indent
656hmac-md5,hmac-sha1,umac-64@openssh.com,
657hmac-ripemd160,hmac-sha1-96,hmac-md5-96
658.Ed
Darren Tucker45150472006-07-12 22:34:17 +1000659.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +1000660Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +1000661If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +1000662.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000663line are satisfied, the keywords on the following lines override those
664set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +1000665.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000666line or the end of the file.
Darren Tucker7a3935d2008-06-10 22:59:10 +1000667.Pp
Damien Millerd04f3572006-07-24 13:46:50 +1000668The arguments to
Darren Tucker45150472006-07-12 22:34:17 +1000669.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000670are one or more criteria-pattern pairs.
Darren Tucker45150472006-07-12 22:34:17 +1000671The available criteria are
672.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +1000673.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +1000674.Cm Host ,
675and
676.Cm Address .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000677The match patterns may consist of single entries or comma-separated
678lists and may use the wildcard and negation operators described in the
Darren Tuckerb06cc4a2008-06-10 22:59:53 +1000679.Sx PATTERNS
Darren Tucker7a3935d2008-06-10 22:59:10 +1000680section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +1000681.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000682.Pp
683The patterns in an
684.Cm Address
685criteria may additionally contain addresses to match in CIDR
Darren Tucker6a2a4002008-06-10 23:03:04 +1000686address/masklen format, e.g.\&
Darren Tucker7a3935d2008-06-10 22:59:10 +1000687.Dq 192.0.2.0/24
688or
689.Dq 3ffe:ffff::/32 .
690Note that the mask length provided must be consistent with the address -
691it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +1000692or one with bits set in this host portion of the address.
693For example,
Darren Tucker7a3935d2008-06-10 22:59:10 +1000694.Dq 192.0.2.0/33
695and
Darren Tucker6a2a4002008-06-10 23:03:04 +1000696.Dq 192.0.2.0/8
Darren Tucker7a3935d2008-06-10 22:59:10 +1000697respectively.
698.Pp
Darren Tucker45150472006-07-12 22:34:17 +1000699Only a subset of keywords may be used on the lines following a
700.Cm Match
701keyword.
702Available keywords are
Damien Miller17819012009-01-28 16:20:17 +1100703.Cm AllowAgentForwarding ,
Damien Miller9b439df2006-07-24 14:04:00 +1000704.Cm AllowTcpForwarding ,
Damien Millerab6de352010-06-26 09:38:45 +1000705.Cm AuthorizedKeysFile ,
706.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +1100707.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +1000708.Cm ChrootDirectory ,
Damien Millere2754432006-07-24 14:06:47 +1000709.Cm ForceCommand ,
Damien Miller9b439df2006-07-24 14:04:00 +1000710.Cm GatewayPorts ,
Damien Miller25434de2008-05-19 14:29:08 +1000711.Cm GSSAPIAuthentication ,
712.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +1000713.Cm HostbasedUsesNameFromPacketOnly ,
Darren Tucker1d75f222007-03-01 21:31:28 +1100714.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +1100715.Cm KerberosAuthentication ,
Damien Miller307c1d12008-06-16 07:56:20 +1000716.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +1000717.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +1100718.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +1100719.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +1000720.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +1100721.Cm PermitRootLogin ,
Damien Millerab6de352010-06-26 09:38:45 +1000722.Cm PermitTunnel ,
Darren Tucker1477ea12009-10-07 08:36:05 +1100723.Cm PubkeyAuthentication ,
Darren Tucker1629c072007-02-19 22:25:37 +1100724.Cm RhostsRSAAuthentication ,
725.Cm RSAAuthentication ,
Damien Millerd1de9952006-07-24 14:05:48 +1000726.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +1100727.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +1000728and
Damien Miller0296ae82009-02-23 11:00:24 +1100729.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +1000730.It Cm MaxAuthTries
731Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +1000732connection.
733Once the number of failures reaches half this value,
734additional failures are logged.
735The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +1000736.It Cm MaxSessions
737Specifies the maximum number of open sessions permitted per network connection.
738The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000739.It Cm MaxStartups
740Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +1100741SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000742Additional connections will be dropped until authentication succeeds or the
743.Cm LoginGraceTime
744expires for a connection.
745The default is 10.
746.Pp
747Alternatively, random early drop can be enabled by specifying
748the three colon separated values
749.Dq start:rate:full
Damien Miller208f1ed2006-03-15 11:56:03 +1100750(e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +1100751.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000752will refuse connection attempts with a probability of
753.Dq rate/100
754(30%)
755if there are currently
756.Dq start
757(10)
758unauthenticated connections.
759The probability increases linearly and all connection attempts
760are refused if the number of unauthenticated connections reaches
761.Dq full
762(60).
763.It Cm PasswordAuthentication
764Specifies whether password authentication is allowed.
765The default is
766.Dq yes .
767.It Cm PermitEmptyPasswords
768When password authentication is allowed, it specifies whether the
769server allows login to accounts with empty password strings.
770The default is
771.Dq no .
Damien Miller9b439df2006-07-24 14:04:00 +1000772.It Cm PermitOpen
773Specifies the destinations to which TCP port forwarding is permitted.
774The forwarding specification must be one of the following forms:
775.Pp
776.Bl -item -offset indent -compact
777.It
778.Cm PermitOpen
779.Sm off
780.Ar host : port
781.Sm on
782.It
783.Cm PermitOpen
784.Sm off
785.Ar IPv4_addr : port
786.Sm on
787.It
788.Cm PermitOpen
789.Sm off
790.Ar \&[ IPv6_addr \&] : port
791.Sm on
792.El
793.Pp
Damien Millera765cf42006-07-24 14:08:13 +1000794Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +1000795An argument of
796.Dq any
797can be used to remove all restrictions and permit any forwarding requests.
Damien Miller65bc2c42006-07-24 14:04:16 +1000798By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000799.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +1100800Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +0000801.Xr ssh 1 .
802The argument must be
803.Dq yes ,
804.Dq without-password ,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100805.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000806or
807.Dq no .
808The default is
809.Dq yes .
810.Pp
811If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100812.Dq without-password ,
Darren Tucker9dca0992005-02-01 19:16:45 +1100813password authentication is disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000814.Pp
815If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100816.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000817root login with public key authentication will be allowed,
818but only if the
819.Ar command
820option has been specified
821(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +1000822normally not allowed).
823All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000824.Pp
825If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100826.Dq no ,
Darren Tuckerb3509012005-01-20 11:01:46 +1100827root is not allowed to log in.
Damien Millerd27b9472005-12-13 19:29:02 +1100828.It Cm PermitTunnel
829Specifies whether
830.Xr tun 4
831device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +1100832The argument must be
833.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +1000834.Dq point-to-point
835(layer 3),
836.Dq ethernet
837(layer 2), or
Damien Miller7b58e802005-12-13 19:33:19 +1100838.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +1000839Specifying
840.Dq yes
841permits both
842.Dq point-to-point
843and
844.Dq ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +1100845The default is
846.Dq no .
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000847.It Cm PermitUserEnvironment
848Specifies whether
849.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000850and
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000851.Cm environment=
852options in
853.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000854are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +1100855.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000856The default is
857.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000858Enabling environment processing may enable users to bypass access
859restrictions in some configurations using mechanisms such as
860.Ev LD_PRELOAD .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000861.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +0000862Specifies the file that contains the process ID of the
Damien Millerf4f22b52006-03-15 11:57:25 +1100863SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000864The default is
865.Pa /var/run/sshd.pid .
866.It Cm Port
867Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100868.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000869listens on.
870The default is 22.
871Multiple options of this type are permitted.
872See also
873.Cm ListenAddress .
874.It Cm PrintLastLog
875Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100876.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +1100877should print the date and time of the last user login when a user logs
878in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000879The default is
880.Dq yes .
881.It Cm PrintMotd
882Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100883.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000884should print
885.Pa /etc/motd
886when a user logs in interactively.
887(On some systems it is also printed by the shell,
888.Pa /etc/profile ,
889or equivalent.)
890The default is
891.Dq yes .
892.It Cm Protocol
893Specifies the protocol versions
Damien Miller5b0d63f2006-03-15 11:56:56 +1100894.Xr sshd 8
Ben Lindstrom9c445542002-07-11 03:59:18 +0000895supports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000896The possible values are
Damien Miller5b0d63f2006-03-15 11:56:56 +1100897.Sq 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000898and
Damien Miller5b0d63f2006-03-15 11:56:56 +1100899.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000900Multiple versions must be comma-separated.
901The default is
Darren Tucker7a4a7652009-10-11 21:51:40 +1100902.Sq 2 .
Ben Lindstrom9c445542002-07-11 03:59:18 +0000903Note that the order of the protocol list does not indicate preference,
904because the client selects among multiple protocol versions offered
905by the server.
906Specifying
907.Dq 2,1
908is identical to
909.Dq 1,2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000910.It Cm PubkeyAuthentication
911Specifies whether public key authentication is allowed.
912The default is
913.Dq yes .
914Note that this option applies to protocol version 2 only.
Damien Miller1aed65e2010-03-04 21:53:35 +1100915.It Cm RevokedKeys
916Specifies a list of revoked public keys.
917Keys listed in this file will be refused for public key authentication.
918Note that if this file is not readable, then public key authentication will
919be refused for all users.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000920.It Cm RhostsRSAAuthentication
921Specifies whether rhosts or /etc/hosts.equiv authentication together
922with successful RSA host authentication is allowed.
923The default is
924.Dq no .
925This option applies to protocol version 1 only.
926.It Cm RSAAuthentication
927Specifies whether pure RSA authentication is allowed.
928The default is
929.Dq yes .
930This option applies to protocol version 1 only.
931.It Cm ServerKeyBits
932Defines the number of bits in the ephemeral protocol version 1 server key.
Darren Tucker7499b0c2008-07-02 22:35:43 +1000933The minimum value is 512, and the default is 1024.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000934.It Cm StrictModes
935Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100936.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000937should check file modes and ownership of the
938user's files and home directory before accepting login.
939This is normally desirable because novices sometimes accidentally leave their
940directory or files world-writable.
941The default is
942.Dq yes .
Darren Tuckerf788a912010-01-08 17:06:47 +1100943Note that this does not apply to
944.Cm ChrootDirectory ,
945whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000946.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +1100947Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +1000948Arguments should be a subsystem name and a command (with optional arguments)
949to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100950.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000951The command
952.Xr sftp-server 8
953implements the
954.Dq sftp
955file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100956.Pp
957Alternately the name
958.Dq internal-sftp
959implements an in-process
960.Dq sftp
961server.
962This may simplify configurations using
963.Cm ChrootDirectory
964to force a different filesystem root on clients.
965.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000966By default no subsystems are defined.
967Note that this option applies to protocol version 2 only.
968.It Cm SyslogFacility
969Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100970.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000971The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
972LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
973The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +1100974.It Cm TCPKeepAlive
975Specifies whether the system should send TCP keepalive messages to the
976other side.
977If they are sent, death of the connection or crash of one
978of the machines will be properly noticed.
979However, this means that
980connections will die if the route is down temporarily, and some people
981find it annoying.
982On the other hand, if TCP keepalives are not sent,
983sessions may hang indefinitely on the server, leaving
984.Dq ghost
985users and consuming server resources.
986.Pp
987The default is
988.Dq yes
989(to send TCP keepalive messages), and the server will notice
990if the network goes down or the client host crashes.
991This avoids infinitely hanging sessions.
992.Pp
993To disable TCP keepalive messages, the value should be set to
994.Dq no .
Damien Miller1aed65e2010-03-04 21:53:35 +1100995.It Cm TrustedUserCAKeys
996Specifies a file containing public keys of certificate authorities that are
Damien Millerc6db99e2010-03-05 10:41:45 +1100997trusted to sign user certificates for authentication.
Damien Miller72b33822010-03-05 07:39:01 +1100998Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +1100999.Ql #
1000are allowed.
1001If a certificate is presented for authentication and has its signing CA key
1002listed in this file, then it may be used for authentication for any user
1003listed in the certificate's principals list.
1004Note that certificates that lack a list of principals will not be permitted
1005for authentication using
1006.Cm TrustedUserCAKeys .
Damien Miller72b33822010-03-05 07:39:01 +11001007For more details on certificates, see the
Damien Miller1aed65e2010-03-04 21:53:35 +11001008.Sx CERTIFICATES
1009section in
1010.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001011.It Cm UseDNS
1012Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001013.Xr sshd 8
Darren Tucker83d5a982005-03-31 21:33:50 +10001014should look up the remote host name and check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001015the resolved host name for the remote IP address maps back to the
1016very same IP address.
1017The default is
1018.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001019.It Cm UseLogin
1020Specifies whether
1021.Xr login 1
1022is used for interactive login sessions.
1023The default is
1024.Dq no .
1025Note that
1026.Xr login 1
1027is never used for remote command execution.
1028Note also, that if this is enabled,
1029.Cm X11Forwarding
1030will be disabled because
1031.Xr login 1
1032does not know how to handle
1033.Xr xauth 1
Damien Miller495dca32003-04-01 21:42:14 +10001034cookies.
1035If
Ben Lindstrom9f049032002-06-21 00:59:05 +00001036.Cm UsePrivilegeSeparation
1037is specified, it will be disabled after authentication.
Damien Miller2e193e22003-05-14 15:13:03 +10001038.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001039Enables the Pluggable Authentication Module interface.
1040If set to
1041.Dq yes
1042this will enable PAM authentication using
1043.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001044and
1045.Cm PasswordAuthentication
1046in addition to PAM account and session module processing for all
1047authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001048.Pp
1049Because PAM challenge-response authentication usually serves an equivalent
1050role to password authentication, you should disable either
1051.Cm PasswordAuthentication
1052or
1053.Cm ChallengeResponseAuthentication.
1054.Pp
1055If
1056.Cm UsePAM
1057is enabled, you will not be able to run
1058.Xr sshd 8
1059as a non-root user.
1060The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +10001061.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001062.It Cm UsePrivilegeSeparation
1063Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001064.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001065separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +10001066to deal with incoming network traffic.
1067After successful authentication, another process will be created that has
1068the privilege of the authenticated user.
1069The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +00001070escalation by containing any corruption within the unprivileged processes.
1071The default is
1072.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001073.It Cm X11DisplayOffset
1074Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001075.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001076X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001077This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001078The default is 10.
1079.It Cm X11Forwarding
1080Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001081The argument must be
1082.Dq yes
1083or
1084.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001085The default is
1086.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +10001087.Pp
1088When X11 forwarding is enabled, there may be additional exposure to
1089the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001090.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001091proxy display is configured to listen on the wildcard address (see
1092.Cm X11UseLocalhost
Damien Miller5b0d63f2006-03-15 11:56:56 +11001093below), though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001094Additionally, the authentication spoofing and authentication data
1095verification and substitution occur on the client side.
1096The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001097display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001098forwarding (see the warnings for
1099.Cm ForwardX11
1100in
Damien Millerf1ce5052003-06-11 22:04:39 +10001101.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001102A system administrator may have a stance in which they want to
1103protect clients that may expose themselves to attack by unwittingly
1104requesting X11 forwarding, which can warrant a
1105.Dq no
1106setting.
1107.Pp
1108Note that disabling X11 forwarding does not prevent users from
1109forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001110X11 forwarding is automatically disabled if
1111.Cm UseLogin
1112is enabled.
1113.It Cm X11UseLocalhost
1114Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001115.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001116should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001117the wildcard address.
1118By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001119sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001120hostname part of the
1121.Ev DISPLAY
1122environment variable to
1123.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001124This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001125However, some older X11 clients may not function with this
1126configuration.
1127.Cm X11UseLocalhost
1128may be set to
1129.Dq no
1130to specify that the forwarding server should be bound to the wildcard
1131address.
1132The argument must be
1133.Dq yes
1134or
1135.Dq no .
1136The default is
1137.Dq yes .
1138.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001139Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001140.Xr xauth 1
1141program.
1142The default is
1143.Pa /usr/X11R6/bin/xauth .
1144.El
Damien Millere3beba22006-03-15 11:59:25 +11001145.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001146.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001147command-line arguments and configuration file options that specify time
1148may be expressed using a sequence of the form:
1149.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001150.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001151.Sm on
1152where
1153.Ar time
1154is a positive integer value and
1155.Ar qualifier
1156is one of the following:
1157.Pp
1158.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001159.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001160seconds
1161.It Cm s | Cm S
1162seconds
1163.It Cm m | Cm M
1164minutes
1165.It Cm h | Cm H
1166hours
1167.It Cm d | Cm D
1168days
1169.It Cm w | Cm W
1170weeks
1171.El
1172.Pp
1173Each member of the sequence is added together to calculate
1174the total time value.
1175.Pp
1176Time format examples:
1177.Pp
1178.Bl -tag -width Ds -compact -offset indent
1179.It 600
1180600 seconds (10 minutes)
1181.It 10m
118210 minutes
1183.It 1h30m
11841 hour 30 minutes (90 minutes)
1185.El
1186.Sh FILES
1187.Bl -tag -width Ds
1188.It Pa /etc/ssh/sshd_config
1189Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001190.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001191This file should be writable by root only, but it is recommended
1192(though not necessary) that it be world-readable.
1193.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001194.Sh SEE ALSO
1195.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001196.Sh AUTHORS
1197OpenSSH is a derivative of the original and free
1198ssh 1.2.12 release by Tatu Ylonen.
1199Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1200Theo de Raadt and Dug Song
1201removed many bugs, re-added newer features and
1202created OpenSSH.
1203Markus Friedl contributed the support for SSH
1204protocol versions 1.5 and 2.0.
1205Niels Provos and Markus Friedl contributed support
1206for privilege separation.