blob: 95dbc1d12865bd5de78c895bea17434c2143b022 [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.\"
jmc@openbsd.orgf41bcd72018-05-15 05:40:11 +000036.\" $OpenBSD: sshd_config.5,v 1.266 2018/05/15 05:40:11 jmc Exp $
37.Dd $Mdocdate: May 15 2018 $
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
Ben Lindstrom9f049032002-06-21 00:59:05 +000043.Sh DESCRIPTION
Damien Millerf4f22b52006-03-15 11:57:25 +110044.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +000045reads configuration data from
46.Pa /etc/ssh/sshd_config
47(or the file specified with
48.Fl f
49on the command line).
50The file contains keyword-argument pairs, one per line.
benno@openbsd.orgcfa46822017-10-09 20:12:51 +000051For each keyword, the first obtained value will be used.
Ben Lindstrom9f049032002-06-21 00:59:05 +000052Lines starting with
53.Ql #
54and empty lines are interpreted as comments.
Damien Miller306d1182006-03-15 12:05:59 +110055Arguments may optionally be enclosed in double quotes
56.Pq \&"
57in order to represent arguments containing spaces.
Ben Lindstrom9f049032002-06-21 00:59:05 +000058.Pp
59The possible
60keywords and their meanings are as follows (note that
61keywords are case-insensitive and arguments are case-sensitive):
62.Bl -tag -width Ds
Darren Tucker46bc0752004-05-02 22:11:30 +100063.It Cm AcceptEnv
64Specifies what environment variables sent by the client will be copied into
65the session's
66.Xr environ 7 .
67See
68.Cm SendEnv
69in
70.Xr ssh_config 5
71for how to configure the client.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +000072The
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +000073.Ev TERM
jmc@openbsd.orgc1d5bcf2015-04-28 13:47:38 +000074environment variable is always sent whenever the client
djm@openbsd.org732d61f2015-06-05 03:44:14 +000075requests a pseudo-terminal as it is required by the protocol.
Darren Tucker46bc0752004-05-02 22:11:30 +100076Variables are specified by name, which may contain the wildcard characters
Damien Miller208f1ed2006-03-15 11:56:03 +110077.Ql *
Darren Tucker46bc0752004-05-02 22:11:30 +100078and
79.Ql \&? .
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100080Multiple environment variables may be separated by whitespace or spread
Darren Tucker46bc0752004-05-02 22:11:30 +100081across multiple
82.Cm AcceptEnv
83directives.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100084Be warned that some environment variables could be used to bypass restricted
Darren Tucker46bc0752004-05-02 22:11:30 +100085user environments.
86For this reason, care should be taken in the use of this directive.
87The default is not to accept any environment variables.
Darren Tucker0f383232005-01-20 10:57:56 +110088.It Cm AddressFamily
89Specifies which address family should be used by
Damien Millerf4f22b52006-03-15 11:57:25 +110090.Xr sshd 8 .
Darren Tucker0f383232005-01-20 10:57:56 +110091Valid arguments are
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +000092.Cm any
93(the default),
94.Cm inet
Damien Miller5b0d63f2006-03-15 11:56:56 +110095(use IPv4 only), or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +000096.Cm inet6
Darren Tucker0f383232005-01-20 10:57:56 +110097(use IPv6 only).
Damien Millere9890192008-05-19 14:59:02 +100098.It Cm AllowAgentForwarding
99Specifies whether
100.Xr ssh-agent 1
101forwarding is permitted.
102The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000103.Cm yes .
Damien Millere9890192008-05-19 14:59:02 +1000104Note that disabling agent forwarding does not improve security
105unless users are also denied shell access, as they can always install
106their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000107.It Cm AllowGroups
108This keyword can be followed by a list of group name patterns, separated
109by spaces.
110If specified, login is allowed only for users whose primary
111group or supplementary group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000112Only group names are valid; a numerical group ID is not recognized.
113By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100114The allow/deny directives are processed in the following order:
115.Cm DenyUsers ,
116.Cm AllowUsers ,
117.Cm DenyGroups ,
118and finally
119.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100120.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000121See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100122.Xr ssh_config 5
123for more information on patterns.
Damien Miller7acefbb2014-07-18 14:11:24 +1000124.It Cm AllowStreamLocalForwarding
125Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
126The available options are
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000127.Cm yes
128(the default)
Damien Miller7acefbb2014-07-18 14:11:24 +1000129or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000130.Cm all
Damien Miller7acefbb2014-07-18 14:11:24 +1000131to allow StreamLocal forwarding,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000132.Cm no
Damien Miller7acefbb2014-07-18 14:11:24 +1000133to prevent all StreamLocal forwarding,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000134.Cm local
Damien Miller7acefbb2014-07-18 14:11:24 +1000135to allow local (from the perspective of
136.Xr ssh 1 )
137forwarding only or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000138.Cm remote
Damien Miller7acefbb2014-07-18 14:11:24 +1000139to allow remote forwarding only.
Damien Miller7acefbb2014-07-18 14:11:24 +1000140Note that disabling StreamLocal forwarding does not improve security unless
141users are also denied shell access, as they can always install their
142own forwarders.
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000143.It Cm AllowTcpForwarding
144Specifies whether TCP forwarding is permitted.
145The available options are
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000146.Cm yes
147(the default)
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000148or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000149.Cm all
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000150to allow TCP forwarding,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000151.Cm no
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000152to prevent all TCP forwarding,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000153.Cm local
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000154to allow local (from the perspective of
155.Xr ssh 1 )
156forwarding only or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000157.Cm remote
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000158to allow remote forwarding only.
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000159Note that disabling TCP forwarding does not improve security unless
160users are also denied shell access, as they can always install their
161own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000162.It Cm AllowUsers
163This keyword can be followed by a list of user name patterns, separated
164by spaces.
Damien Miller5a93add2003-01-24 11:34:52 +1100165If specified, login is allowed only for user names that
Ben Lindstrom9f049032002-06-21 00:59:05 +0000166match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000167Only user names are valid; a numerical user ID is not recognized.
168By default, login is allowed for all users.
169If the pattern takes the form USER@HOST then USER and HOST
170are separately checked, restricting logins to particular
171users from particular hosts.
jmc@openbsd.orgee1e0a12016-04-27 13:53:48 +0000172HOST criteria may additionally contain addresses to match in CIDR
173address/masklen format.
Damien Millerac73e512006-03-15 11:58:49 +1100174The allow/deny directives are processed in the following order:
175.Cm DenyUsers ,
176.Cm AllowUsers ,
177.Cm DenyGroups ,
178and finally
179.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100180.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000181See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100182.Xr ssh_config 5
183for more information on patterns.
Damien Millera6e3f012012-11-04 23:21:40 +1100184.It Cm AuthenticationMethods
185Specifies the authentication methods that must be successfully completed
186for a user to be granted access.
187This option must be followed by one or more comma-separated lists of
djm@openbsd.orgb64faeb2016-06-17 05:03:40 +0000188authentication method names, or by the single string
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000189.Cm any
djm@openbsd.orgb64faeb2016-06-17 05:03:40 +0000190to indicate the default behaviour of accepting any single authentication
jmc@openbsd.orgad23a752016-06-17 06:33:30 +0000191method.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000192If the default is overridden, then successful authentication requires
djm@openbsd.orgb64faeb2016-06-17 05:03:40 +0000193completion of every method in at least one of these lists.
Damien Millera6e3f012012-11-04 23:21:40 +1100194.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000195For example,
196.Qq publickey,password publickey,keyboard-interactive
Damien Millera6e3f012012-11-04 23:21:40 +1100197would require the user to complete public key authentication, followed by
198either password or keyboard interactive authentication.
199Only methods that are next in one or more lists are offered at each stage,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000200so for this example it would not be possible to attempt password or
Damien Millera6e3f012012-11-04 23:21:40 +1100201keyboard-interactive authentication before public key.
202.Pp
Damien Miller91a55f22013-04-23 15:18:10 +1000203For keyboard interactive authentication it is also possible to
204restrict authentication to a specific device by appending a
205colon followed by the device identifier
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000206.Cm bsdauth ,
207.Cm pam ,
Damien Miller91a55f22013-04-23 15:18:10 +1000208or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000209.Cm skey ,
Damien Miller91a55f22013-04-23 15:18:10 +1000210depending on the server configuration.
211For example,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000212.Qq keyboard-interactive:bsdauth
Damien Miller91a55f22013-04-23 15:18:10 +1000213would restrict keyboard interactive authentication to the
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000214.Cm bsdauth
Damien Miller91a55f22013-04-23 15:18:10 +1000215device.
216.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000217If the publickey method is listed more than once,
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000218.Xr sshd 8
219verifies that keys that have been used successfully are not reused for
220subsequent authentications.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000221For example,
222.Qq publickey,publickey
223requires successful authentication using two different public keys.
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000224.Pp
Damien Millera6e3f012012-11-04 23:21:40 +1100225Note that each authentication method listed should also be explicitly enabled
226in the configuration.
djm@openbsd.org8042bad2017-09-01 05:50:48 +0000227.Pp
228The available authentication methods are:
229.Qq gssapi-with-mic ,
230.Qq hostbased ,
231.Qq keyboard-interactive ,
232.Qq none
233(used for access to password-less accounts when
jmc@openbsd.orgf41bcd72018-05-15 05:40:11 +0000234.Cm PermitEmptyPasswords
djm@openbsd.org8042bad2017-09-01 05:50:48 +0000235is enabled),
236.Qq password
237and
238.Qq publickey .
Damien Miller09d3e122012-10-31 08:58:58 +1100239.It Cm AuthorizedKeysCommand
Damien Millerf33580e2012-11-04 22:22:52 +1100240Specifies a program to be used to look up the user's public keys.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000241The program must be owned by root, not writable by group or others and
242specified by an absolute path.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000243Arguments to
244.Cm AuthorizedKeysCommand
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000245accept the tokens described in the
246.Sx TOKENS
247section.
248If no arguments are specified then the username of the target user is used.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000249.Pp
250The program should produce on standard output zero or
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000251more lines of authorized_keys output (see
252.Sx AUTHORIZED_KEYS
253in
Damien Millerf33580e2012-11-04 22:22:52 +1100254.Xr sshd 8 ) .
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000255If a key supplied by
256.Cm AuthorizedKeysCommand
257does not successfully authenticate
Damien Miller09d3e122012-10-31 08:58:58 +1100258and authorize the user then public key authentication continues using the usual
259.Cm AuthorizedKeysFile
260files.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000261By default, no
262.Cm AuthorizedKeysCommand
263is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100264.It Cm AuthorizedKeysCommandUser
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000265Specifies the user under whose account the
266.Cm AuthorizedKeysCommand
267is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100268It is recommended to use a dedicated user that has no other role on the host
269than running authorized keys commands.
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000270If
djm@openbsd.orgd663bea2014-12-11 05:25:06 +0000271.Cm AuthorizedKeysCommand
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000272is specified but
273.Cm AuthorizedKeysCommandUser
274is not, then
275.Xr sshd 8
276will refuse to start.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000277.It Cm AuthorizedKeysFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000278Specifies the file that contains the public keys used for user authentication.
Damien Miller6018a362010-07-02 13:35:19 +1000279The format is described in the
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000280.Sx AUTHORIZED_KEYS FILE FORMAT
Damien Miller6018a362010-07-02 13:35:19 +1000281section of
282.Xr sshd 8 .
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000283Arguments to
Ben Lindstrom9f049032002-06-21 00:59:05 +0000284.Cm AuthorizedKeysFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000285accept the tokens described in the
286.Sx TOKENS
287section.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000288After expansion,
289.Cm AuthorizedKeysFile
290is taken to be an absolute path or one relative to the user's home
291directory.
Damien Millerb9132fc2011-05-29 21:41:40 +1000292Multiple files may be listed, separated by whitespace.
djm@openbsd.org2bca8a42015-09-11 03:13:36 +0000293Alternately this option may be set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000294.Cm none
djm@openbsd.org2bca8a42015-09-11 03:13:36 +0000295to skip checking for user keys in files.
Damien Millerb9132fc2011-05-29 21:41:40 +1000296The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000297.Qq .ssh/authorized_keys .ssh/authorized_keys2 .
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000298.It Cm AuthorizedPrincipalsCommand
299Specifies a program to be used to generate the list of allowed
300certificate principals as per
301.Cm AuthorizedPrincipalsFile .
302The program must be owned by root, not writable by group or others and
303specified by an absolute path.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000304Arguments to
305.Cm AuthorizedPrincipalsCommand
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000306accept the tokens described in the
307.Sx TOKENS
308section.
309If no arguments are specified then the username of the target user is used.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000310.Pp
311The program should produce on standard output zero or
312more lines of
313.Cm AuthorizedPrincipalsFile
314output.
315If either
316.Cm AuthorizedPrincipalsCommand
317or
318.Cm AuthorizedPrincipalsFile
319is specified, then certificates offered by the client for authentication
320must contain a principal that is listed.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000321By default, no
322.Cm AuthorizedPrincipalsCommand
323is run.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000324.It Cm AuthorizedPrincipalsCommandUser
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000325Specifies the user under whose account the
326.Cm AuthorizedPrincipalsCommand
327is run.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000328It is recommended to use a dedicated user that has no other role on the host
329than running authorized principals commands.
330If
331.Cm AuthorizedPrincipalsCommand
332is specified but
333.Cm AuthorizedPrincipalsCommandUser
334is not, then
335.Xr sshd 8
336will refuse to start.
Damien Miller30da3442010-05-10 11:58:03 +1000337.It Cm AuthorizedPrincipalsFile
338Specifies a file that lists principal names that are accepted for
339certificate authentication.
340When using certificates signed by a key listed in
341.Cm TrustedUserCAKeys ,
342this file lists names, one of which must appear in the certificate for it
343to be accepted for authentication.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000344Names are listed one per line preceded by key options (as described in
345.Sx AUTHORIZED_KEYS FILE FORMAT
346in
Damien Millerd59dab82010-07-02 13:37:17 +1000347.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000348Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000349.Ql #
350are ignored.
351.Pp
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000352Arguments to
Damien Miller30da3442010-05-10 11:58:03 +1000353.Cm AuthorizedPrincipalsFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000354accept the tokens described in the
355.Sx TOKENS
356section.
Damien Miller30da3442010-05-10 11:58:03 +1000357After expansion,
358.Cm AuthorizedPrincipalsFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000359is taken to be an absolute path or one relative to the user's home directory.
Damien Miller8fef9eb2012-04-22 11:25:10 +1000360The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000361.Cm none ,
Damien Miller8fef9eb2012-04-22 11:25:10 +1000362i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000363of the user must appear in a certificate's principals list for it to be
364accepted.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000365.Pp
Damien Miller30da3442010-05-10 11:58:03 +1000366Note that
367.Cm AuthorizedPrincipalsFile
368is only used when authentication proceeds using a CA listed in
369.Cm TrustedUserCAKeys
370and is not consulted for certification authorities trusted via
371.Pa ~/.ssh/authorized_keys ,
372though the
373.Cm principals=
374key option offers a similar facility (see
375.Xr sshd 8
376for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000377.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000378The contents of the specified file are sent to the remote user before
379authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000380If the argument is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000381.Cm none
Damien Miller4890e532007-09-17 11:57:38 +1000382then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000383By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000384.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000385Specifies whether challenge-response authentication is allowed (e.g. via
Damien Millere8c9f262014-10-03 09:24:56 +1000386PAM or through authentication styles supported in
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000387.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000388The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000389.Cm yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100390.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100391Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100392.Xr chroot 2
393to after authentication.
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000394At session startup
395.Xr sshd 8
396checks that all components of the pathname are root-owned directories
397which are not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000398After the chroot,
399.Xr sshd 8
400changes the working directory to the user's home directory.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000401Arguments to
402.Cm ChrootDirectory
403accept the tokens described in the
404.Sx TOKENS
405section.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100406.Pp
407The
408.Cm ChrootDirectory
409must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000410user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100411For an interactive session this requires at least a shell, typically
412.Xr sh 1 ,
413and basic
414.Pa /dev
415nodes such as
416.Xr null 4 ,
417.Xr zero 4 ,
418.Xr stdin 4 ,
419.Xr stdout 4 ,
420.Xr stderr 4 ,
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000421and
Damien Millerd8cb1f12008-02-10 22:40:12 +1100422.Xr tty 4
423devices.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000424For file transfer sessions using SFTP
425no additional configuration of the environment is necessary if the in-process
426sftp-server is used,
Damien Miller426117b2014-07-30 12:33:20 +1000427though sessions which use logging may require
Darren Tucker00fcd712009-06-21 17:56:00 +1000428.Pa /dev/log
Damien Miller426117b2014-07-30 12:33:20 +1000429inside the chroot directory on some operating systems (see
Darren Tucker00fcd712009-06-21 17:56:00 +1000430.Xr sftp-server 8
431for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100432.Pp
jmc@openbsd.orga5a3e332015-01-22 21:00:42 +0000433For safety, it is very important that the directory hierarchy be
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000434prevented from modification by other processes on the system (especially
435those outside the jail).
436Misconfiguration can lead to unsafe environments which
437.Xr sshd 8
438cannot detect.
439.Pp
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000440The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000441.Cm none ,
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000442indicating not to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100443.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000444.It Cm Ciphers
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000445Specifies the ciphers allowed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000446Multiple ciphers must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000447If the specified value begins with a
448.Sq +
449character, then the specified ciphers will be appended to the default set
450instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000451If the specified value begins with a
452.Sq -
453character, then the specified ciphers (including wildcards) will be removed
454from the default set instead of replacing them.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000455.Pp
Damien Miller0fde8ac2013-11-21 14:12:23 +1100456The supported ciphers are:
457.Pp
Damien Millerc1621c82014-04-20 13:22:46 +1000458.Bl -item -compact -offset indent
459.It
4603des-cbc
461.It
462aes128-cbc
463.It
464aes192-cbc
465.It
466aes256-cbc
467.It
468aes128-ctr
469.It
470aes192-ctr
471.It
472aes256-ctr
473.It
474aes128-gcm@openssh.com
475.It
476aes256-gcm@openssh.com
477.It
Damien Millerc1621c82014-04-20 13:22:46 +1000478chacha20-poly1305@openssh.com
479.El
Damien Miller0fde8ac2013-11-21 14:12:23 +1100480.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100481The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000482.Bd -literal -offset indent
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000483chacha20-poly1305@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000484aes128-ctr,aes192-ctr,aes256-ctr,
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000485aes128-gcm@openssh.com,aes256-gcm@openssh.com
Ben Lindstrom9f049032002-06-21 00:59:05 +0000486.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100487.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000488The list of available ciphers may also be obtained using
489.Qq ssh -Q cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000490.It Cm ClientAliveCountMax
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000491Sets the number of client alive messages which may be sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100492.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000493receiving any messages back from the client.
494If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100495sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000496It is important to note that the use of client alive messages is very
497different from
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000498.Cm TCPKeepAlive .
Damien Millerfbf486b2003-05-23 18:44:23 +1000499The client alive messages are sent through the encrypted channel
500and therefore will not be spoofable.
501The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100502.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000503is spoofable.
504The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000505server depend on knowing when a connection has become inactive.
506.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000507The default value is 3.
508If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000509.Cm ClientAliveInterval
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000510is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000511.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100512is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000513will be disconnected after approximately 45 seconds.
Damien Miller1594ad52005-05-26 12:12:19 +1000514.It Cm ClientAliveInterval
515Sets a timeout interval in seconds after which if no data has been received
516from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100517.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000518will send a message through the encrypted
519channel to request a response from the client.
520The default
521is 0, indicating that these messages will not be sent to the client.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000522.It Cm Compression
djm@openbsd.org4577ade2016-09-28 20:32:42 +0000523Specifies whether compression is enabled after
Damien Miller9786e6e2005-07-26 21:54:56 +1000524the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000525The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000526.Cm yes ,
527.Cm delayed
djm@openbsd.org4577ade2016-09-28 20:32:42 +0000528(a legacy synonym for
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000529.Cm yes )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000530or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000531.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000532The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000533.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000534.It Cm DenyGroups
535This keyword can be followed by a list of group name patterns, separated
536by spaces.
537Login is disallowed for users whose primary group or supplementary
538group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000539Only group names are valid; a numerical group ID is not recognized.
540By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100541The allow/deny directives are processed in the following order:
542.Cm DenyUsers ,
543.Cm AllowUsers ,
544.Cm DenyGroups ,
545and finally
546.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100547.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000548See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100549.Xr ssh_config 5
550for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000551.It Cm DenyUsers
552This keyword can be followed by a list of user name patterns, separated
553by spaces.
554Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000555Only user names are valid; a numerical user ID is not recognized.
556By default, login is allowed for all users.
557If the pattern takes the form USER@HOST then USER and HOST
558are separately checked, restricting logins to particular
559users from particular hosts.
jmc@openbsd.orgee1e0a12016-04-27 13:53:48 +0000560HOST criteria may additionally contain addresses to match in CIDR
561address/masklen format.
Damien Millerac73e512006-03-15 11:58:49 +1100562The allow/deny directives are processed in the following order:
563.Cm DenyUsers ,
564.Cm AllowUsers ,
565.Cm DenyGroups ,
566and finally
567.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100568.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000569See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100570.Xr ssh_config 5
571for more information on patterns.
djm@openbsd.org7844f352016-11-30 03:00:05 +0000572.It Cm DisableForwarding
573Disables all forwarding features, including X11,
574.Xr ssh-agent 1 ,
575TCP and StreamLocal.
576This option overrides all other forwarding-related options and may
577simplify restricted configurations.
djm@openbsd.org8f574952017-06-24 06:34:38 +0000578.It Cm ExposeAuthInfo
jmc@openbsd.org5fa14072017-09-27 06:45:53 +0000579Writes a temporary file containing a list of authentication methods and
djm@openbsd.org8f574952017-06-24 06:34:38 +0000580public credentials (e.g. keys) used to authenticate the user.
jmc@openbsd.org40962192017-06-24 06:57:04 +0000581The location of the file is exposed to the user session through the
djm@openbsd.orgf17ee612017-06-24 07:08:57 +0000582.Ev SSH_USER_AUTH
jmc@openbsd.org40962192017-06-24 06:57:04 +0000583environment variable.
jmc@openbsd.org5fa14072017-09-27 06:45:53 +0000584The default is
585.Cm no .
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000586.It Cm FingerprintHash
587Specifies the hash algorithm used when logging key fingerprints.
588Valid options are:
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000589.Cm md5
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000590and
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000591.Cm sha256 .
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000592The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000593.Cm sha256 .
Damien Millere2754432006-07-24 14:06:47 +1000594.It Cm ForceCommand
595Forces the execution of the command specified by
596.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100597ignoring any command supplied by the client and
598.Pa ~/.ssh/rc
599if present.
Damien Millere2754432006-07-24 14:06:47 +1000600The command is invoked by using the user's login shell with the -c option.
601This applies to shell, command, or subsystem execution.
602It is most useful inside a
603.Cm Match
604block.
605The command originally supplied by the client is available in the
606.Ev SSH_ORIGINAL_COMMAND
607environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100608Specifying a command of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000609.Cm internal-sftp
610will force the use of an in-process SFTP server that requires no support
Damien Millercdb6e652008-02-10 22:47:24 +1100611files when used with
612.Cm ChrootDirectory .
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000613The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000614.Cm none .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000615.It Cm GatewayPorts
616Specifies whether remote hosts are allowed to connect to ports
617forwarded for the client.
618By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100619.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000620binds remote port forwardings to the loopback address.
621This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000622.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100623can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100624should allow remote port forwardings to bind to non-loopback addresses, thus
625allowing other hosts to connect.
626The argument may be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000627.Cm no
Damien Millerf91ee4c2005-03-01 21:24:33 +1100628to force remote port forwardings to be available to the local host only,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000629.Cm yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100630to force remote port forwardings to bind to the wildcard address, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000631.Cm clientspecified
Damien Millerf91ee4c2005-03-01 21:24:33 +1100632to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000633The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000634.Cm no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000635.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000636Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100637The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000638.Cm no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000639.It Cm GSSAPICleanupCredentials
640Specifies whether to automatically destroy the user's credentials cache
641on logout.
642The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000643.Cm yes .
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000644.It Cm GSSAPIStrictAcceptorCheck
645Determines whether to be strict about the identity of the GSSAPI acceptor
646a client authenticates against.
647If set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000648.Cm yes
649then the client must authenticate against the host
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000650service on the current hostname.
651If set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000652.Cm no
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000653then the client may authenticate against any service key stored in the
654machine's default store.
655This facility is provided to assist with operation on multi homed machines.
656The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000657.Cm yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000658.It Cm HostbasedAcceptedKeyTypes
659Specifies the key types that will be accepted for hostbased authentication
660as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000661Alternately if the specified value begins with a
662.Sq +
663character, then the specified key types will be appended to the default set
664instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000665If the specified value begins with a
666.Sq -
667character, then the specified key types (including wildcards) will be removed
668from the default set instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000669The default for this option is:
670.Bd -literal -offset 3n
671ecdsa-sha2-nistp256-cert-v01@openssh.com,
672ecdsa-sha2-nistp384-cert-v01@openssh.com,
673ecdsa-sha2-nistp521-cert-v01@openssh.com,
674ssh-ed25519-cert-v01@openssh.com,
675ssh-rsa-cert-v01@openssh.com,
676ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +0000677ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000678.Ed
679.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000680The list of available key types may also be obtained using
681.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000682.It Cm HostbasedAuthentication
683Specifies whether rhosts or /etc/hosts.equiv authentication together
684with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100685(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000686The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000687.Cm no .
Damien Millerb594f382006-08-30 11:06:34 +1000688.It Cm HostbasedUsesNameFromPacketOnly
689Specifies whether or not the server will attempt to perform a reverse
690name lookup when matching the name in the
691.Pa ~/.shosts ,
692.Pa ~/.rhosts ,
693and
694.Pa /etc/hosts.equiv
695files during
696.Cm HostbasedAuthentication .
697A setting of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000698.Cm yes
Damien Millerb594f382006-08-30 11:06:34 +1000699means that
700.Xr sshd 8
701uses the name supplied by the client rather than
702attempting to resolve the name from the TCP connection itself.
703The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000704.Cm no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100705.It Cm HostCertificate
706Specifies a file containing a public host certificate.
707The certificate's public key must match a private host key already specified
708by
709.Cm HostKey .
710The default behaviour of
711.Xr sshd 8
712is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000713.It Cm HostKey
714Specifies a file containing a private host key
715used by SSH.
naddy@openbsd.orgffe65492016-08-15 12:32:04 +0000716The defaults are
Damien Miller8ba0ead2013-12-18 17:46:27 +1100717.Pa /etc/ssh/ssh_host_ecdsa_key ,
718.Pa /etc/ssh/ssh_host_ed25519_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000719and
naddy@openbsd.orgffe65492016-08-15 12:32:04 +0000720.Pa /etc/ssh/ssh_host_rsa_key .
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000721.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000722Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100723.Xr sshd 8
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000724will refuse to use a file if it is group/world-accessible
725and that the
726.Cm HostKeyAlgorithms
727option restricts which of the keys are actually used by
728.Xr sshd 8 .
729.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000730It is possible to have multiple host key files.
Damien Miller85b45e02013-07-20 13:21:52 +1000731It is also possible to specify public host key files instead.
732In this case operations on the private key will be delegated
733to an
734.Xr ssh-agent 1 .
735.It Cm HostKeyAgent
736Identifies the UNIX-domain socket used to communicate
737with an agent that has access to the private host keys.
markus@openbsd.org1a75d142016-05-04 14:29:58 +0000738If the string
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000739.Qq SSH_AUTH_SOCK
Damien Miller85b45e02013-07-20 13:21:52 +1000740is specified, the location of the socket will be read from the
741.Ev SSH_AUTH_SOCK
742environment variable.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000743.It Cm HostKeyAlgorithms
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000744Specifies the host key algorithms
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000745that the server offers.
746The default for this option is:
747.Bd -literal -offset 3n
748ecdsa-sha2-nistp256-cert-v01@openssh.com,
749ecdsa-sha2-nistp384-cert-v01@openssh.com,
750ecdsa-sha2-nistp521-cert-v01@openssh.com,
751ssh-ed25519-cert-v01@openssh.com,
752ssh-rsa-cert-v01@openssh.com,
753ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +0000754ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000755.Ed
756.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000757The list of available key types may also be obtained using
758.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000759.It Cm IgnoreRhosts
760Specifies that
761.Pa .rhosts
762and
763.Pa .shosts
764files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000765.Cm HostbasedAuthentication .
766.Pp
767.Pa /etc/hosts.equiv
768and
769.Pa /etc/shosts.equiv
770are still used.
771The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000772.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000773.It Cm IgnoreUserKnownHosts
774Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100775.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000776should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000777.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000778during
djm@openbsd.org62562ce2018-02-10 06:54:38 +0000779.Cm HostbasedAuthentication
780and use only the system-wide known hosts file
781.Pa /etc/ssh/known_hosts .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000782The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000783.Cm no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100784.It Cm IPQoS
785Specifies the IPv4 type-of-service or DSCP class for the connection.
786Accepted values are
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000787.Cm af11 ,
788.Cm af12 ,
789.Cm af13 ,
790.Cm af21 ,
791.Cm af22 ,
792.Cm af23 ,
793.Cm af31 ,
794.Cm af32 ,
795.Cm af33 ,
796.Cm af41 ,
797.Cm af42 ,
798.Cm af43 ,
799.Cm cs0 ,
800.Cm cs1 ,
801.Cm cs2 ,
802.Cm cs3 ,
803.Cm cs4 ,
804.Cm cs5 ,
805.Cm cs6 ,
806.Cm cs7 ,
807.Cm ef ,
808.Cm lowdelay ,
809.Cm throughput ,
810.Cm reliability ,
djm@openbsd.org51676ec2017-07-23 23:37:02 +0000811a numeric value, or
812.Cm none
813to use the operating system default.
Damien Miller928362d2010-12-26 14:26:45 +1100814This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100815If one argument is specified, it is used as the packet class unconditionally.
816If two values are specified, the first is automatically selected for
817interactive sessions and the second for non-interactive sessions.
818The default is
job@openbsd.org5ee84482018-04-04 15:12:17 +0000819.Cm af21
jmc@openbsd.org3e36f282018-04-08 07:36:02 +0000820(Low-Latency Data)
Damien Miller0dac6fb2010-11-20 15:19:38 +1100821for interactive sessions and
job@openbsd.org5ee84482018-04-04 15:12:17 +0000822.Cm cs1
jmc@openbsd.org3e36f282018-04-08 07:36:02 +0000823(Lower Effort)
Damien Miller0dac6fb2010-11-20 15:19:38 +1100824for non-interactive sessions.
Damien Millere1e480a2014-02-04 11:13:17 +1100825.It Cm KbdInteractiveAuthentication
826Specifies whether to allow keyboard-interactive authentication.
827The argument to this keyword must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000828.Cm yes
Damien Millere1e480a2014-02-04 11:13:17 +1100829or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000830.Cm no .
Damien Millere1e480a2014-02-04 11:13:17 +1100831The default is to use whatever value
832.Cm ChallengeResponseAuthentication
833is set to
834(by default
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000835.Cm yes ) .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000836.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000837Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000838.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000839will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000840To use this option, the server needs a
841Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100842The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000843.Cm no .
Damien Miller8448e662004-03-08 23:13:15 +1100844.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000845If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100846an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100847The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000848.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000849.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100850If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000851the password will be validated via any additional local mechanism
852such as
853.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100854The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000855.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000856.It Cm KerberosTicketCleanup
857Specifies whether to automatically destroy the user's ticket cache
858file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100859The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000860.Cm yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000861.It Cm KexAlgorithms
862Specifies the available KEX (Key Exchange) algorithms.
863Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000864Alternately if the specified value begins with a
865.Sq +
866character, then the specified methods will be appended to the default set
867instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000868If the specified value begins with a
869.Sq -
870character, then the specified methods (including wildcards) will be removed
871from the default set instead of replacing them.
Damien Millerc1621c82014-04-20 13:22:46 +1000872The supported algorithms are:
873.Pp
874.Bl -item -compact -offset indent
875.It
djm@openbsd.org16277fc2016-09-22 17:55:13 +0000876curve25519-sha256
877.It
Damien Millerc1621c82014-04-20 13:22:46 +1000878curve25519-sha256@libssh.org
879.It
880diffie-hellman-group1-sha1
881.It
882diffie-hellman-group14-sha1
883.It
djm@openbsd.org680321f2018-02-16 02:40:45 +0000884diffie-hellman-group14-sha256
885.It
886diffie-hellman-group16-sha512
887.It
888diffie-hellman-group18-sha512
889.It
Damien Millerc1621c82014-04-20 13:22:46 +1000890diffie-hellman-group-exchange-sha1
891.It
892diffie-hellman-group-exchange-sha256
893.It
894ecdh-sha2-nistp256
895.It
896ecdh-sha2-nistp384
897.It
898ecdh-sha2-nistp521
899.El
900.Pp
901The default is:
Damien Miller6575c3a2013-12-18 17:47:02 +1100902.Bd -literal -offset indent
djm@openbsd.org16277fc2016-09-22 17:55:13 +0000903curve25519-sha256,curve25519-sha256@libssh.org,
Damien Miller6575c3a2013-12-18 17:47:02 +1100904ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
905diffie-hellman-group-exchange-sha256,
djm@openbsd.org680321f2018-02-16 02:40:45 +0000906diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,
907diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
Damien Miller6575c3a2013-12-18 17:47:02 +1100908.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000909.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000910The list of available key exchange algorithms may also be obtained using
911.Qq ssh -Q kex .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000912.It Cm ListenAddress
913Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100914.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000915should listen on.
916The following forms may be used:
917.Pp
918.Bl -item -offset indent -compact
919.It
920.Cm ListenAddress
921.Sm off
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000922.Ar hostname | address
Ben Lindstrom9f049032002-06-21 00:59:05 +0000923.Sm on
jmc@openbsd.org@openbsd.org68d3bbb2017-10-26 06:44:01 +0000924.Op Cm rdomain Ar domain
Ben Lindstrom9f049032002-06-21 00:59:05 +0000925.It
926.Cm ListenAddress
927.Sm off
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000928.Ar hostname : port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000929.Sm on
jmc@openbsd.org@openbsd.org68d3bbb2017-10-26 06:44:01 +0000930.Op Cm rdomain Ar domain
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000931.It
932.Cm ListenAddress
933.Sm off
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000934.Ar IPv4_address : port
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000935.Sm on
jmc@openbsd.org@openbsd.org68d3bbb2017-10-26 06:44:01 +0000936.Op Cm rdomain Ar domain
Ben Lindstrom9f049032002-06-21 00:59:05 +0000937.It
938.Cm ListenAddress
939.Sm off
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000940.Oo Ar hostname | address Oc : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000941.Sm on
jmc@openbsd.org@openbsd.org68d3bbb2017-10-26 06:44:01 +0000942.Op Cm rdomain Ar domain
Ben Lindstrom9f049032002-06-21 00:59:05 +0000943.El
944.Pp
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000945The optional
946.Cm rdomain
947qualifier requests
948.Xr sshd 8
949listen in an explicit routing domain.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000950If
951.Ar port
952is not specified,
dtucker@openbsd.org531a57a2015-04-29 03:48:56 +0000953sshd will listen on the address and all
Ben Lindstrom9f049032002-06-21 00:59:05 +0000954.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000955options specified.
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000956The default is to listen on all local addresses on the current default
957routing domain.
Damien Miller495dca32003-04-01 21:42:14 +1000958Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000959.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000960options are permitted.
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000961For more information on routing domains, see
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000962.Xr rdomain 4 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000963.It Cm LoginGraceTime
964The server disconnects after this time if the user has not
965successfully logged in.
966If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000967The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000968.It Cm LogLevel
969Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100970.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000971The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100972QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000973The default is INFO.
974DEBUG and DEBUG1 are equivalent.
975DEBUG2 and DEBUG3 each specify higher levels of debugging output.
976Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000977.It Cm MACs
978Specifies the available MAC (message authentication code) algorithms.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000979The MAC algorithm is used for data integrity protection.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000980Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000981If the specified value begins with a
982.Sq +
983character, then the specified algorithms will be appended to the default set
984instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000985If the specified value begins with a
986.Sq -
987character, then the specified algorithms (including wildcards) will be removed
988from the default set instead of replacing them.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000989.Pp
Damien Milleraf43a7a2012-12-12 10:46:31 +1100990The algorithms that contain
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000991.Qq -etm
Damien Milleraf43a7a2012-12-12 10:46:31 +1100992calculate the MAC after encryption (encrypt-then-mac).
993These are considered safer and their use recommended.
Damien Millerc1621c82014-04-20 13:22:46 +1000994The supported MACs are:
995.Pp
996.Bl -item -compact -offset indent
997.It
998hmac-md5
999.It
1000hmac-md5-96
1001.It
Damien Millerc1621c82014-04-20 13:22:46 +10001002hmac-sha1
1003.It
1004hmac-sha1-96
1005.It
1006hmac-sha2-256
1007.It
1008hmac-sha2-512
1009.It
1010umac-64@openssh.com
1011.It
1012umac-128@openssh.com
1013.It
1014hmac-md5-etm@openssh.com
1015.It
1016hmac-md5-96-etm@openssh.com
1017.It
Damien Millerc1621c82014-04-20 13:22:46 +10001018hmac-sha1-etm@openssh.com
1019.It
1020hmac-sha1-96-etm@openssh.com
1021.It
1022hmac-sha2-256-etm@openssh.com
1023.It
1024hmac-sha2-512-etm@openssh.com
1025.It
1026umac-64-etm@openssh.com
1027.It
1028umac-128-etm@openssh.com
1029.El
1030.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +11001031The default is:
Damien Miller22b7b492007-06-11 14:07:12 +10001032.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +11001033umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1034hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001035hmac-sha1-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +10001036umac-64@openssh.com,umac-128@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001037hmac-sha2-256,hmac-sha2-512,hmac-sha1
Damien Miller22b7b492007-06-11 14:07:12 +10001038.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001039.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001040The list of available MAC algorithms may also be obtained using
1041.Qq ssh -Q mac .
Darren Tucker45150472006-07-12 22:34:17 +10001042.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +10001043Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +10001044If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +10001045.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001046line are satisfied, the keywords on the following lines override those
1047set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +10001048.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001049line or the end of the file.
Damien Millerfc5d6752014-02-28 10:01:28 +11001050If a keyword appears in multiple
1051.Cm Match
sobrado@openbsd.org180bcb42014-08-30 16:32:25 +00001052blocks that are satisfied, only the first instance of the keyword is
Damien Millerfc5d6752014-02-28 10:01:28 +11001053applied.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001054.Pp
Damien Millerd04f3572006-07-24 13:46:50 +10001055The arguments to
Darren Tucker45150472006-07-12 22:34:17 +10001056.Cm Match
Damien Millercf31f382013-10-24 21:02:56 +11001057are one or more criteria-pattern pairs or the single token
1058.Cm All
1059which matches all criteria.
Darren Tucker45150472006-07-12 22:34:17 +10001060The available criteria are
1061.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +10001062.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +10001063.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +10001064.Cm LocalAddress ,
1065.Cm LocalPort ,
djm@openbsd.org68af80e2017-10-25 00:19:47 +00001066.Cm RDomain ,
Darren Tucker45150472006-07-12 22:34:17 +10001067and
djm@openbsd.org68af80e2017-10-25 00:19:47 +00001068.Cm Address
1069(with
1070.Cm RDomain
1071representing the
1072.Xr rdomain 4
1073on which the connection was received.)
1074.Pp
Darren Tucker7a3935d2008-06-10 22:59:10 +10001075The match patterns may consist of single entries or comma-separated
1076lists and may use the wildcard and negation operators described in the
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001077.Sx PATTERNS
1078section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +10001079.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001080.Pp
1081The patterns in an
1082.Cm Address
1083criteria may additionally contain addresses to match in CIDR
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001084address/masklen format,
1085such as 192.0.2.0/24 or 2001:db8::/32.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001086Note that the mask length provided must be consistent with the address -
1087it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +10001088or one with bits set in this host portion of the address.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001089For example, 192.0.2.0/33 and 192.0.2.0/8, respectively.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001090.Pp
Darren Tucker45150472006-07-12 22:34:17 +10001091Only a subset of keywords may be used on the lines following a
1092.Cm Match
1093keyword.
1094Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +10001095.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +11001096.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +10001097.Cm AllowGroups ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001098.Cm AllowStreamLocalForwarding ,
Damien Miller9b439df2006-07-24 14:04:00 +10001099.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +10001100.Cm AllowUsers ,
Damien Millera6e3f012012-11-04 23:21:40 +11001101.Cm AuthenticationMethods ,
Damien Miller09d3e122012-10-31 08:58:58 +11001102.Cm AuthorizedKeysCommand ,
1103.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +11001104.Cm AuthorizedKeysFile ,
djm@openbsd.orgb6b91082015-11-13 02:57:46 +00001105.Cm AuthorizedPrincipalsCommand ,
1106.Cm AuthorizedPrincipalsCommandUser ,
Damien Millerab6de352010-06-26 09:38:45 +10001107.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +11001108.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +10001109.Cm ChrootDirectory ,
markus@openbsd.orgf0ddede2016-11-23 23:14:15 +00001110.Cm ClientAliveCountMax ,
1111.Cm ClientAliveInterval ,
Damien Millerc24da772012-06-20 21:53:58 +10001112.Cm DenyGroups ,
1113.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +10001114.Cm ForceCommand ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001115.Cm GatewayPorts ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +00001116.Cm GSSAPIAuthentication ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001117.Cm HostbasedAcceptedKeyTypes ,
Damien Miller25434de2008-05-19 14:29:08 +10001118.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +10001119.Cm HostbasedUsesNameFromPacketOnly ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001120.Cm IPQoS ,
Darren Tucker1d75f222007-03-01 21:31:28 +11001121.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +11001122.Cm KerberosAuthentication ,
djm@openbsd.org54cd41a2017-05-17 01:24:17 +00001123.Cm LogLevel ,
Damien Miller307c1d12008-06-16 07:56:20 +10001124.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +10001125.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +11001126.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +11001127.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +10001128.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +11001129.Cm PermitRootLogin ,
Damien Miller5ff30c62013-10-30 22:21:50 +11001130.Cm PermitTTY ,
Damien Millerab6de352010-06-26 09:38:45 +10001131.Cm PermitTunnel ,
Damien Miller72e6b5c2014-07-04 09:00:04 +10001132.Cm PermitUserRC ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001133.Cm PubkeyAcceptedKeyTypes ,
Darren Tucker1477ea12009-10-07 08:36:05 +11001134.Cm PubkeyAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001135.Cm RekeyLimit ,
1136.Cm RevokedKeys ,
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001137.Cm RDomain ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001138.Cm StreamLocalBindMask ,
1139.Cm StreamLocalBindUnlink ,
1140.Cm TrustedUserCAKeys ,
Damien Millerd1de9952006-07-24 14:05:48 +10001141.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +11001142.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +10001143and
Damien Miller0296ae82009-02-23 11:00:24 +11001144.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +10001145.It Cm MaxAuthTries
1146Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +10001147connection.
1148Once the number of failures reaches half this value,
1149additional failures are logged.
1150The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +10001151.It Cm MaxSessions
djm@openbsd.orgcac3b662016-02-05 02:37:56 +00001152Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1153sessions permitted per network connection.
1154Multiple sessions may be established by clients that support connection
1155multiplexing.
1156Setting
1157.Cm MaxSessions
1158to 1 will effectively disable session multiplexing, whereas setting it to 0
1159will prevent all shell, login and subsystem sessions while still permitting
1160forwarding.
Damien Miller7207f642008-05-19 15:34:50 +10001161The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001162.It Cm MaxStartups
1163Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001164SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001165Additional connections will be dropped until authentication succeeds or the
1166.Cm LoginGraceTime
1167expires for a connection.
Damien Miller1f583df2013-02-12 11:02:08 +11001168The default is 10:30:100.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001169.Pp
1170Alternatively, random early drop can be enabled by specifying
1171the three colon separated values
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001172start:rate:full (e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +11001173.Xr sshd 8
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001174will refuse connection attempts with a probability of rate/100 (30%)
1175if there are currently start (10) unauthenticated connections.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001176The probability increases linearly and all connection attempts
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001177are refused if the number of unauthenticated connections reaches full (60).
Ben Lindstrom9f049032002-06-21 00:59:05 +00001178.It Cm PasswordAuthentication
1179Specifies whether password authentication is allowed.
1180The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001181.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001182.It Cm PermitEmptyPasswords
1183When password authentication is allowed, it specifies whether the
1184server allows login to accounts with empty password strings.
1185The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001186.Cm no .
Damien Miller9b439df2006-07-24 14:04:00 +10001187.It Cm PermitOpen
1188Specifies the destinations to which TCP port forwarding is permitted.
1189The forwarding specification must be one of the following forms:
1190.Pp
1191.Bl -item -offset indent -compact
1192.It
1193.Cm PermitOpen
1194.Sm off
1195.Ar host : port
1196.Sm on
1197.It
1198.Cm PermitOpen
1199.Sm off
1200.Ar IPv4_addr : port
1201.Sm on
1202.It
1203.Cm PermitOpen
1204.Sm off
1205.Ar \&[ IPv6_addr \&] : port
1206.Sm on
1207.El
1208.Pp
Damien Millera765cf42006-07-24 14:08:13 +10001209Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +10001210An argument of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001211.Cm any
Damien Miller9b439df2006-07-24 14:04:00 +10001212can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +10001213An argument of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001214.Cm none
Darren Tuckerba9ea322012-05-19 19:37:33 +10001215can be used to prohibit all forwarding requests.
jmc@openbsd.org32d921c2016-07-19 12:59:16 +00001216The wildcard
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001217.Sq *
jmc@openbsd.org32d921c2016-07-19 12:59:16 +00001218can be used for host or port to allow all hosts or ports, respectively.
Damien Miller65bc2c42006-07-24 14:04:16 +10001219By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001220.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +11001221Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +00001222.Xr ssh 1 .
1223The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001224.Cm yes ,
1225.Cm prohibit-password ,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001226.Cm forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001227or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001228.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001229The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001230.Cm prohibit-password .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001231.Pp
1232If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001233.Cm prohibit-password
jmc@openbsd.org071325f2017-10-13 16:50:45 +00001234(or its deprecated alias,
1235.Cm without-password ) ,
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001236password and keyboard-interactive authentication are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001237.Pp
1238If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001239.Cm forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001240root login with public key authentication will be allowed,
1241but only if the
1242.Ar command
1243option has been specified
1244(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +10001245normally not allowed).
1246All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001247.Pp
1248If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001249.Cm no ,
Darren Tuckerb3509012005-01-20 11:01:46 +11001250root is not allowed to log in.
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +00001251.It Cm PermitTTY
1252Specifies whether
1253.Xr pty 4
1254allocation is permitted.
1255The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001256.Cm yes .
Damien Millerd27b9472005-12-13 19:29:02 +11001257.It Cm PermitTunnel
1258Specifies whether
1259.Xr tun 4
1260device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +11001261The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001262.Cm yes ,
1263.Cm point-to-point
Damien Miller991dba42006-07-10 20:16:27 +10001264(layer 3),
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001265.Cm ethernet
Damien Miller991dba42006-07-10 20:16:27 +10001266(layer 2), or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001267.Cm no .
Damien Miller991dba42006-07-10 20:16:27 +10001268Specifying
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001269.Cm yes
Damien Miller991dba42006-07-10 20:16:27 +10001270permits both
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001271.Cm point-to-point
Damien Miller991dba42006-07-10 20:16:27 +10001272and
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001273.Cm ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +11001274The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001275.Cm no .
djm@openbsd.org48dffd52014-09-09 09:45:36 +00001276.Pp
1277Independent of this setting, the permissions of the selected
1278.Xr tun 4
1279device must allow access to the user.
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001280.It Cm PermitUserEnvironment
1281Specifies whether
1282.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001283and
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001284.Cm environment=
1285options in
1286.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001287are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +11001288.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001289The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001290.Cm no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001291Enabling environment processing may enable users to bypass access
1292restrictions in some configurations using mechanisms such as
1293.Ev LD_PRELOAD .
Damien Miller72e6b5c2014-07-04 09:00:04 +10001294.It Cm PermitUserRC
1295Specifies whether any
1296.Pa ~/.ssh/rc
1297file is executed.
1298The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001299.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001300.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +00001301Specifies the file that contains the process ID of the
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001302SSH daemon, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001303.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001304to not write one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001305The default is
1306.Pa /var/run/sshd.pid .
1307.It Cm Port
1308Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +11001309.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001310listens on.
1311The default is 22.
1312Multiple options of this type are permitted.
1313See also
1314.Cm ListenAddress .
1315.It Cm PrintLastLog
1316Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001317.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +11001318should print the date and time of the last user login when a user logs
1319in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001320The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001321.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001322.It Cm PrintMotd
1323Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001324.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001325should print
1326.Pa /etc/motd
1327when a user logs in interactively.
1328(On some systems it is also printed by the shell,
1329.Pa /etc/profile ,
1330or equivalent.)
1331The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001332.Cm yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001333.It Cm PubkeyAcceptedKeyTypes
1334Specifies the key types that will be accepted for public key authentication
1335as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001336Alternately if the specified value begins with a
1337.Sq +
1338character, then the specified key types will be appended to the default set
1339instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001340If the specified value begins with a
1341.Sq -
1342character, then the specified key types (including wildcards) will be removed
1343from the default set instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001344The default for this option is:
1345.Bd -literal -offset 3n
1346ecdsa-sha2-nistp256-cert-v01@openssh.com,
1347ecdsa-sha2-nistp384-cert-v01@openssh.com,
1348ecdsa-sha2-nistp521-cert-v01@openssh.com,
1349ssh-ed25519-cert-v01@openssh.com,
1350ssh-rsa-cert-v01@openssh.com,
1351ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +00001352ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001353.Ed
1354.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001355The list of available key types may also be obtained using
1356.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001357.It Cm PubkeyAuthentication
1358Specifies whether public key authentication is allowed.
1359The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001360.Cm yes .
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001361.It Cm RekeyLimit
1362Specifies the maximum amount of data that may be transmitted before the
1363session key is renegotiated, optionally followed a maximum amount of
1364time that may pass before the session key is renegotiated.
1365The first argument is specified in bytes and may have a suffix of
1366.Sq K ,
1367.Sq M ,
1368or
1369.Sq G
1370to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1371The default is between
1372.Sq 1G
1373and
1374.Sq 4G ,
1375depending on the cipher.
1376The optional second value is specified in seconds and may use any of the
1377units documented in the
1378.Sx TIME FORMATS
Darren Tucker64d22942013-05-16 20:31:29 +10001379section.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001380The default value for
1381.Cm RekeyLimit
1382is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001383.Cm default none ,
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001384which means that rekeying is performed after the cipher's default amount
1385of data has been sent or received and no time based rekeying is done.
Damien Miller1aed65e2010-03-04 21:53:35 +11001386.It Cm RevokedKeys
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001387Specifies revoked public keys file, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001388.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001389to not use one.
Damien Miller1aed65e2010-03-04 21:53:35 +11001390Keys listed in this file will be refused for public key authentication.
1391Note that if this file is not readable, then public key authentication will
1392be refused for all users.
Damien Millerf3747bf2013-01-18 11:44:04 +11001393Keys may be specified as a text file, listing one public key per line, or as
1394an OpenSSH Key Revocation List (KRL) as generated by
Damien Miller72abeb72013-01-20 22:33:44 +11001395.Xr ssh-keygen 1 .
Damien Millerfecfd112013-07-18 16:11:50 +10001396For more information on KRLs, see the KEY REVOCATION LISTS section in
Damien Millerf3747bf2013-01-18 11:44:04 +11001397.Xr ssh-keygen 1 .
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001398.It Cm RDomain
1399Specifies an explicit routing domain that is applied after authentication
1400has completed.
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +00001401The user session, as well and any forwarded or listening IP sockets,
1402will be bound to this
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001403.Xr rdomain 4 .
1404If the routing domain is set to
1405.Cm \&%D ,
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +00001406then the domain in which the incoming connection was received will be applied.
Damien Miller7acefbb2014-07-18 14:11:24 +10001407.It Cm StreamLocalBindMask
1408Sets the octal file creation mode mask
1409.Pq umask
1410used when creating a Unix-domain socket file for local or remote
1411port forwarding.
1412This option is only used for port forwarding to a Unix-domain socket file.
1413.Pp
1414The default value is 0177, which creates a Unix-domain socket file that is
1415readable and writable only by the owner.
1416Note that not all operating systems honor the file mode on Unix-domain
1417socket files.
1418.It Cm StreamLocalBindUnlink
1419Specifies whether to remove an existing Unix-domain socket file for local
1420or remote port forwarding before creating a new one.
1421If the socket file already exists and
1422.Cm StreamLocalBindUnlink
1423is not enabled,
1424.Nm sshd
1425will be unable to forward the port to the Unix-domain socket file.
1426This option is only used for port forwarding to a Unix-domain socket file.
1427.Pp
1428The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001429.Cm yes
Damien Miller7acefbb2014-07-18 14:11:24 +10001430or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001431.Cm no .
Damien Miller7acefbb2014-07-18 14:11:24 +10001432The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001433.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001434.It Cm StrictModes
1435Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001436.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001437should check file modes and ownership of the
1438user's files and home directory before accepting login.
1439This is normally desirable because novices sometimes accidentally leave their
1440directory or files world-writable.
1441The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001442.Cm yes .
Darren Tuckerf788a912010-01-08 17:06:47 +11001443Note that this does not apply to
1444.Cm ChrootDirectory ,
1445whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001446.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +11001447Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +10001448Arguments should be a subsystem name and a command (with optional arguments)
1449to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001450.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001451The command
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001452.Cm sftp-server
1453implements the SFTP file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001454.Pp
1455Alternately the name
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001456.Cm internal-sftp
1457implements an in-process SFTP server.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001458This may simplify configurations using
1459.Cm ChrootDirectory
1460to force a different filesystem root on clients.
1461.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001462By default no subsystems are defined.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001463.It Cm SyslogFacility
1464Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001465.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001466The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1467LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1468The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001469.It Cm TCPKeepAlive
1470Specifies whether the system should send TCP keepalive messages to the
1471other side.
1472If they are sent, death of the connection or crash of one
1473of the machines will be properly noticed.
1474However, this means that
1475connections will die if the route is down temporarily, and some people
1476find it annoying.
1477On the other hand, if TCP keepalives are not sent,
1478sessions may hang indefinitely on the server, leaving
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001479.Qq ghost
Damien Miller12c150e2003-12-17 16:31:10 +11001480users and consuming server resources.
1481.Pp
1482The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001483.Cm yes
Damien Miller12c150e2003-12-17 16:31:10 +11001484(to send TCP keepalive messages), and the server will notice
1485if the network goes down or the client host crashes.
1486This avoids infinitely hanging sessions.
1487.Pp
1488To disable TCP keepalive messages, the value should be set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001489.Cm no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001490.It Cm TrustedUserCAKeys
1491Specifies a file containing public keys of certificate authorities that are
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001492trusted to sign user certificates for authentication, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001493.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001494to not use one.
Damien Miller72b33822010-03-05 07:39:01 +11001495Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001496.Ql #
1497are allowed.
1498If a certificate is presented for authentication and has its signing CA key
1499listed in this file, then it may be used for authentication for any user
1500listed in the certificate's principals list.
1501Note that certificates that lack a list of principals will not be permitted
1502for authentication using
1503.Cm TrustedUserCAKeys .
Damien Millerfecfd112013-07-18 16:11:50 +10001504For more details on certificates, see the CERTIFICATES section in
Damien Miller1aed65e2010-03-04 21:53:35 +11001505.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001506.It Cm UseDNS
1507Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001508.Xr sshd 8
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001509should look up the remote host name, and to check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001510the resolved host name for the remote IP address maps back to the
1511very same IP address.
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001512.Pp
1513If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001514.Cm no
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001515(the default) then only addresses and not host names may be used in
djm@openbsd.org0235a5f2016-03-17 17:19:43 +00001516.Pa ~/.ssh/authorized_keys
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001517.Cm from
1518and
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +00001519.Nm
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001520.Cm Match
1521.Cm Host
1522directives.
Damien Miller2e193e22003-05-14 15:13:03 +10001523.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001524Enables the Pluggable Authentication Module interface.
1525If set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001526.Cm yes
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001527this will enable PAM authentication using
1528.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001529and
1530.Cm PasswordAuthentication
1531in addition to PAM account and session module processing for all
1532authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001533.Pp
1534Because PAM challenge-response authentication usually serves an equivalent
1535role to password authentication, you should disable either
1536.Cm PasswordAuthentication
1537or
1538.Cm ChallengeResponseAuthentication.
1539.Pp
1540If
1541.Cm UsePAM
1542is enabled, you will not be able to run
1543.Xr sshd 8
1544as a non-root user.
1545The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001546.Cm no .
Damien Miller23528812012-04-22 11:24:43 +10001547.It Cm VersionAddendum
1548Optionally specifies additional text to append to the SSH protocol banner
1549sent by the server upon connection.
1550The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001551.Cm none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001552.It Cm X11DisplayOffset
1553Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001554.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001555X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001556This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001557The default is 10.
1558.It Cm X11Forwarding
1559Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001560The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001561.Cm yes
Damien Miller101c4a72002-09-19 11:51:21 +10001562or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001563.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001564The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001565.Cm no .
Damien Miller101c4a72002-09-19 11:51:21 +10001566.Pp
1567When X11 forwarding is enabled, there may be additional exposure to
1568the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001569.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001570proxy display is configured to listen on the wildcard address (see
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001571.Cm X11UseLocalhost ) ,
1572though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001573Additionally, the authentication spoofing and authentication data
1574verification and substitution occur on the client side.
1575The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001576display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001577forwarding (see the warnings for
1578.Cm ForwardX11
1579in
Damien Millerf1ce5052003-06-11 22:04:39 +10001580.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001581A system administrator may have a stance in which they want to
1582protect clients that may expose themselves to attack by unwittingly
1583requesting X11 forwarding, which can warrant a
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001584.Cm no
Damien Miller101c4a72002-09-19 11:51:21 +10001585setting.
1586.Pp
1587Note that disabling X11 forwarding does not prevent users from
1588forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001589.It Cm X11UseLocalhost
1590Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001591.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001592should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001593the wildcard address.
1594By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001595sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001596hostname part of the
1597.Ev DISPLAY
1598environment variable to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001599.Cm localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001600This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001601However, some older X11 clients may not function with this
1602configuration.
1603.Cm X11UseLocalhost
1604may be set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001605.Cm no
Ben Lindstrom9f049032002-06-21 00:59:05 +00001606to specify that the forwarding server should be bound to the wildcard
1607address.
1608The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001609.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +00001610or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001611.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001612The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001613.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001614.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001615Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001616.Xr xauth 1
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001617program, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001618.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001619to not use one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001620The default is
1621.Pa /usr/X11R6/bin/xauth .
1622.El
Damien Millere3beba22006-03-15 11:59:25 +11001623.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001624.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001625command-line arguments and configuration file options that specify time
1626may be expressed using a sequence of the form:
1627.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001628.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001629.Sm on
1630where
1631.Ar time
1632is a positive integer value and
1633.Ar qualifier
1634is one of the following:
1635.Pp
1636.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001637.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001638seconds
1639.It Cm s | Cm S
1640seconds
1641.It Cm m | Cm M
1642minutes
1643.It Cm h | Cm H
1644hours
1645.It Cm d | Cm D
1646days
1647.It Cm w | Cm W
1648weeks
1649.El
1650.Pp
1651Each member of the sequence is added together to calculate
1652the total time value.
1653.Pp
1654Time format examples:
1655.Pp
1656.Bl -tag -width Ds -compact -offset indent
1657.It 600
1658600 seconds (10 minutes)
1659.It 10m
166010 minutes
1661.It 1h30m
16621 hour 30 minutes (90 minutes)
1663.El
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001664.Sh TOKENS
1665Arguments to some keywords can make use of tokens,
1666which are expanded at runtime:
1667.Pp
1668.Bl -tag -width XXXX -offset indent -compact
1669.It %%
1670A literal
1671.Sq % .
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001672.It \&%D
1673The routing domain in which the incoming connection was received.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001674.It %F
1675The fingerprint of the CA key.
1676.It %f
1677The fingerprint of the key or certificate.
1678.It %h
1679The home directory of the user.
1680.It %i
1681The key ID in the certificate.
1682.It %K
1683The base64-encoded CA key.
1684.It %k
1685The base64-encoded key or certificate for authentication.
1686.It %s
1687The serial number of the certificate.
1688.It \&%T
1689The type of the CA key.
1690.It %t
1691The key or certificate type.
1692.It %u
1693The username.
1694.El
1695.Pp
1696.Cm AuthorizedKeysCommand
jmc@openbsd.orga1187bd2017-01-06 16:28:12 +00001697accepts the tokens %%, %f, %h, %k, %t, and %u.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001698.Pp
1699.Cm AuthorizedKeysFile
1700accepts the tokens %%, %h, and %u.
1701.Pp
1702.Cm AuthorizedPrincipalsCommand
jmc@openbsd.orga1187bd2017-01-06 16:28:12 +00001703accepts the tokens %%, %F, %f, %h, %i, %K, %k, %s, %T, %t, and %u.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001704.Pp
1705.Cm AuthorizedPrincipalsFile
1706accepts the tokens %%, %h, and %u.
1707.Pp
1708.Cm ChrootDirectory
1709accepts the tokens %%, %h, and %u.
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001710.Pp
1711.Cm RoutingDomain
1712accepts the token %D.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001713.Sh FILES
1714.Bl -tag -width Ds
1715.It Pa /etc/ssh/sshd_config
1716Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001717.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001718This file should be writable by root only, but it is recommended
1719(though not necessary) that it be world-readable.
1720.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001721.Sh SEE ALSO
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001722.Xr sftp-server 8 ,
Damien Millerf1ce5052003-06-11 22:04:39 +10001723.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001724.Sh AUTHORS
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001725.An -nosplit
Ben Lindstrom9f049032002-06-21 00:59:05 +00001726OpenSSH is a derivative of the original and free
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001727ssh 1.2.12 release by
1728.An Tatu Ylonen .
1729.An Aaron Campbell , Bob Beck , Markus Friedl , Niels Provos ,
1730.An Theo de Raadt
1731and
1732.An Dug Song
Ben Lindstrom9f049032002-06-21 00:59:05 +00001733removed many bugs, re-added newer features and
1734created OpenSSH.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001735.An Markus Friedl
1736contributed the support for SSH protocol versions 1.5 and 2.0.
1737.An Niels Provos
1738and
1739.An Markus Friedl
1740contributed support for privilege separation.