blob: 9e0b3a5c03aa0c598955ff913acb9f3fea86698d [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.\"
Darren Tucker5f96f3b2013-05-16 20:29:28 +100036.\" $OpenBSD: sshd_config.5,v 1.159 2013/05/16 04:09:14 dtucker Exp $
37.Dd $Mdocdate: May 16 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
Damien Miller91a55f22013-04-23 15:18:10 +1000183For keyboard interactive authentication it is also possible to
184restrict authentication to a specific device by appending a
185colon followed by the device identifier
186.Dq bsdauth ,
187.Dq pam ,
188or
189.Dq skey ,
190depending on the server configuration.
191For example,
192.Dq keyboard-interactive:bsdauth
193would restrict keyboard interactive authentication to the
194.Dq bsdauth
195device.
196.Pp
Damien Millera6e3f012012-11-04 23:21:40 +1100197This option is only available for SSH protocol 2 and will yield a fatal
198error if enabled if protocol 1 is also enabled.
199Note that each authentication method listed should also be explicitly enabled
200in the configuration.
201The default is not to require multiple authentication; successful completion
202of a single authentication method is sufficient.
Damien Miller09d3e122012-10-31 08:58:58 +1100203.It Cm AuthorizedKeysCommand
Damien Millerf33580e2012-11-04 22:22:52 +1100204Specifies a program to be used to look up the user's public keys.
Damien Miller467b00c2013-04-23 15:23:07 +1000205The program must be owned by root and not writable by group or others.
206It will be invoked with a single argument of the username
Damien Miller09d3e122012-10-31 08:58:58 +1100207being authenticated, and should produce on standard output zero or
Damien Millerf33580e2012-11-04 22:22:52 +1100208more lines of authorized_keys output (see
209.Sx AUTHORIZED_KEYS
210in
211.Xr sshd 8 ) .
Damien Miller09d3e122012-10-31 08:58:58 +1100212If a key supplied by AuthorizedKeysCommand does not successfully authenticate
213and authorize the user then public key authentication continues using the usual
214.Cm AuthorizedKeysFile
215files.
216By default, no AuthorizedKeysCommand is run.
217.It Cm AuthorizedKeysCommandUser
218Specifies the user under whose account the AuthorizedKeysCommand is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100219It is recommended to use a dedicated user that has no other role on the host
220than running authorized keys commands.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000221.It Cm AuthorizedKeysFile
222Specifies the file that contains the public keys that can be used
223for user authentication.
Damien Miller6018a362010-07-02 13:35:19 +1000224The format is described in the
225.Sx AUTHORIZED_KEYS FILE FORMAT
226section of
227.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000228.Cm AuthorizedKeysFile
229may contain tokens of the form %T which are substituted during connection
Damien Miller5b0d63f2006-03-15 11:56:56 +1100230setup.
Damien Millerfbf486b2003-05-23 18:44:23 +1000231The following tokens are defined: %% is replaced by a literal '%',
Damien Miller5b0d63f2006-03-15 11:56:56 +1100232%h is replaced by the home directory of the user being authenticated, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000233%u is replaced by the username of that user.
234After expansion,
235.Cm AuthorizedKeysFile
236is taken to be an absolute path or one relative to the user's home
237directory.
Damien Millerb9132fc2011-05-29 21:41:40 +1000238Multiple files may be listed, separated by whitespace.
239The default is
240.Dq .ssh/authorized_keys .ssh/authorized_keys2 .
Damien Miller30da3442010-05-10 11:58:03 +1000241.It Cm AuthorizedPrincipalsFile
242Specifies a file that lists principal names that are accepted for
243certificate authentication.
244When using certificates signed by a key listed in
245.Cm TrustedUserCAKeys ,
246this file lists names, one of which must appear in the certificate for it
247to be accepted for authentication.
Damien Millerd59dab82010-07-02 13:37:17 +1000248Names are listed one per line preceded by key options (as described
Damien Miller6018a362010-07-02 13:35:19 +1000249in
250.Sx AUTHORIZED_KEYS FILE FORMAT
251in
Damien Millerd59dab82010-07-02 13:37:17 +1000252.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000253Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000254.Ql #
255are ignored.
256.Pp
257.Cm AuthorizedPrincipalsFile
258may contain tokens of the form %T which are substituted during connection
259setup.
260The following tokens are defined: %% is replaced by a literal '%',
261%h is replaced by the home directory of the user being authenticated, and
262%u is replaced by the username of that user.
263After expansion,
264.Cm AuthorizedPrincipalsFile
265is taken to be an absolute path or one relative to the user's home
266directory.
267.Pp
Damien Miller8fef9eb2012-04-22 11:25:10 +1000268The default is
269.Dq none ,
270i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000271of the user must appear in a certificate's principals list for it to be
272accepted.
273Note that
274.Cm AuthorizedPrincipalsFile
275is only used when authentication proceeds using a CA listed in
276.Cm TrustedUserCAKeys
277and is not consulted for certification authorities trusted via
278.Pa ~/.ssh/authorized_keys ,
279though the
280.Cm principals=
281key option offers a similar facility (see
282.Xr sshd 8
283for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000284.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000285The contents of the specified file are sent to the remote user before
286authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000287If the argument is
288.Dq none
289then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000290This option is only available for protocol version 2.
291By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000292.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000293Specifies whether challenge-response authentication is allowed (e.g. via
294PAM or though authentication styles supported in
295.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000296The default is
297.Dq yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100298.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100299Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100300.Xr chroot 2
301to after authentication.
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100302All components of the pathname must be root-owned directories that are
Damien Millerd8cb1f12008-02-10 22:40:12 +1100303not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000304After the chroot,
305.Xr sshd 8
306changes the working directory to the user's home directory.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100307.Pp
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100308The pathname may contain the following tokens that are expanded at runtime once
Damien Millerd8cb1f12008-02-10 22:40:12 +1100309the connecting user has been authenticated: %% is replaced by a literal '%',
310%h is replaced by the home directory of the user being authenticated, and
311%u is replaced by the username of that user.
312.Pp
313The
314.Cm ChrootDirectory
315must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000316user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100317For an interactive session this requires at least a shell, typically
318.Xr sh 1 ,
319and basic
320.Pa /dev
321nodes such as
322.Xr null 4 ,
323.Xr zero 4 ,
324.Xr stdin 4 ,
325.Xr stdout 4 ,
326.Xr stderr 4 ,
327.Xr arandom 4
328and
329.Xr tty 4
330devices.
331For file transfer sessions using
Darren Tuckerf92077f2009-06-21 17:56:25 +1000332.Dq sftp ,
Damien Millerd8cb1f12008-02-10 22:40:12 +1100333no additional configuration of the environment is necessary if the
Darren Tuckerf92077f2009-06-21 17:56:25 +1000334in-process sftp server is used,
335though sessions which use logging do require
Darren Tucker00fcd712009-06-21 17:56:00 +1000336.Pa /dev/log
337inside the chroot directory (see
338.Xr sftp-server 8
339for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100340.Pp
341The default is not to
342.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000343.It Cm Ciphers
344Specifies the ciphers allowed for protocol version 2.
345Multiple ciphers must be comma-separated.
Damien Miller05202ff2004-06-15 10:30:39 +1000346The supported ciphers are
347.Dq 3des-cbc ,
348.Dq aes128-cbc ,
349.Dq aes192-cbc ,
350.Dq aes256-cbc ,
351.Dq aes128-ctr ,
352.Dq aes192-ctr ,
353.Dq aes256-ctr ,
Damien Miller1d75abf2013-01-09 16:12:19 +1100354.Dq aes128-gcm@openssh.com ,
355.Dq aes256-gcm@openssh.com ,
Damien Miller3710f272005-05-26 12:19:17 +1000356.Dq arcfour128 ,
357.Dq arcfour256 ,
Damien Miller05202ff2004-06-15 10:30:39 +1000358.Dq arcfour ,
359.Dq blowfish-cbc ,
360and
361.Dq cast128-cbc .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100362The default is:
363.Bd -literal -offset 3n
Damien Miller9aa72ba2009-01-28 16:34:00 +1100364aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,
Damien Miller1d75abf2013-01-09 16:12:19 +1100365aes128-gcm@openssh.com,aes256-gcm@openssh.com,
Damien Miller9aa72ba2009-01-28 16:34:00 +1100366aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,
367aes256-cbc,arcfour
Ben Lindstrom9f049032002-06-21 00:59:05 +0000368.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +0000369.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100370Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000371sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100372.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000373receiving any messages back from the client.
374If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100375sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000376It is important to note that the use of client alive messages is very
377different from
Damien Miller12c150e2003-12-17 16:31:10 +1100378.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000379(below).
380The client alive messages are sent through the encrypted channel
381and therefore will not be spoofable.
382The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100383.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000384is spoofable.
385The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000386server depend on knowing when a connection has become inactive.
387.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000388The default value is 3.
389If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000390.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100391(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000392.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100393is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000394will be disconnected after approximately 45 seconds.
Damien Millercc3e8ba2006-03-15 12:06:55 +1100395This option applies to protocol version 2 only.
Damien Miller1594ad52005-05-26 12:12:19 +1000396.It Cm ClientAliveInterval
397Sets a timeout interval in seconds after which if no data has been received
398from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100399.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000400will send a message through the encrypted
401channel to request a response from the client.
402The default
403is 0, indicating that these messages will not be sent to the client.
404This option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000405.It Cm Compression
Damien Miller9786e6e2005-07-26 21:54:56 +1000406Specifies whether compression is allowed, or delayed until
407the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000408The argument must be
Damien Miller9786e6e2005-07-26 21:54:56 +1000409.Dq yes ,
410.Dq delayed ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000411or
412.Dq no .
413The default is
Damien Miller9786e6e2005-07-26 21:54:56 +1000414.Dq delayed .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000415.It Cm DenyGroups
416This keyword can be followed by a list of group name patterns, separated
417by spaces.
418Login is disallowed for users whose primary group or supplementary
419group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000420Only group names are valid; a numerical group ID is not recognized.
421By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100422The allow/deny directives are processed in the following order:
423.Cm DenyUsers ,
424.Cm AllowUsers ,
425.Cm DenyGroups ,
426and finally
427.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100428.Pp
429See
430.Sx PATTERNS
431in
432.Xr ssh_config 5
433for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000434.It Cm DenyUsers
435This keyword can be followed by a list of user name patterns, separated
436by spaces.
437Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000438Only user names are valid; a numerical user ID is not recognized.
439By default, login is allowed for all users.
440If the pattern takes the form USER@HOST then USER and HOST
441are separately checked, restricting logins to particular
442users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100443The allow/deny directives are processed in the following order:
444.Cm DenyUsers ,
445.Cm AllowUsers ,
446.Cm DenyGroups ,
447and finally
448.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100449.Pp
450See
451.Sx PATTERNS
452in
453.Xr ssh_config 5
454for more information on patterns.
Damien Millere2754432006-07-24 14:06:47 +1000455.It Cm ForceCommand
456Forces the execution of the command specified by
457.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100458ignoring any command supplied by the client and
459.Pa ~/.ssh/rc
460if present.
Damien Millere2754432006-07-24 14:06:47 +1000461The command is invoked by using the user's login shell with the -c option.
462This applies to shell, command, or subsystem execution.
463It is most useful inside a
464.Cm Match
465block.
466The command originally supplied by the client is available in the
467.Ev SSH_ORIGINAL_COMMAND
468environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100469Specifying a command of
470.Dq internal-sftp
471will force the use of an in-process sftp server that requires no support
472files when used with
473.Cm ChrootDirectory .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000474.It Cm GatewayPorts
475Specifies whether remote hosts are allowed to connect to ports
476forwarded for the client.
477By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100478.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000479binds remote port forwardings to the loopback address.
480This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000481.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100482can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100483should allow remote port forwardings to bind to non-loopback addresses, thus
484allowing other hosts to connect.
485The argument may be
486.Dq no
487to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000488.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100489to force remote port forwardings to bind to the wildcard address, or
490.Dq clientspecified
491to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000492The default is
493.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000494.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000495Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100496The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000497.Dq no .
498Note that this option applies to protocol version 2 only.
499.It Cm GSSAPICleanupCredentials
500Specifies whether to automatically destroy the user's credentials cache
501on logout.
502The default is
503.Dq yes .
504Note that this option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000505.It Cm HostbasedAuthentication
506Specifies whether rhosts or /etc/hosts.equiv authentication together
507with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100508(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000509This option is similar to
510.Cm RhostsRSAAuthentication
511and applies to protocol version 2 only.
512The default is
513.Dq no .
Damien Millerb594f382006-08-30 11:06:34 +1000514.It Cm HostbasedUsesNameFromPacketOnly
515Specifies whether or not the server will attempt to perform a reverse
516name lookup when matching the name in the
517.Pa ~/.shosts ,
518.Pa ~/.rhosts ,
519and
520.Pa /etc/hosts.equiv
521files during
522.Cm HostbasedAuthentication .
523A setting of
524.Dq yes
525means that
526.Xr sshd 8
527uses the name supplied by the client rather than
528attempting to resolve the name from the TCP connection itself.
529The default is
530.Dq no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100531.It Cm HostCertificate
532Specifies a file containing a public host certificate.
533The certificate's public key must match a private host key already specified
534by
535.Cm HostKey .
536The default behaviour of
537.Xr sshd 8
538is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000539.It Cm HostKey
540Specifies a file containing a private host key
541used by SSH.
542The default is
543.Pa /etc/ssh/ssh_host_key
544for protocol version 1, and
Damien Millereb8b60e2010-08-31 22:41:14 +1000545.Pa /etc/ssh/ssh_host_dsa_key ,
546.Pa /etc/ssh/ssh_host_ecdsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000547and
Damien Millereb8b60e2010-08-31 22:41:14 +1000548.Pa /etc/ssh/ssh_host_rsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000549for protocol version 2.
550Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100551.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000552will refuse to use a file if it is group/world-accessible.
553It is possible to have multiple host key files.
554.Dq rsa1
555keys are used for version 1 and
Damien Millereb8b60e2010-08-31 22:41:14 +1000556.Dq dsa ,
557.Dq ecdsa
Ben Lindstrom9f049032002-06-21 00:59:05 +0000558or
559.Dq rsa
560are used for version 2 of the SSH protocol.
561.It Cm IgnoreRhosts
562Specifies that
563.Pa .rhosts
564and
565.Pa .shosts
566files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000567.Cm RhostsRSAAuthentication
568or
569.Cm HostbasedAuthentication .
570.Pp
571.Pa /etc/hosts.equiv
572and
573.Pa /etc/shosts.equiv
574are still used.
575The default is
576.Dq yes .
577.It Cm IgnoreUserKnownHosts
578Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100579.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000580should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000581.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000582during
583.Cm RhostsRSAAuthentication
584or
585.Cm HostbasedAuthentication .
586The default is
587.Dq no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100588.It Cm IPQoS
589Specifies the IPv4 type-of-service or DSCP class for the connection.
590Accepted values are
591.Dq af11 ,
592.Dq af12 ,
593.Dq af13 ,
Damien Millerf6e758c2011-09-22 21:37:13 +1000594.Dq af21 ,
Damien Miller0dac6fb2010-11-20 15:19:38 +1100595.Dq af22 ,
596.Dq af23 ,
597.Dq af31 ,
598.Dq af32 ,
599.Dq af33 ,
600.Dq af41 ,
601.Dq af42 ,
602.Dq af43 ,
603.Dq cs0 ,
604.Dq cs1 ,
605.Dq cs2 ,
606.Dq cs3 ,
607.Dq cs4 ,
608.Dq cs5 ,
609.Dq cs6 ,
610.Dq cs7 ,
611.Dq ef ,
612.Dq lowdelay ,
613.Dq throughput ,
614.Dq reliability ,
615or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +1100616This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100617If one argument is specified, it is used as the packet class unconditionally.
618If two values are specified, the first is automatically selected for
619interactive sessions and the second for non-interactive sessions.
620The default is
621.Dq lowdelay
622for interactive sessions and
623.Dq throughput
624for non-interactive sessions.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000625.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000626Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000627.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000628will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000629To use this option, the server needs a
630Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100631The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000632.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100633.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000634If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100635an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100636The default is
Damien Miller8448e662004-03-08 23:13:15 +1100637.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000638.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100639If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000640the password will be validated via any additional local mechanism
641such as
642.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100643The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000644.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000645.It Cm KerberosTicketCleanup
646Specifies whether to automatically destroy the user's ticket cache
647file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100648The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000649.Dq yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000650.It Cm KexAlgorithms
651Specifies the available KEX (Key Exchange) algorithms.
652Multiple algorithms must be comma-separated.
653The default is
654.Dq ecdh-sha2-nistp256 ,
655.Dq ecdh-sha2-nistp384 ,
656.Dq ecdh-sha2-nistp521 ,
Damien Miller0a184732010-11-20 15:21:03 +1100657.Dq diffie-hellman-group-exchange-sha256 ,
Damien Millerd5f62bf2010-09-24 22:11:14 +1000658.Dq diffie-hellman-group-exchange-sha1 ,
659.Dq diffie-hellman-group14-sha1 ,
660.Dq diffie-hellman-group1-sha1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000661.It Cm KeyRegenerationInterval
662In protocol version 1, the ephemeral server key is automatically regenerated
663after this many seconds (if it has been used).
664The purpose of regeneration is to prevent
665decrypting captured sessions by later breaking into the machine and
666stealing the keys.
667The key is never stored anywhere.
668If the value is 0, the key is never regenerated.
669The default is 3600 (seconds).
670.It Cm ListenAddress
671Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100672.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000673should listen on.
674The following forms may be used:
675.Pp
676.Bl -item -offset indent -compact
677.It
678.Cm ListenAddress
679.Sm off
680.Ar host No | Ar IPv4_addr No | Ar IPv6_addr
681.Sm on
682.It
683.Cm ListenAddress
684.Sm off
685.Ar host No | Ar IPv4_addr No : Ar port
686.Sm on
687.It
688.Cm ListenAddress
689.Sm off
690.Oo
691.Ar host No | Ar IPv6_addr Oc : Ar port
692.Sm on
693.El
694.Pp
695If
696.Ar port
697is not specified,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100698sshd will listen on the address and all prior
Ben Lindstrom9f049032002-06-21 00:59:05 +0000699.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000700options specified.
701The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000702Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000703.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000704options are permitted.
705Additionally, any
Ben Lindstrom9f049032002-06-21 00:59:05 +0000706.Cm Port
Damien Miller5b0d63f2006-03-15 11:56:56 +1100707options must precede this option for non-port qualified addresses.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000708.It Cm LoginGraceTime
709The server disconnects after this time if the user has not
710successfully logged in.
711If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000712The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000713.It Cm LogLevel
714Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100715.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000716The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100717QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000718The default is INFO.
719DEBUG and DEBUG1 are equivalent.
720DEBUG2 and DEBUG3 each specify higher levels of debugging output.
721Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000722.It Cm MACs
723Specifies the available MAC (message authentication code) algorithms.
724The MAC algorithm is used in protocol version 2
725for data integrity protection.
726Multiple algorithms must be comma-separated.
Damien Milleraf43a7a2012-12-12 10:46:31 +1100727The algorithms that contain
728.Dq -etm
729calculate the MAC after encryption (encrypt-then-mac).
730These are considered safer and their use recommended.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100731The default is:
Damien Miller22b7b492007-06-11 14:07:12 +1000732.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +1100733hmac-md5-etm@openssh.com,hmac-sha1-etm@openssh.com,
734umac-64-etm@openssh.com,umac-128-etm@openssh.com,
735hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
736hmac-ripemd160-etm@openssh.com,hmac-sha1-96-etm@openssh.com,
737hmac-md5-96-etm@openssh.com,
Darren Tucker427e4092012-10-05 11:02:39 +1000738hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,
Darren Tuckerecbf14a2012-07-02 18:53:37 +1000739hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,
740hmac-sha1-96,hmac-md5-96
Damien Miller22b7b492007-06-11 14:07:12 +1000741.Ed
Darren Tucker45150472006-07-12 22:34:17 +1000742.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +1000743Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +1000744If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +1000745.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000746line are satisfied, the keywords on the following lines override those
747set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +1000748.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000749line or the end of the file.
Darren Tucker7a3935d2008-06-10 22:59:10 +1000750.Pp
Damien Millerd04f3572006-07-24 13:46:50 +1000751The arguments to
Darren Tucker45150472006-07-12 22:34:17 +1000752.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000753are one or more criteria-pattern pairs.
Darren Tucker45150472006-07-12 22:34:17 +1000754The available criteria are
755.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +1000756.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +1000757.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +1000758.Cm LocalAddress ,
759.Cm LocalPort ,
Darren Tucker45150472006-07-12 22:34:17 +1000760and
761.Cm Address .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000762The match patterns may consist of single entries or comma-separated
763lists and may use the wildcard and negation operators described in the
Darren Tuckerb06cc4a2008-06-10 22:59:53 +1000764.Sx PATTERNS
Darren Tucker7a3935d2008-06-10 22:59:10 +1000765section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +1000766.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000767.Pp
768The patterns in an
769.Cm Address
770criteria may additionally contain addresses to match in CIDR
Darren Tucker6a2a4002008-06-10 23:03:04 +1000771address/masklen format, e.g.\&
Darren Tucker7a3935d2008-06-10 22:59:10 +1000772.Dq 192.0.2.0/24
773or
774.Dq 3ffe:ffff::/32 .
775Note that the mask length provided must be consistent with the address -
776it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +1000777or one with bits set in this host portion of the address.
778For example,
Darren Tucker7a3935d2008-06-10 22:59:10 +1000779.Dq 192.0.2.0/33
780and
Darren Tucker6a2a4002008-06-10 23:03:04 +1000781.Dq 192.0.2.0/8
Darren Tucker7a3935d2008-06-10 22:59:10 +1000782respectively.
783.Pp
Darren Tucker45150472006-07-12 22:34:17 +1000784Only a subset of keywords may be used on the lines following a
785.Cm Match
786keyword.
787Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +1000788.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +1100789.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +1000790.Cm AllowGroups ,
Damien Miller9b439df2006-07-24 14:04:00 +1000791.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +1000792.Cm AllowUsers ,
Damien Millera6e3f012012-11-04 23:21:40 +1100793.Cm AuthenticationMethods ,
Damien Miller09d3e122012-10-31 08:58:58 +1100794.Cm AuthorizedKeysCommand ,
795.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +1100796.Cm AuthorizedKeysFile ,
Damien Millerab6de352010-06-26 09:38:45 +1000797.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +1100798.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +1000799.Cm ChrootDirectory ,
Damien Millerc24da772012-06-20 21:53:58 +1000800.Cm DenyGroups ,
801.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +1000802.Cm ForceCommand ,
Damien Millerc24da772012-06-20 21:53:58 +1000803.Cm GatewayPorts ,
Damien Millerf8268502012-06-20 21:54:15 +1000804.Cm GSSAPIAuthentication ,
Damien Miller25434de2008-05-19 14:29:08 +1000805.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +1000806.Cm HostbasedUsesNameFromPacketOnly ,
Darren Tucker1d75f222007-03-01 21:31:28 +1100807.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +1100808.Cm KerberosAuthentication ,
Damien Miller307c1d12008-06-16 07:56:20 +1000809.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +1000810.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +1100811.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +1100812.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +1000813.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +1100814.Cm PermitRootLogin ,
Damien Millerab6de352010-06-26 09:38:45 +1000815.Cm PermitTunnel ,
Darren Tucker1477ea12009-10-07 08:36:05 +1100816.Cm PubkeyAuthentication ,
Darren Tucker5f96f3b2013-05-16 20:29:28 +1000817.Cm RekeyLimit ,
Damien Millerc24da772012-06-20 21:53:58 +1000818.Cm RhostsRSAAuthentication ,
Damien Millerf8268502012-06-20 21:54:15 +1000819.Cm RSAAuthentication ,
Damien Millerd1de9952006-07-24 14:05:48 +1000820.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +1100821.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +1000822and
Damien Miller0296ae82009-02-23 11:00:24 +1100823.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +1000824.It Cm MaxAuthTries
825Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +1000826connection.
827Once the number of failures reaches half this value,
828additional failures are logged.
829The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +1000830.It Cm MaxSessions
831Specifies the maximum number of open sessions permitted per network connection.
832The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000833.It Cm MaxStartups
834Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +1100835SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000836Additional connections will be dropped until authentication succeeds or the
837.Cm LoginGraceTime
838expires for a connection.
Damien Miller1f583df2013-02-12 11:02:08 +1100839The default is 10:30:100.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000840.Pp
841Alternatively, random early drop can be enabled by specifying
842the three colon separated values
843.Dq start:rate:full
Damien Miller208f1ed2006-03-15 11:56:03 +1100844(e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +1100845.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000846will refuse connection attempts with a probability of
847.Dq rate/100
848(30%)
849if there are currently
850.Dq start
851(10)
852unauthenticated connections.
853The probability increases linearly and all connection attempts
854are refused if the number of unauthenticated connections reaches
855.Dq full
856(60).
857.It Cm PasswordAuthentication
858Specifies whether password authentication is allowed.
859The default is
860.Dq yes .
861.It Cm PermitEmptyPasswords
862When password authentication is allowed, it specifies whether the
863server allows login to accounts with empty password strings.
864The default is
865.Dq no .
Damien Miller9b439df2006-07-24 14:04:00 +1000866.It Cm PermitOpen
867Specifies the destinations to which TCP port forwarding is permitted.
868The forwarding specification must be one of the following forms:
869.Pp
870.Bl -item -offset indent -compact
871.It
872.Cm PermitOpen
873.Sm off
874.Ar host : port
875.Sm on
876.It
877.Cm PermitOpen
878.Sm off
879.Ar IPv4_addr : port
880.Sm on
881.It
882.Cm PermitOpen
883.Sm off
884.Ar \&[ IPv6_addr \&] : port
885.Sm on
886.El
887.Pp
Damien Millera765cf42006-07-24 14:08:13 +1000888Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +1000889An argument of
890.Dq any
891can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +1000892An argument of
893.Dq none
894can be used to prohibit all forwarding requests.
Damien Miller65bc2c42006-07-24 14:04:16 +1000895By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000896.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +1100897Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +0000898.Xr ssh 1 .
899The argument must be
900.Dq yes ,
901.Dq without-password ,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100902.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000903or
904.Dq no .
905The default is
906.Dq yes .
907.Pp
908If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100909.Dq without-password ,
Darren Tucker9dca0992005-02-01 19:16:45 +1100910password authentication is disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000911.Pp
912If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100913.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000914root login with public key authentication will be allowed,
915but only if the
916.Ar command
917option has been specified
918(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +1000919normally not allowed).
920All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000921.Pp
922If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100923.Dq no ,
Darren Tuckerb3509012005-01-20 11:01:46 +1100924root is not allowed to log in.
Damien Millerd27b9472005-12-13 19:29:02 +1100925.It Cm PermitTunnel
926Specifies whether
927.Xr tun 4
928device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +1100929The argument must be
930.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +1000931.Dq point-to-point
932(layer 3),
933.Dq ethernet
934(layer 2), or
Damien Miller7b58e802005-12-13 19:33:19 +1100935.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +1000936Specifying
937.Dq yes
938permits both
939.Dq point-to-point
940and
941.Dq ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +1100942The default is
943.Dq no .
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000944.It Cm PermitUserEnvironment
945Specifies whether
946.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000947and
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000948.Cm environment=
949options in
950.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000951are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +1100952.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000953The default is
954.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000955Enabling environment processing may enable users to bypass access
956restrictions in some configurations using mechanisms such as
957.Ev LD_PRELOAD .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000958.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +0000959Specifies the file that contains the process ID of the
Damien Millerf4f22b52006-03-15 11:57:25 +1100960SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000961The default is
962.Pa /var/run/sshd.pid .
963.It Cm Port
964Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100965.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000966listens on.
967The default is 22.
968Multiple options of this type are permitted.
969See also
970.Cm ListenAddress .
971.It Cm PrintLastLog
972Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100973.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +1100974should print the date and time of the last user login when a user logs
975in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000976The default is
977.Dq yes .
978.It Cm PrintMotd
979Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100980.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000981should print
982.Pa /etc/motd
983when a user logs in interactively.
984(On some systems it is also printed by the shell,
985.Pa /etc/profile ,
986or equivalent.)
987The default is
988.Dq yes .
989.It Cm Protocol
990Specifies the protocol versions
Damien Miller5b0d63f2006-03-15 11:56:56 +1100991.Xr sshd 8
Ben Lindstrom9c445542002-07-11 03:59:18 +0000992supports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000993The possible values are
Damien Miller5b0d63f2006-03-15 11:56:56 +1100994.Sq 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000995and
Damien Miller5b0d63f2006-03-15 11:56:56 +1100996.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000997Multiple versions must be comma-separated.
998The default is
Darren Tucker7a4a7652009-10-11 21:51:40 +1100999.Sq 2 .
Ben Lindstrom9c445542002-07-11 03:59:18 +00001000Note that the order of the protocol list does not indicate preference,
1001because the client selects among multiple protocol versions offered
1002by the server.
1003Specifying
1004.Dq 2,1
1005is identical to
1006.Dq 1,2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001007.It Cm PubkeyAuthentication
1008Specifies whether public key authentication is allowed.
1009The default is
1010.Dq yes .
1011Note that this option applies to protocol version 2 only.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001012.It Cm RekeyLimit
1013Specifies the maximum amount of data that may be transmitted before the
1014session key is renegotiated, optionally followed a maximum amount of
1015time that may pass before the session key is renegotiated.
1016The first argument is specified in bytes and may have a suffix of
1017.Sq K ,
1018.Sq M ,
1019or
1020.Sq G
1021to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1022The default is between
1023.Sq 1G
1024and
1025.Sq 4G ,
1026depending on the cipher.
1027The optional second value is specified in seconds and may use any of the
1028units documented in the
1029.Sx TIME FORMATS
1030section of
1031.Xr sshd_config 5 .
1032The default value for
1033.Cm RekeyLimit
1034is
1035.Dq default none ,
1036which means that rekeying is performed after the cipher's default amount
1037of data has been sent or received and no time based rekeying is done.
1038This option applies to protocol version 2 only.
Damien Miller1aed65e2010-03-04 21:53:35 +11001039.It Cm RevokedKeys
Damien Millerf3747bf2013-01-18 11:44:04 +11001040Specifies revoked public keys.
Damien Miller1aed65e2010-03-04 21:53:35 +11001041Keys listed in this file will be refused for public key authentication.
1042Note that if this file is not readable, then public key authentication will
1043be refused for all users.
Damien Millerf3747bf2013-01-18 11:44:04 +11001044Keys may be specified as a text file, listing one public key per line, or as
1045an OpenSSH Key Revocation List (KRL) as generated by
Damien Miller72abeb72013-01-20 22:33:44 +11001046.Xr ssh-keygen 1 .
Damien Millerf3747bf2013-01-18 11:44:04 +11001047For more information on KRLs, see the
1048.Sx KEY REVOCATION LISTS
1049section in
1050.Xr ssh-keygen 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001051.It Cm RhostsRSAAuthentication
1052Specifies whether rhosts or /etc/hosts.equiv authentication together
1053with successful RSA host authentication is allowed.
1054The default is
1055.Dq no .
1056This option applies to protocol version 1 only.
1057.It Cm RSAAuthentication
1058Specifies whether pure RSA authentication is allowed.
1059The default is
1060.Dq yes .
1061This option applies to protocol version 1 only.
1062.It Cm ServerKeyBits
1063Defines the number of bits in the ephemeral protocol version 1 server key.
Darren Tucker7499b0c2008-07-02 22:35:43 +10001064The minimum value is 512, and the default is 1024.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001065.It Cm StrictModes
1066Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001067.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001068should check file modes and ownership of the
1069user's files and home directory before accepting login.
1070This is normally desirable because novices sometimes accidentally leave their
1071directory or files world-writable.
1072The default is
1073.Dq yes .
Darren Tuckerf788a912010-01-08 17:06:47 +11001074Note that this does not apply to
1075.Cm ChrootDirectory ,
1076whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001077.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +11001078Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +10001079Arguments should be a subsystem name and a command (with optional arguments)
1080to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001081.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001082The command
1083.Xr sftp-server 8
1084implements the
1085.Dq sftp
1086file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001087.Pp
1088Alternately the name
1089.Dq internal-sftp
1090implements an in-process
1091.Dq sftp
1092server.
1093This may simplify configurations using
1094.Cm ChrootDirectory
1095to force a different filesystem root on clients.
1096.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001097By default no subsystems are defined.
1098Note that this option applies to protocol version 2 only.
1099.It Cm SyslogFacility
1100Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001101.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001102The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1103LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1104The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001105.It Cm TCPKeepAlive
1106Specifies whether the system should send TCP keepalive messages to the
1107other side.
1108If they are sent, death of the connection or crash of one
1109of the machines will be properly noticed.
1110However, this means that
1111connections will die if the route is down temporarily, and some people
1112find it annoying.
1113On the other hand, if TCP keepalives are not sent,
1114sessions may hang indefinitely on the server, leaving
1115.Dq ghost
1116users and consuming server resources.
1117.Pp
1118The default is
1119.Dq yes
1120(to send TCP keepalive messages), and the server will notice
1121if the network goes down or the client host crashes.
1122This avoids infinitely hanging sessions.
1123.Pp
1124To disable TCP keepalive messages, the value should be set to
1125.Dq no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001126.It Cm TrustedUserCAKeys
1127Specifies a file containing public keys of certificate authorities that are
Damien Millerc6db99e2010-03-05 10:41:45 +11001128trusted to sign user certificates for authentication.
Damien Miller72b33822010-03-05 07:39:01 +11001129Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001130.Ql #
1131are allowed.
1132If a certificate is presented for authentication and has its signing CA key
1133listed in this file, then it may be used for authentication for any user
1134listed in the certificate's principals list.
1135Note that certificates that lack a list of principals will not be permitted
1136for authentication using
1137.Cm TrustedUserCAKeys .
Damien Miller72b33822010-03-05 07:39:01 +11001138For more details on certificates, see the
Damien Miller1aed65e2010-03-04 21:53:35 +11001139.Sx CERTIFICATES
1140section in
1141.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001142.It Cm UseDNS
1143Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001144.Xr sshd 8
Darren Tucker83d5a982005-03-31 21:33:50 +10001145should look up the remote host name and check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001146the resolved host name for the remote IP address maps back to the
1147very same IP address.
1148The default is
1149.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001150.It Cm UseLogin
1151Specifies whether
1152.Xr login 1
1153is used for interactive login sessions.
1154The default is
1155.Dq no .
1156Note that
1157.Xr login 1
1158is never used for remote command execution.
1159Note also, that if this is enabled,
1160.Cm X11Forwarding
1161will be disabled because
1162.Xr login 1
1163does not know how to handle
1164.Xr xauth 1
Damien Miller495dca32003-04-01 21:42:14 +10001165cookies.
1166If
Ben Lindstrom9f049032002-06-21 00:59:05 +00001167.Cm UsePrivilegeSeparation
1168is specified, it will be disabled after authentication.
Damien Miller2e193e22003-05-14 15:13:03 +10001169.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001170Enables the Pluggable Authentication Module interface.
1171If set to
1172.Dq yes
1173this will enable PAM authentication using
1174.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001175and
1176.Cm PasswordAuthentication
1177in addition to PAM account and session module processing for all
1178authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001179.Pp
1180Because PAM challenge-response authentication usually serves an equivalent
1181role to password authentication, you should disable either
1182.Cm PasswordAuthentication
1183or
1184.Cm ChallengeResponseAuthentication.
1185.Pp
1186If
1187.Cm UsePAM
1188is enabled, you will not be able to run
1189.Xr sshd 8
1190as a non-root user.
1191The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +10001192.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001193.It Cm UsePrivilegeSeparation
1194Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001195.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001196separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +10001197to deal with incoming network traffic.
1198After successful authentication, another process will be created that has
1199the privilege of the authenticated user.
1200The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +00001201escalation by containing any corruption within the unprivileged processes.
1202The default is
1203.Dq yes .
Damien Miller69ff1df2011-06-23 08:30:03 +10001204If
1205.Cm UsePrivilegeSeparation
1206is set to
1207.Dq sandbox
1208then the pre-authentication unprivileged process is subject to additional
1209restrictions.
Damien Miller23528812012-04-22 11:24:43 +10001210.It Cm VersionAddendum
1211Optionally specifies additional text to append to the SSH protocol banner
1212sent by the server upon connection.
1213The default is
1214.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001215.It Cm X11DisplayOffset
1216Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001217.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001218X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001219This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001220The default is 10.
1221.It Cm X11Forwarding
1222Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001223The argument must be
1224.Dq yes
1225or
1226.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001227The default is
1228.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +10001229.Pp
1230When X11 forwarding is enabled, there may be additional exposure to
1231the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001232.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001233proxy display is configured to listen on the wildcard address (see
1234.Cm X11UseLocalhost
Damien Miller5b0d63f2006-03-15 11:56:56 +11001235below), though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001236Additionally, the authentication spoofing and authentication data
1237verification and substitution occur on the client side.
1238The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001239display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001240forwarding (see the warnings for
1241.Cm ForwardX11
1242in
Damien Millerf1ce5052003-06-11 22:04:39 +10001243.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001244A system administrator may have a stance in which they want to
1245protect clients that may expose themselves to attack by unwittingly
1246requesting X11 forwarding, which can warrant a
1247.Dq no
1248setting.
1249.Pp
1250Note that disabling X11 forwarding does not prevent users from
1251forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001252X11 forwarding is automatically disabled if
1253.Cm UseLogin
1254is enabled.
1255.It Cm X11UseLocalhost
1256Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001257.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001258should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001259the wildcard address.
1260By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001261sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001262hostname part of the
1263.Ev DISPLAY
1264environment variable to
1265.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001266This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001267However, some older X11 clients may not function with this
1268configuration.
1269.Cm X11UseLocalhost
1270may be set to
1271.Dq no
1272to specify that the forwarding server should be bound to the wildcard
1273address.
1274The argument must be
1275.Dq yes
1276or
1277.Dq no .
1278The default is
1279.Dq yes .
1280.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001281Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001282.Xr xauth 1
1283program.
1284The default is
1285.Pa /usr/X11R6/bin/xauth .
1286.El
Damien Millere3beba22006-03-15 11:59:25 +11001287.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001288.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001289command-line arguments and configuration file options that specify time
1290may be expressed using a sequence of the form:
1291.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001292.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001293.Sm on
1294where
1295.Ar time
1296is a positive integer value and
1297.Ar qualifier
1298is one of the following:
1299.Pp
1300.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001301.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001302seconds
1303.It Cm s | Cm S
1304seconds
1305.It Cm m | Cm M
1306minutes
1307.It Cm h | Cm H
1308hours
1309.It Cm d | Cm D
1310days
1311.It Cm w | Cm W
1312weeks
1313.El
1314.Pp
1315Each member of the sequence is added together to calculate
1316the total time value.
1317.Pp
1318Time format examples:
1319.Pp
1320.Bl -tag -width Ds -compact -offset indent
1321.It 600
1322600 seconds (10 minutes)
1323.It 10m
132410 minutes
1325.It 1h30m
13261 hour 30 minutes (90 minutes)
1327.El
1328.Sh FILES
1329.Bl -tag -width Ds
1330.It Pa /etc/ssh/sshd_config
1331Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001332.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001333This file should be writable by root only, but it is recommended
1334(though not necessary) that it be world-readable.
1335.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001336.Sh SEE ALSO
1337.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001338.Sh AUTHORS
1339OpenSSH is a derivative of the original and free
1340ssh 1.2.12 release by Tatu Ylonen.
1341Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1342Theo de Raadt and Dug Song
1343removed many bugs, re-added newer features and
1344created OpenSSH.
1345Markus Friedl contributed the support for SSH
1346protocol versions 1.5 and 2.0.
1347Niels Provos and Markus Friedl contributed support
1348for privilege separation.