blob: c8b814da6f56cab4c9e23e900a842869857f4c76 [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 Millerf3747bf2013-01-18 11:44:04 +110036.\" $OpenBSD: sshd_config.5,v 1.154 2013/01/17 23:00:01 djm Exp $
37.Dd $Mdocdate: January 17 2013 $
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.
Damien Milleraa5b3f82012-12-03 09:50:54 +1100127The available options are
128.Dq yes
129or
130.Dq all
131to allow TCP forwarding,
132.Dq no
133to prevent all TCP forwarding,
134.Dq local
135to allow local (from the perspective of
Darren Tuckerf9333d52012-12-07 13:06:13 +1100136.Xr ssh 1 )
137forwarding only or
Damien Milleraa5b3f82012-12-03 09:50:54 +1100138.Dq remote
139to allow remote forwarding only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000140The default is
141.Dq yes .
142Note that disabling TCP forwarding does not improve security unless
143users are also denied shell access, as they can always install their
144own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000145.It Cm AllowUsers
146This keyword can be followed by a list of user name patterns, separated
147by spaces.
Damien Miller5a93add2003-01-24 11:34:52 +1100148If specified, login is allowed only for user names that
Ben Lindstrom9f049032002-06-21 00:59:05 +0000149match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000150Only user names are valid; a numerical user ID is not recognized.
151By default, login is allowed for all users.
152If the pattern takes the form USER@HOST then USER and HOST
153are separately checked, restricting logins to particular
154users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100155The allow/deny directives are processed in the following order:
156.Cm DenyUsers ,
157.Cm AllowUsers ,
158.Cm DenyGroups ,
159and finally
160.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100161.Pp
162See
163.Sx PATTERNS
164in
165.Xr ssh_config 5
166for more information on patterns.
Damien Millera6e3f012012-11-04 23:21:40 +1100167.It Cm AuthenticationMethods
168Specifies the authentication methods that must be successfully completed
169for a user to be granted access.
170This option must be followed by one or more comma-separated lists of
171authentication method names.
172Successful authentication requires completion of every method in at least
173one of these lists.
174.Pp
175For example, an argument of
176.Dq publickey,password publickey,keyboard-interactive
177would require the user to complete public key authentication, followed by
178either password or keyboard interactive authentication.
179Only methods that are next in one or more lists are offered at each stage,
180so for this example, it would not be possible to attempt password or
181keyboard-interactive authentication before public key.
182.Pp
183This option is only available for SSH protocol 2 and will yield a fatal
184error if enabled if protocol 1 is also enabled.
185Note that each authentication method listed should also be explicitly enabled
186in the configuration.
187The default is not to require multiple authentication; successful completion
188of a single authentication method is sufficient.
Damien Miller09d3e122012-10-31 08:58:58 +1100189.It Cm AuthorizedKeysCommand
Damien Millerf33580e2012-11-04 22:22:52 +1100190Specifies a program to be used to look up the user's public keys.
Damien Miller09d3e122012-10-31 08:58:58 +1100191The program will be invoked with a single argument of the username
192being authenticated, and should produce on standard output zero or
Damien Millerf33580e2012-11-04 22:22:52 +1100193more lines of authorized_keys output (see
194.Sx AUTHORIZED_KEYS
195in
196.Xr sshd 8 ) .
Damien Miller09d3e122012-10-31 08:58:58 +1100197If a key supplied by AuthorizedKeysCommand does not successfully authenticate
198and authorize the user then public key authentication continues using the usual
199.Cm AuthorizedKeysFile
200files.
201By default, no AuthorizedKeysCommand is run.
202.It Cm AuthorizedKeysCommandUser
203Specifies the user under whose account the AuthorizedKeysCommand is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100204It is recommended to use a dedicated user that has no other role on the host
205than running authorized keys commands.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000206.It Cm AuthorizedKeysFile
207Specifies the file that contains the public keys that can be used
208for user authentication.
Damien Miller6018a362010-07-02 13:35:19 +1000209The format is described in the
210.Sx AUTHORIZED_KEYS FILE FORMAT
211section of
212.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000213.Cm AuthorizedKeysFile
214may contain tokens of the form %T which are substituted during connection
Damien Miller5b0d63f2006-03-15 11:56:56 +1100215setup.
Damien Millerfbf486b2003-05-23 18:44:23 +1000216The following tokens are defined: %% is replaced by a literal '%',
Damien Miller5b0d63f2006-03-15 11:56:56 +1100217%h is replaced by the home directory of the user being authenticated, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000218%u is replaced by the username of that user.
219After expansion,
220.Cm AuthorizedKeysFile
221is taken to be an absolute path or one relative to the user's home
222directory.
Damien Millerb9132fc2011-05-29 21:41:40 +1000223Multiple files may be listed, separated by whitespace.
224The default is
225.Dq .ssh/authorized_keys .ssh/authorized_keys2 .
Damien Miller30da3442010-05-10 11:58:03 +1000226.It Cm AuthorizedPrincipalsFile
227Specifies a file that lists principal names that are accepted for
228certificate authentication.
229When using certificates signed by a key listed in
230.Cm TrustedUserCAKeys ,
231this file lists names, one of which must appear in the certificate for it
232to be accepted for authentication.
Damien Millerd59dab82010-07-02 13:37:17 +1000233Names are listed one per line preceded by key options (as described
Damien Miller6018a362010-07-02 13:35:19 +1000234in
235.Sx AUTHORIZED_KEYS FILE FORMAT
236in
Damien Millerd59dab82010-07-02 13:37:17 +1000237.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000238Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000239.Ql #
240are ignored.
241.Pp
242.Cm AuthorizedPrincipalsFile
243may contain tokens of the form %T which are substituted during connection
244setup.
245The following tokens are defined: %% is replaced by a literal '%',
246%h is replaced by the home directory of the user being authenticated, and
247%u is replaced by the username of that user.
248After expansion,
249.Cm AuthorizedPrincipalsFile
250is taken to be an absolute path or one relative to the user's home
251directory.
252.Pp
Damien Miller8fef9eb2012-04-22 11:25:10 +1000253The default is
254.Dq none ,
255i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000256of the user must appear in a certificate's principals list for it to be
257accepted.
258Note that
259.Cm AuthorizedPrincipalsFile
260is only used when authentication proceeds using a CA listed in
261.Cm TrustedUserCAKeys
262and is not consulted for certification authorities trusted via
263.Pa ~/.ssh/authorized_keys ,
264though the
265.Cm principals=
266key option offers a similar facility (see
267.Xr sshd 8
268for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000269.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000270The contents of the specified file are sent to the remote user before
271authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000272If the argument is
273.Dq none
274then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000275This option is only available for protocol version 2.
276By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000277.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000278Specifies whether challenge-response authentication is allowed (e.g. via
279PAM or though authentication styles supported in
280.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000281The default is
282.Dq yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100283.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100284Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100285.Xr chroot 2
286to after authentication.
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100287All components of the pathname must be root-owned directories that are
Damien Millerd8cb1f12008-02-10 22:40:12 +1100288not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000289After the chroot,
290.Xr sshd 8
291changes the working directory to the user's home directory.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100292.Pp
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100293The pathname may contain the following tokens that are expanded at runtime once
Damien Millerd8cb1f12008-02-10 22:40:12 +1100294the connecting user has been authenticated: %% is replaced by a literal '%',
295%h is replaced by the home directory of the user being authenticated, and
296%u is replaced by the username of that user.
297.Pp
298The
299.Cm ChrootDirectory
300must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000301user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100302For an interactive session this requires at least a shell, typically
303.Xr sh 1 ,
304and basic
305.Pa /dev
306nodes such as
307.Xr null 4 ,
308.Xr zero 4 ,
309.Xr stdin 4 ,
310.Xr stdout 4 ,
311.Xr stderr 4 ,
312.Xr arandom 4
313and
314.Xr tty 4
315devices.
316For file transfer sessions using
Darren Tuckerf92077f2009-06-21 17:56:25 +1000317.Dq sftp ,
Damien Millerd8cb1f12008-02-10 22:40:12 +1100318no additional configuration of the environment is necessary if the
Darren Tuckerf92077f2009-06-21 17:56:25 +1000319in-process sftp server is used,
320though sessions which use logging do require
Darren Tucker00fcd712009-06-21 17:56:00 +1000321.Pa /dev/log
322inside the chroot directory (see
323.Xr sftp-server 8
324for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100325.Pp
326The default is not to
327.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000328.It Cm Ciphers
329Specifies the ciphers allowed for protocol version 2.
330Multiple ciphers must be comma-separated.
Damien Miller05202ff2004-06-15 10:30:39 +1000331The supported ciphers are
332.Dq 3des-cbc ,
333.Dq aes128-cbc ,
334.Dq aes192-cbc ,
335.Dq aes256-cbc ,
336.Dq aes128-ctr ,
337.Dq aes192-ctr ,
338.Dq aes256-ctr ,
Damien Miller1d75abf2013-01-09 16:12:19 +1100339.Dq aes128-gcm@openssh.com ,
340.Dq aes256-gcm@openssh.com ,
Damien Miller3710f272005-05-26 12:19:17 +1000341.Dq arcfour128 ,
342.Dq arcfour256 ,
Damien Miller05202ff2004-06-15 10:30:39 +1000343.Dq arcfour ,
344.Dq blowfish-cbc ,
345and
346.Dq cast128-cbc .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100347The default is:
348.Bd -literal -offset 3n
Damien Miller9aa72ba2009-01-28 16:34:00 +1100349aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,
Damien Miller1d75abf2013-01-09 16:12:19 +1100350aes128-gcm@openssh.com,aes256-gcm@openssh.com,
Damien Miller9aa72ba2009-01-28 16:34:00 +1100351aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,
352aes256-cbc,arcfour
Ben Lindstrom9f049032002-06-21 00:59:05 +0000353.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +0000354.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100355Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000356sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100357.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000358receiving any messages back from the client.
359If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100360sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000361It is important to note that the use of client alive messages is very
362different from
Damien Miller12c150e2003-12-17 16:31:10 +1100363.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000364(below).
365The client alive messages are sent through the encrypted channel
366and therefore will not be spoofable.
367The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100368.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000369is spoofable.
370The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000371server depend on knowing when a connection has become inactive.
372.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000373The default value is 3.
374If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000375.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100376(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000377.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100378is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000379will be disconnected after approximately 45 seconds.
Damien Millercc3e8ba2006-03-15 12:06:55 +1100380This option applies to protocol version 2 only.
Damien Miller1594ad52005-05-26 12:12:19 +1000381.It Cm ClientAliveInterval
382Sets a timeout interval in seconds after which if no data has been received
383from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100384.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000385will send a message through the encrypted
386channel to request a response from the client.
387The default
388is 0, indicating that these messages will not be sent to the client.
389This option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000390.It Cm Compression
Damien Miller9786e6e2005-07-26 21:54:56 +1000391Specifies whether compression is allowed, or delayed until
392the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000393The argument must be
Damien Miller9786e6e2005-07-26 21:54:56 +1000394.Dq yes ,
395.Dq delayed ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000396or
397.Dq no .
398The default is
Damien Miller9786e6e2005-07-26 21:54:56 +1000399.Dq delayed .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000400.It Cm DenyGroups
401This keyword can be followed by a list of group name patterns, separated
402by spaces.
403Login is disallowed for users whose primary group or supplementary
404group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000405Only group names are valid; a numerical group ID is not recognized.
406By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100407The allow/deny directives are processed in the following order:
408.Cm DenyUsers ,
409.Cm AllowUsers ,
410.Cm DenyGroups ,
411and finally
412.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100413.Pp
414See
415.Sx PATTERNS
416in
417.Xr ssh_config 5
418for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000419.It Cm DenyUsers
420This keyword can be followed by a list of user name patterns, separated
421by spaces.
422Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000423Only user names are valid; a numerical user ID is not recognized.
424By default, login is allowed for all users.
425If the pattern takes the form USER@HOST then USER and HOST
426are separately checked, restricting logins to particular
427users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100428The allow/deny directives are processed in the following order:
429.Cm DenyUsers ,
430.Cm AllowUsers ,
431.Cm DenyGroups ,
432and finally
433.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100434.Pp
435See
436.Sx PATTERNS
437in
438.Xr ssh_config 5
439for more information on patterns.
Damien Millere2754432006-07-24 14:06:47 +1000440.It Cm ForceCommand
441Forces the execution of the command specified by
442.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100443ignoring any command supplied by the client and
444.Pa ~/.ssh/rc
445if present.
Damien Millere2754432006-07-24 14:06:47 +1000446The command is invoked by using the user's login shell with the -c option.
447This applies to shell, command, or subsystem execution.
448It is most useful inside a
449.Cm Match
450block.
451The command originally supplied by the client is available in the
452.Ev SSH_ORIGINAL_COMMAND
453environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100454Specifying a command of
455.Dq internal-sftp
456will force the use of an in-process sftp server that requires no support
457files when used with
458.Cm ChrootDirectory .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000459.It Cm GatewayPorts
460Specifies whether remote hosts are allowed to connect to ports
461forwarded for the client.
462By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100463.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000464binds remote port forwardings to the loopback address.
465This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000466.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100467can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100468should allow remote port forwardings to bind to non-loopback addresses, thus
469allowing other hosts to connect.
470The argument may be
471.Dq no
472to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000473.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100474to force remote port forwardings to bind to the wildcard address, or
475.Dq clientspecified
476to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000477The default is
478.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000479.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000480Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100481The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000482.Dq no .
483Note that this option applies to protocol version 2 only.
484.It Cm GSSAPICleanupCredentials
485Specifies whether to automatically destroy the user's credentials cache
486on logout.
487The default is
488.Dq yes .
489Note that this option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000490.It Cm HostbasedAuthentication
491Specifies whether rhosts or /etc/hosts.equiv authentication together
492with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100493(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000494This option is similar to
495.Cm RhostsRSAAuthentication
496and applies to protocol version 2 only.
497The default is
498.Dq no .
Damien Millerb594f382006-08-30 11:06:34 +1000499.It Cm HostbasedUsesNameFromPacketOnly
500Specifies whether or not the server will attempt to perform a reverse
501name lookup when matching the name in the
502.Pa ~/.shosts ,
503.Pa ~/.rhosts ,
504and
505.Pa /etc/hosts.equiv
506files during
507.Cm HostbasedAuthentication .
508A setting of
509.Dq yes
510means that
511.Xr sshd 8
512uses the name supplied by the client rather than
513attempting to resolve the name from the TCP connection itself.
514The default is
515.Dq no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100516.It Cm HostCertificate
517Specifies a file containing a public host certificate.
518The certificate's public key must match a private host key already specified
519by
520.Cm HostKey .
521The default behaviour of
522.Xr sshd 8
523is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000524.It Cm HostKey
525Specifies a file containing a private host key
526used by SSH.
527The default is
528.Pa /etc/ssh/ssh_host_key
529for protocol version 1, and
Damien Millereb8b60e2010-08-31 22:41:14 +1000530.Pa /etc/ssh/ssh_host_dsa_key ,
531.Pa /etc/ssh/ssh_host_ecdsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000532and
Damien Millereb8b60e2010-08-31 22:41:14 +1000533.Pa /etc/ssh/ssh_host_rsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000534for protocol version 2.
535Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100536.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000537will refuse to use a file if it is group/world-accessible.
538It is possible to have multiple host key files.
539.Dq rsa1
540keys are used for version 1 and
Damien Millereb8b60e2010-08-31 22:41:14 +1000541.Dq dsa ,
542.Dq ecdsa
Ben Lindstrom9f049032002-06-21 00:59:05 +0000543or
544.Dq rsa
545are used for version 2 of the SSH protocol.
546.It Cm IgnoreRhosts
547Specifies that
548.Pa .rhosts
549and
550.Pa .shosts
551files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000552.Cm RhostsRSAAuthentication
553or
554.Cm HostbasedAuthentication .
555.Pp
556.Pa /etc/hosts.equiv
557and
558.Pa /etc/shosts.equiv
559are still used.
560The default is
561.Dq yes .
562.It Cm IgnoreUserKnownHosts
563Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100564.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000565should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000566.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000567during
568.Cm RhostsRSAAuthentication
569or
570.Cm HostbasedAuthentication .
571The default is
572.Dq no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100573.It Cm IPQoS
574Specifies the IPv4 type-of-service or DSCP class for the connection.
575Accepted values are
576.Dq af11 ,
577.Dq af12 ,
578.Dq af13 ,
Damien Millerf6e758c2011-09-22 21:37:13 +1000579.Dq af21 ,
Damien Miller0dac6fb2010-11-20 15:19:38 +1100580.Dq af22 ,
581.Dq af23 ,
582.Dq af31 ,
583.Dq af32 ,
584.Dq af33 ,
585.Dq af41 ,
586.Dq af42 ,
587.Dq af43 ,
588.Dq cs0 ,
589.Dq cs1 ,
590.Dq cs2 ,
591.Dq cs3 ,
592.Dq cs4 ,
593.Dq cs5 ,
594.Dq cs6 ,
595.Dq cs7 ,
596.Dq ef ,
597.Dq lowdelay ,
598.Dq throughput ,
599.Dq reliability ,
600or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +1100601This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100602If one argument is specified, it is used as the packet class unconditionally.
603If two values are specified, the first is automatically selected for
604interactive sessions and the second for non-interactive sessions.
605The default is
606.Dq lowdelay
607for interactive sessions and
608.Dq throughput
609for non-interactive sessions.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000610.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000611Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000612.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000613will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000614To use this option, the server needs a
615Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100616The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000617.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100618.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000619If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100620an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100621The default is
Damien Miller8448e662004-03-08 23:13:15 +1100622.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000623.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100624If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000625the password will be validated via any additional local mechanism
626such as
627.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100628The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000629.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000630.It Cm KerberosTicketCleanup
631Specifies whether to automatically destroy the user's ticket cache
632file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100633The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000634.Dq yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000635.It Cm KexAlgorithms
636Specifies the available KEX (Key Exchange) algorithms.
637Multiple algorithms must be comma-separated.
638The default is
639.Dq ecdh-sha2-nistp256 ,
640.Dq ecdh-sha2-nistp384 ,
641.Dq ecdh-sha2-nistp521 ,
Damien Miller0a184732010-11-20 15:21:03 +1100642.Dq diffie-hellman-group-exchange-sha256 ,
Damien Millerd5f62bf2010-09-24 22:11:14 +1000643.Dq diffie-hellman-group-exchange-sha1 ,
644.Dq diffie-hellman-group14-sha1 ,
645.Dq diffie-hellman-group1-sha1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000646.It Cm KeyRegenerationInterval
647In protocol version 1, the ephemeral server key is automatically regenerated
648after this many seconds (if it has been used).
649The purpose of regeneration is to prevent
650decrypting captured sessions by later breaking into the machine and
651stealing the keys.
652The key is never stored anywhere.
653If the value is 0, the key is never regenerated.
654The default is 3600 (seconds).
655.It Cm ListenAddress
656Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100657.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000658should listen on.
659The following forms may be used:
660.Pp
661.Bl -item -offset indent -compact
662.It
663.Cm ListenAddress
664.Sm off
665.Ar host No | Ar IPv4_addr No | Ar IPv6_addr
666.Sm on
667.It
668.Cm ListenAddress
669.Sm off
670.Ar host No | Ar IPv4_addr No : Ar port
671.Sm on
672.It
673.Cm ListenAddress
674.Sm off
675.Oo
676.Ar host No | Ar IPv6_addr Oc : Ar port
677.Sm on
678.El
679.Pp
680If
681.Ar port
682is not specified,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100683sshd will listen on the address and all prior
Ben Lindstrom9f049032002-06-21 00:59:05 +0000684.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000685options specified.
686The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000687Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000688.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000689options are permitted.
690Additionally, any
Ben Lindstrom9f049032002-06-21 00:59:05 +0000691.Cm Port
Damien Miller5b0d63f2006-03-15 11:56:56 +1100692options must precede this option for non-port qualified addresses.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000693.It Cm LoginGraceTime
694The server disconnects after this time if the user has not
695successfully logged in.
696If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000697The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000698.It Cm LogLevel
699Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100700.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000701The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100702QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000703The default is INFO.
704DEBUG and DEBUG1 are equivalent.
705DEBUG2 and DEBUG3 each specify higher levels of debugging output.
706Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000707.It Cm MACs
708Specifies the available MAC (message authentication code) algorithms.
709The MAC algorithm is used in protocol version 2
710for data integrity protection.
711Multiple algorithms must be comma-separated.
Damien Milleraf43a7a2012-12-12 10:46:31 +1100712The algorithms that contain
713.Dq -etm
714calculate the MAC after encryption (encrypt-then-mac).
715These are considered safer and their use recommended.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100716The default is:
Damien Miller22b7b492007-06-11 14:07:12 +1000717.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +1100718hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,
719umac-64-etm@openssh.com,umac-128-etm@openssh.com,
720hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
721hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,
722hmac-md5-96-etm@openssh.com,
Darren Tucker427e4092012-10-05 11:02:39 +1000723hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,
Darren Tuckerecbf14a2012-07-02 18:53:37 +1000724hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,
725hmac-sha1-96,hmac-md5-96
Damien Miller22b7b492007-06-11 14:07:12 +1000726.Ed
Darren Tucker45150472006-07-12 22:34:17 +1000727.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +1000728Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +1000729If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +1000730.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000731line are satisfied, the keywords on the following lines override those
732set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +1000733.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000734line or the end of the file.
Darren Tucker7a3935d2008-06-10 22:59:10 +1000735.Pp
Damien Millerd04f3572006-07-24 13:46:50 +1000736The arguments to
Darren Tucker45150472006-07-12 22:34:17 +1000737.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000738are one or more criteria-pattern pairs.
Darren Tucker45150472006-07-12 22:34:17 +1000739The available criteria are
740.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +1000741.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +1000742.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +1000743.Cm LocalAddress ,
744.Cm LocalPort ,
Darren Tucker45150472006-07-12 22:34:17 +1000745and
746.Cm Address .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000747The match patterns may consist of single entries or comma-separated
748lists and may use the wildcard and negation operators described in the
Darren Tuckerb06cc4a2008-06-10 22:59:53 +1000749.Sx PATTERNS
Darren Tucker7a3935d2008-06-10 22:59:10 +1000750section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +1000751.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000752.Pp
753The patterns in an
754.Cm Address
755criteria may additionally contain addresses to match in CIDR
Darren Tucker6a2a4002008-06-10 23:03:04 +1000756address/masklen format, e.g.\&
Darren Tucker7a3935d2008-06-10 22:59:10 +1000757.Dq 192.0.2.0/24
758or
759.Dq 3ffe:ffff::/32 .
760Note that the mask length provided must be consistent with the address -
761it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +1000762or one with bits set in this host portion of the address.
763For example,
Darren Tucker7a3935d2008-06-10 22:59:10 +1000764.Dq 192.0.2.0/33
765and
Darren Tucker6a2a4002008-06-10 23:03:04 +1000766.Dq 192.0.2.0/8
Darren Tucker7a3935d2008-06-10 22:59:10 +1000767respectively.
768.Pp
Darren Tucker45150472006-07-12 22:34:17 +1000769Only a subset of keywords may be used on the lines following a
770.Cm Match
771keyword.
772Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +1000773.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +1100774.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +1000775.Cm AllowGroups ,
Damien Miller9b439df2006-07-24 14:04:00 +1000776.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +1000777.Cm AllowUsers ,
Damien Millera6e3f012012-11-04 23:21:40 +1100778.Cm AuthenticationMethods ,
Damien Miller09d3e122012-10-31 08:58:58 +1100779.Cm AuthorizedKeysCommand ,
780.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +1100781.Cm AuthorizedKeysFile ,
Damien Millerab6de352010-06-26 09:38:45 +1000782.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +1100783.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +1000784.Cm ChrootDirectory ,
Damien Millerc24da772012-06-20 21:53:58 +1000785.Cm DenyGroups ,
786.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +1000787.Cm ForceCommand ,
Damien Millerc24da772012-06-20 21:53:58 +1000788.Cm GatewayPorts ,
Damien Millerf8268502012-06-20 21:54:15 +1000789.Cm GSSAPIAuthentication ,
Damien Miller25434de2008-05-19 14:29:08 +1000790.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +1000791.Cm HostbasedUsesNameFromPacketOnly ,
Darren Tucker1d75f222007-03-01 21:31:28 +1100792.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +1100793.Cm KerberosAuthentication ,
Damien Miller307c1d12008-06-16 07:56:20 +1000794.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +1000795.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +1100796.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +1100797.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +1000798.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +1100799.Cm PermitRootLogin ,
Damien Millerab6de352010-06-26 09:38:45 +1000800.Cm PermitTunnel ,
Darren Tucker1477ea12009-10-07 08:36:05 +1100801.Cm PubkeyAuthentication ,
Damien Millerc24da772012-06-20 21:53:58 +1000802.Cm RhostsRSAAuthentication ,
Damien Millerf8268502012-06-20 21:54:15 +1000803.Cm RSAAuthentication ,
Damien Millerd1de9952006-07-24 14:05:48 +1000804.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +1100805.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +1000806and
Damien Miller0296ae82009-02-23 11:00:24 +1100807.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +1000808.It Cm MaxAuthTries
809Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +1000810connection.
811Once the number of failures reaches half this value,
812additional failures are logged.
813The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +1000814.It Cm MaxSessions
815Specifies the maximum number of open sessions permitted per network connection.
816The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000817.It Cm MaxStartups
818Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +1100819SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000820Additional connections will be dropped until authentication succeeds or the
821.Cm LoginGraceTime
822expires for a connection.
823The default is 10.
824.Pp
825Alternatively, random early drop can be enabled by specifying
826the three colon separated values
827.Dq start:rate:full
Damien Miller208f1ed2006-03-15 11:56:03 +1100828(e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +1100829.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000830will refuse connection attempts with a probability of
831.Dq rate/100
832(30%)
833if there are currently
834.Dq start
835(10)
836unauthenticated connections.
837The probability increases linearly and all connection attempts
838are refused if the number of unauthenticated connections reaches
839.Dq full
840(60).
841.It Cm PasswordAuthentication
842Specifies whether password authentication is allowed.
843The default is
844.Dq yes .
845.It Cm PermitEmptyPasswords
846When password authentication is allowed, it specifies whether the
847server allows login to accounts with empty password strings.
848The default is
849.Dq no .
Damien Miller9b439df2006-07-24 14:04:00 +1000850.It Cm PermitOpen
851Specifies the destinations to which TCP port forwarding is permitted.
852The forwarding specification must be one of the following forms:
853.Pp
854.Bl -item -offset indent -compact
855.It
856.Cm PermitOpen
857.Sm off
858.Ar host : port
859.Sm on
860.It
861.Cm PermitOpen
862.Sm off
863.Ar IPv4_addr : port
864.Sm on
865.It
866.Cm PermitOpen
867.Sm off
868.Ar \&[ IPv6_addr \&] : port
869.Sm on
870.El
871.Pp
Damien Millera765cf42006-07-24 14:08:13 +1000872Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +1000873An argument of
874.Dq any
875can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +1000876An argument of
877.Dq none
878can be used to prohibit all forwarding requests.
Damien Miller65bc2c42006-07-24 14:04:16 +1000879By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000880.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +1100881Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +0000882.Xr ssh 1 .
883The argument must be
884.Dq yes ,
885.Dq without-password ,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100886.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000887or
888.Dq no .
889The default is
890.Dq yes .
891.Pp
892If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100893.Dq without-password ,
Darren Tucker9dca0992005-02-01 19:16:45 +1100894password authentication is disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000895.Pp
896If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100897.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000898root login with public key authentication will be allowed,
899but only if the
900.Ar command
901option has been specified
902(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +1000903normally not allowed).
904All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000905.Pp
906If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100907.Dq no ,
Darren Tuckerb3509012005-01-20 11:01:46 +1100908root is not allowed to log in.
Damien Millerd27b9472005-12-13 19:29:02 +1100909.It Cm PermitTunnel
910Specifies whether
911.Xr tun 4
912device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +1100913The argument must be
914.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +1000915.Dq point-to-point
916(layer 3),
917.Dq ethernet
918(layer 2), or
Damien Miller7b58e802005-12-13 19:33:19 +1100919.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +1000920Specifying
921.Dq yes
922permits both
923.Dq point-to-point
924and
925.Dq ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +1100926The default is
927.Dq no .
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000928.It Cm PermitUserEnvironment
929Specifies whether
930.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000931and
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000932.Cm environment=
933options in
934.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000935are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +1100936.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000937The default is
938.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000939Enabling environment processing may enable users to bypass access
940restrictions in some configurations using mechanisms such as
941.Ev LD_PRELOAD .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000942.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +0000943Specifies the file that contains the process ID of the
Damien Millerf4f22b52006-03-15 11:57:25 +1100944SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000945The default is
946.Pa /var/run/sshd.pid .
947.It Cm Port
948Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100949.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000950listens on.
951The default is 22.
952Multiple options of this type are permitted.
953See also
954.Cm ListenAddress .
955.It Cm PrintLastLog
956Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100957.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +1100958should print the date and time of the last user login when a user logs
959in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000960The default is
961.Dq yes .
962.It Cm PrintMotd
963Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100964.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000965should print
966.Pa /etc/motd
967when a user logs in interactively.
968(On some systems it is also printed by the shell,
969.Pa /etc/profile ,
970or equivalent.)
971The default is
972.Dq yes .
973.It Cm Protocol
974Specifies the protocol versions
Damien Miller5b0d63f2006-03-15 11:56:56 +1100975.Xr sshd 8
Ben Lindstrom9c445542002-07-11 03:59:18 +0000976supports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000977The possible values are
Damien Miller5b0d63f2006-03-15 11:56:56 +1100978.Sq 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000979and
Damien Miller5b0d63f2006-03-15 11:56:56 +1100980.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000981Multiple versions must be comma-separated.
982The default is
Darren Tucker7a4a7652009-10-11 21:51:40 +1100983.Sq 2 .
Ben Lindstrom9c445542002-07-11 03:59:18 +0000984Note that the order of the protocol list does not indicate preference,
985because the client selects among multiple protocol versions offered
986by the server.
987Specifying
988.Dq 2,1
989is identical to
990.Dq 1,2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000991.It Cm PubkeyAuthentication
992Specifies whether public key authentication is allowed.
993The default is
994.Dq yes .
995Note that this option applies to protocol version 2 only.
Damien Miller1aed65e2010-03-04 21:53:35 +1100996.It Cm RevokedKeys
Damien Millerf3747bf2013-01-18 11:44:04 +1100997Specifies revoked public keys.
Damien Miller1aed65e2010-03-04 21:53:35 +1100998Keys listed in this file will be refused for public key authentication.
999Note that if this file is not readable, then public key authentication will
1000be refused for all users.
Damien Millerf3747bf2013-01-18 11:44:04 +11001001Keys may be specified as a text file, listing one public key per line, or as
1002an OpenSSH Key Revocation List (KRL) as generated by
1003.Xr ssh-keygen 1
1004For more information on KRLs, see the
1005.Sx KEY REVOCATION LISTS
1006section in
1007.Xr ssh-keygen 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001008.It Cm RhostsRSAAuthentication
1009Specifies whether rhosts or /etc/hosts.equiv authentication together
1010with successful RSA host authentication is allowed.
1011The default is
1012.Dq no .
1013This option applies to protocol version 1 only.
1014.It Cm RSAAuthentication
1015Specifies whether pure RSA authentication is allowed.
1016The default is
1017.Dq yes .
1018This option applies to protocol version 1 only.
1019.It Cm ServerKeyBits
1020Defines the number of bits in the ephemeral protocol version 1 server key.
Darren Tucker7499b0c2008-07-02 22:35:43 +10001021The minimum value is 512, and the default is 1024.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001022.It Cm StrictModes
1023Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001024.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001025should check file modes and ownership of the
1026user's files and home directory before accepting login.
1027This is normally desirable because novices sometimes accidentally leave their
1028directory or files world-writable.
1029The default is
1030.Dq yes .
Darren Tuckerf788a912010-01-08 17:06:47 +11001031Note that this does not apply to
1032.Cm ChrootDirectory ,
1033whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001034.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +11001035Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +10001036Arguments should be a subsystem name and a command (with optional arguments)
1037to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001038.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001039The command
1040.Xr sftp-server 8
1041implements the
1042.Dq sftp
1043file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001044.Pp
1045Alternately the name
1046.Dq internal-sftp
1047implements an in-process
1048.Dq sftp
1049server.
1050This may simplify configurations using
1051.Cm ChrootDirectory
1052to force a different filesystem root on clients.
1053.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001054By default no subsystems are defined.
1055Note that this option applies to protocol version 2 only.
1056.It Cm SyslogFacility
1057Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001058.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001059The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1060LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1061The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001062.It Cm TCPKeepAlive
1063Specifies whether the system should send TCP keepalive messages to the
1064other side.
1065If they are sent, death of the connection or crash of one
1066of the machines will be properly noticed.
1067However, this means that
1068connections will die if the route is down temporarily, and some people
1069find it annoying.
1070On the other hand, if TCP keepalives are not sent,
1071sessions may hang indefinitely on the server, leaving
1072.Dq ghost
1073users and consuming server resources.
1074.Pp
1075The default is
1076.Dq yes
1077(to send TCP keepalive messages), and the server will notice
1078if the network goes down or the client host crashes.
1079This avoids infinitely hanging sessions.
1080.Pp
1081To disable TCP keepalive messages, the value should be set to
1082.Dq no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001083.It Cm TrustedUserCAKeys
1084Specifies a file containing public keys of certificate authorities that are
Damien Millerc6db99e2010-03-05 10:41:45 +11001085trusted to sign user certificates for authentication.
Damien Miller72b33822010-03-05 07:39:01 +11001086Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001087.Ql #
1088are allowed.
1089If a certificate is presented for authentication and has its signing CA key
1090listed in this file, then it may be used for authentication for any user
1091listed in the certificate's principals list.
1092Note that certificates that lack a list of principals will not be permitted
1093for authentication using
1094.Cm TrustedUserCAKeys .
Damien Miller72b33822010-03-05 07:39:01 +11001095For more details on certificates, see the
Damien Miller1aed65e2010-03-04 21:53:35 +11001096.Sx CERTIFICATES
1097section in
1098.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001099.It Cm UseDNS
1100Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001101.Xr sshd 8
Darren Tucker83d5a982005-03-31 21:33:50 +10001102should look up the remote host name and check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001103the resolved host name for the remote IP address maps back to the
1104very same IP address.
1105The default is
1106.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001107.It Cm UseLogin
1108Specifies whether
1109.Xr login 1
1110is used for interactive login sessions.
1111The default is
1112.Dq no .
1113Note that
1114.Xr login 1
1115is never used for remote command execution.
1116Note also, that if this is enabled,
1117.Cm X11Forwarding
1118will be disabled because
1119.Xr login 1
1120does not know how to handle
1121.Xr xauth 1
Damien Miller495dca32003-04-01 21:42:14 +10001122cookies.
1123If
Ben Lindstrom9f049032002-06-21 00:59:05 +00001124.Cm UsePrivilegeSeparation
1125is specified, it will be disabled after authentication.
Damien Miller2e193e22003-05-14 15:13:03 +10001126.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001127Enables the Pluggable Authentication Module interface.
1128If set to
1129.Dq yes
1130this will enable PAM authentication using
1131.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001132and
1133.Cm PasswordAuthentication
1134in addition to PAM account and session module processing for all
1135authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001136.Pp
1137Because PAM challenge-response authentication usually serves an equivalent
1138role to password authentication, you should disable either
1139.Cm PasswordAuthentication
1140or
1141.Cm ChallengeResponseAuthentication.
1142.Pp
1143If
1144.Cm UsePAM
1145is enabled, you will not be able to run
1146.Xr sshd 8
1147as a non-root user.
1148The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +10001149.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001150.It Cm UsePrivilegeSeparation
1151Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001152.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001153separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +10001154to deal with incoming network traffic.
1155After successful authentication, another process will be created that has
1156the privilege of the authenticated user.
1157The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +00001158escalation by containing any corruption within the unprivileged processes.
1159The default is
1160.Dq yes .
Damien Miller69ff1df2011-06-23 08:30:03 +10001161If
1162.Cm UsePrivilegeSeparation
1163is set to
1164.Dq sandbox
1165then the pre-authentication unprivileged process is subject to additional
1166restrictions.
Damien Miller23528812012-04-22 11:24:43 +10001167.It Cm VersionAddendum
1168Optionally specifies additional text to append to the SSH protocol banner
1169sent by the server upon connection.
1170The default is
1171.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001172.It Cm X11DisplayOffset
1173Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001174.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001175X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001176This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001177The default is 10.
1178.It Cm X11Forwarding
1179Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001180The argument must be
1181.Dq yes
1182or
1183.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001184The default is
1185.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +10001186.Pp
1187When X11 forwarding is enabled, there may be additional exposure to
1188the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001189.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001190proxy display is configured to listen on the wildcard address (see
1191.Cm X11UseLocalhost
Damien Miller5b0d63f2006-03-15 11:56:56 +11001192below), though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001193Additionally, the authentication spoofing and authentication data
1194verification and substitution occur on the client side.
1195The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001196display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001197forwarding (see the warnings for
1198.Cm ForwardX11
1199in
Damien Millerf1ce5052003-06-11 22:04:39 +10001200.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001201A system administrator may have a stance in which they want to
1202protect clients that may expose themselves to attack by unwittingly
1203requesting X11 forwarding, which can warrant a
1204.Dq no
1205setting.
1206.Pp
1207Note that disabling X11 forwarding does not prevent users from
1208forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001209X11 forwarding is automatically disabled if
1210.Cm UseLogin
1211is enabled.
1212.It Cm X11UseLocalhost
1213Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001214.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001215should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001216the wildcard address.
1217By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001218sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001219hostname part of the
1220.Ev DISPLAY
1221environment variable to
1222.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001223This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001224However, some older X11 clients may not function with this
1225configuration.
1226.Cm X11UseLocalhost
1227may be set to
1228.Dq no
1229to specify that the forwarding server should be bound to the wildcard
1230address.
1231The argument must be
1232.Dq yes
1233or
1234.Dq no .
1235The default is
1236.Dq yes .
1237.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001238Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001239.Xr xauth 1
1240program.
1241The default is
1242.Pa /usr/X11R6/bin/xauth .
1243.El
Damien Millere3beba22006-03-15 11:59:25 +11001244.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001245.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001246command-line arguments and configuration file options that specify time
1247may be expressed using a sequence of the form:
1248.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001249.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001250.Sm on
1251where
1252.Ar time
1253is a positive integer value and
1254.Ar qualifier
1255is one of the following:
1256.Pp
1257.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001258.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001259seconds
1260.It Cm s | Cm S
1261seconds
1262.It Cm m | Cm M
1263minutes
1264.It Cm h | Cm H
1265hours
1266.It Cm d | Cm D
1267days
1268.It Cm w | Cm W
1269weeks
1270.El
1271.Pp
1272Each member of the sequence is added together to calculate
1273the total time value.
1274.Pp
1275Time format examples:
1276.Pp
1277.Bl -tag -width Ds -compact -offset indent
1278.It 600
1279600 seconds (10 minutes)
1280.It 10m
128110 minutes
1282.It 1h30m
12831 hour 30 minutes (90 minutes)
1284.El
1285.Sh FILES
1286.Bl -tag -width Ds
1287.It Pa /etc/ssh/sshd_config
1288Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001289.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001290This file should be writable by root only, but it is recommended
1291(though not necessary) that it be world-readable.
1292.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001293.Sh SEE ALSO
1294.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001295.Sh AUTHORS
1296OpenSSH is a derivative of the original and free
1297ssh 1.2.12 release by Tatu Ylonen.
1298Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1299Theo de Raadt and Dug Song
1300removed many bugs, re-added newer features and
1301created OpenSSH.
1302Markus Friedl contributed the support for SSH
1303protocol versions 1.5 and 2.0.
1304Niels Provos and Markus Friedl contributed support
1305for privilege separation.