blob: 14ebafd7bbe8ca8dfc67fc25488c40fcc5f21d61 [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.\"
djm@openbsd.org1678d422018-06-09 03:18:11 +000036.\" $OpenBSD: sshd_config.5,v 1.275 2018/06/09 03:18:11 djm Exp $
djm@openbsd.org7082bb52018-06-09 03:01:12 +000037.Dd $Mdocdate: June 9 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
djm@openbsd.org7082bb52018-06-09 03:01:12 +000069and
70.Cm SetEnv
Darren Tucker46bc0752004-05-02 22:11:30 +100071in
72.Xr ssh_config 5
73for how to configure the client.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +000074The
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +000075.Ev TERM
djm@openbsd.org1678d422018-06-09 03:18:11 +000076environment variable is always accepted whenever the client
djm@openbsd.org732d61f2015-06-05 03:44:14 +000077requests a pseudo-terminal as it is required by the protocol.
Darren Tucker46bc0752004-05-02 22:11:30 +100078Variables are specified by name, which may contain the wildcard characters
Damien Miller208f1ed2006-03-15 11:56:03 +110079.Ql *
Darren Tucker46bc0752004-05-02 22:11:30 +100080and
81.Ql \&? .
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100082Multiple environment variables may be separated by whitespace or spread
Darren Tucker46bc0752004-05-02 22:11:30 +100083across multiple
84.Cm AcceptEnv
85directives.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100086Be warned that some environment variables could be used to bypass restricted
Darren Tucker46bc0752004-05-02 22:11:30 +100087user environments.
88For this reason, care should be taken in the use of this directive.
89The default is not to accept any environment variables.
Darren Tucker0f383232005-01-20 10:57:56 +110090.It Cm AddressFamily
91Specifies which address family should be used by
Damien Millerf4f22b52006-03-15 11:57:25 +110092.Xr sshd 8 .
Darren Tucker0f383232005-01-20 10:57:56 +110093Valid arguments are
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +000094.Cm any
95(the default),
96.Cm inet
Damien Miller5b0d63f2006-03-15 11:56:56 +110097(use IPv4 only), or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +000098.Cm inet6
Darren Tucker0f383232005-01-20 10:57:56 +110099(use IPv6 only).
Damien Millere9890192008-05-19 14:59:02 +1000100.It Cm AllowAgentForwarding
101Specifies whether
102.Xr ssh-agent 1
103forwarding is permitted.
104The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000105.Cm yes .
Damien Millere9890192008-05-19 14:59:02 +1000106Note that disabling agent forwarding does not improve security
107unless users are also denied shell access, as they can always install
108their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000109.It Cm AllowGroups
110This keyword can be followed by a list of group name patterns, separated
111by spaces.
112If specified, login is allowed only for users whose primary
113group or supplementary group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000114Only group names are valid; a numerical group ID is not recognized.
115By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100116The allow/deny directives are processed in the following order:
117.Cm DenyUsers ,
118.Cm AllowUsers ,
119.Cm DenyGroups ,
120and finally
121.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100122.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000123See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100124.Xr ssh_config 5
125for more information on patterns.
Damien Miller7acefbb2014-07-18 14:11:24 +1000126.It Cm AllowStreamLocalForwarding
127Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
128The available options are
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000129.Cm yes
130(the default)
Damien Miller7acefbb2014-07-18 14:11:24 +1000131or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000132.Cm all
Damien Miller7acefbb2014-07-18 14:11:24 +1000133to allow StreamLocal forwarding,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000134.Cm no
Damien Miller7acefbb2014-07-18 14:11:24 +1000135to prevent all StreamLocal forwarding,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000136.Cm local
Damien Miller7acefbb2014-07-18 14:11:24 +1000137to allow local (from the perspective of
138.Xr ssh 1 )
139forwarding only or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000140.Cm remote
Damien Miller7acefbb2014-07-18 14:11:24 +1000141to allow remote forwarding only.
Damien Miller7acefbb2014-07-18 14:11:24 +1000142Note that disabling StreamLocal forwarding does not improve security unless
143users are also denied shell access, as they can always install their
144own forwarders.
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000145.It Cm AllowTcpForwarding
146Specifies whether TCP forwarding is permitted.
147The available options are
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000148.Cm yes
149(the default)
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000150or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000151.Cm all
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000152to allow TCP forwarding,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000153.Cm no
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000154to prevent all TCP forwarding,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000155.Cm local
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000156to allow local (from the perspective of
157.Xr ssh 1 )
158forwarding only or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000159.Cm remote
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000160to allow remote forwarding only.
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000161Note that disabling TCP forwarding does not improve security unless
162users are also denied shell access, as they can always install their
163own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000164.It Cm AllowUsers
165This keyword can be followed by a list of user name patterns, separated
166by spaces.
Damien Miller5a93add2003-01-24 11:34:52 +1100167If specified, login is allowed only for user names that
Ben Lindstrom9f049032002-06-21 00:59:05 +0000168match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000169Only user names are valid; a numerical user ID is not recognized.
170By default, login is allowed for all users.
171If the pattern takes the form USER@HOST then USER and HOST
172are separately checked, restricting logins to particular
173users from particular hosts.
jmc@openbsd.orgee1e0a12016-04-27 13:53:48 +0000174HOST criteria may additionally contain addresses to match in CIDR
175address/masklen format.
Damien Millerac73e512006-03-15 11:58:49 +1100176The allow/deny directives are processed in the following order:
177.Cm DenyUsers ,
178.Cm AllowUsers ,
179.Cm DenyGroups ,
180and finally
181.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100182.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000183See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100184.Xr ssh_config 5
185for more information on patterns.
Damien Millera6e3f012012-11-04 23:21:40 +1100186.It Cm AuthenticationMethods
187Specifies the authentication methods that must be successfully completed
188for a user to be granted access.
189This option must be followed by one or more comma-separated lists of
djm@openbsd.orgb64faeb2016-06-17 05:03:40 +0000190authentication method names, or by the single string
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000191.Cm any
djm@openbsd.orgb64faeb2016-06-17 05:03:40 +0000192to indicate the default behaviour of accepting any single authentication
jmc@openbsd.orgad23a752016-06-17 06:33:30 +0000193method.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000194If the default is overridden, then successful authentication requires
djm@openbsd.orgb64faeb2016-06-17 05:03:40 +0000195completion of every method in at least one of these lists.
Damien Millera6e3f012012-11-04 23:21:40 +1100196.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000197For example,
198.Qq publickey,password publickey,keyboard-interactive
Damien Millera6e3f012012-11-04 23:21:40 +1100199would require the user to complete public key authentication, followed by
200either password or keyboard interactive authentication.
201Only methods that are next in one or more lists are offered at each stage,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000202so for this example it would not be possible to attempt password or
Damien Millera6e3f012012-11-04 23:21:40 +1100203keyboard-interactive authentication before public key.
204.Pp
Damien Miller91a55f22013-04-23 15:18:10 +1000205For keyboard interactive authentication it is also possible to
206restrict authentication to a specific device by appending a
207colon followed by the device identifier
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000208.Cm bsdauth ,
209.Cm pam ,
Damien Miller91a55f22013-04-23 15:18:10 +1000210or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000211.Cm skey ,
Damien Miller91a55f22013-04-23 15:18:10 +1000212depending on the server configuration.
213For example,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000214.Qq keyboard-interactive:bsdauth
Damien Miller91a55f22013-04-23 15:18:10 +1000215would restrict keyboard interactive authentication to the
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000216.Cm bsdauth
Damien Miller91a55f22013-04-23 15:18:10 +1000217device.
218.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000219If the publickey method is listed more than once,
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000220.Xr sshd 8
221verifies that keys that have been used successfully are not reused for
222subsequent authentications.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000223For example,
224.Qq publickey,publickey
225requires successful authentication using two different public keys.
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000226.Pp
Damien Millera6e3f012012-11-04 23:21:40 +1100227Note that each authentication method listed should also be explicitly enabled
228in the configuration.
djm@openbsd.org8042bad2017-09-01 05:50:48 +0000229.Pp
230The available authentication methods are:
231.Qq gssapi-with-mic ,
232.Qq hostbased ,
233.Qq keyboard-interactive ,
234.Qq none
235(used for access to password-less accounts when
jmc@openbsd.orgf41bcd72018-05-15 05:40:11 +0000236.Cm PermitEmptyPasswords
djm@openbsd.org8042bad2017-09-01 05:50:48 +0000237is enabled),
238.Qq password
239and
240.Qq publickey .
Damien Miller09d3e122012-10-31 08:58:58 +1100241.It Cm AuthorizedKeysCommand
Damien Millerf33580e2012-11-04 22:22:52 +1100242Specifies a program to be used to look up the user's public keys.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000243The program must be owned by root, not writable by group or others and
244specified by an absolute path.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000245Arguments to
246.Cm AuthorizedKeysCommand
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000247accept the tokens described in the
248.Sx TOKENS
249section.
250If no arguments are specified then the username of the target user is used.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000251.Pp
252The program should produce on standard output zero or
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000253more lines of authorized_keys output (see
254.Sx AUTHORIZED_KEYS
255in
Damien Millerf33580e2012-11-04 22:22:52 +1100256.Xr sshd 8 ) .
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000257If a key supplied by
258.Cm AuthorizedKeysCommand
259does not successfully authenticate
Damien Miller09d3e122012-10-31 08:58:58 +1100260and authorize the user then public key authentication continues using the usual
261.Cm AuthorizedKeysFile
262files.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000263By default, no
264.Cm AuthorizedKeysCommand
265is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100266.It Cm AuthorizedKeysCommandUser
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000267Specifies the user under whose account the
268.Cm AuthorizedKeysCommand
269is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100270It is recommended to use a dedicated user that has no other role on the host
271than running authorized keys commands.
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000272If
djm@openbsd.orgd663bea2014-12-11 05:25:06 +0000273.Cm AuthorizedKeysCommand
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000274is specified but
275.Cm AuthorizedKeysCommandUser
276is not, then
277.Xr sshd 8
278will refuse to start.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000279.It Cm AuthorizedKeysFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000280Specifies the file that contains the public keys used for user authentication.
Damien Miller6018a362010-07-02 13:35:19 +1000281The format is described in the
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000282.Sx AUTHORIZED_KEYS FILE FORMAT
Damien Miller6018a362010-07-02 13:35:19 +1000283section of
284.Xr sshd 8 .
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000285Arguments to
Ben Lindstrom9f049032002-06-21 00:59:05 +0000286.Cm AuthorizedKeysFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000287accept the tokens described in the
288.Sx TOKENS
289section.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000290After expansion,
291.Cm AuthorizedKeysFile
292is taken to be an absolute path or one relative to the user's home
293directory.
Damien Millerb9132fc2011-05-29 21:41:40 +1000294Multiple files may be listed, separated by whitespace.
djm@openbsd.org2bca8a42015-09-11 03:13:36 +0000295Alternately this option may be set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000296.Cm none
djm@openbsd.org2bca8a42015-09-11 03:13:36 +0000297to skip checking for user keys in files.
Damien Millerb9132fc2011-05-29 21:41:40 +1000298The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000299.Qq .ssh/authorized_keys .ssh/authorized_keys2 .
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000300.It Cm AuthorizedPrincipalsCommand
301Specifies a program to be used to generate the list of allowed
302certificate principals as per
303.Cm AuthorizedPrincipalsFile .
304The program must be owned by root, not writable by group or others and
305specified by an absolute path.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000306Arguments to
307.Cm AuthorizedPrincipalsCommand
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000308accept the tokens described in the
309.Sx TOKENS
310section.
311If no arguments are specified then the username of the target user is used.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000312.Pp
313The program should produce on standard output zero or
314more lines of
315.Cm AuthorizedPrincipalsFile
316output.
317If either
318.Cm AuthorizedPrincipalsCommand
319or
320.Cm AuthorizedPrincipalsFile
321is specified, then certificates offered by the client for authentication
322must contain a principal that is listed.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000323By default, no
324.Cm AuthorizedPrincipalsCommand
325is run.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000326.It Cm AuthorizedPrincipalsCommandUser
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000327Specifies the user under whose account the
328.Cm AuthorizedPrincipalsCommand
329is run.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000330It is recommended to use a dedicated user that has no other role on the host
331than running authorized principals commands.
332If
333.Cm AuthorizedPrincipalsCommand
334is specified but
335.Cm AuthorizedPrincipalsCommandUser
336is not, then
337.Xr sshd 8
338will refuse to start.
Damien Miller30da3442010-05-10 11:58:03 +1000339.It Cm AuthorizedPrincipalsFile
340Specifies a file that lists principal names that are accepted for
341certificate authentication.
342When using certificates signed by a key listed in
343.Cm TrustedUserCAKeys ,
344this file lists names, one of which must appear in the certificate for it
345to be accepted for authentication.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000346Names are listed one per line preceded by key options (as described in
347.Sx AUTHORIZED_KEYS FILE FORMAT
348in
Damien Millerd59dab82010-07-02 13:37:17 +1000349.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000350Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000351.Ql #
352are ignored.
353.Pp
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000354Arguments to
Damien Miller30da3442010-05-10 11:58:03 +1000355.Cm AuthorizedPrincipalsFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000356accept the tokens described in the
357.Sx TOKENS
358section.
Damien Miller30da3442010-05-10 11:58:03 +1000359After expansion,
360.Cm AuthorizedPrincipalsFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000361is taken to be an absolute path or one relative to the user's home directory.
Damien Miller8fef9eb2012-04-22 11:25:10 +1000362The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000363.Cm none ,
Damien Miller8fef9eb2012-04-22 11:25:10 +1000364i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000365of the user must appear in a certificate's principals list for it to be
366accepted.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000367.Pp
Damien Miller30da3442010-05-10 11:58:03 +1000368Note that
369.Cm AuthorizedPrincipalsFile
370is only used when authentication proceeds using a CA listed in
371.Cm TrustedUserCAKeys
372and is not consulted for certification authorities trusted via
373.Pa ~/.ssh/authorized_keys ,
374though the
375.Cm principals=
376key option offers a similar facility (see
377.Xr sshd 8
378for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000379.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000380The contents of the specified file are sent to the remote user before
381authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000382If the argument is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000383.Cm none
Damien Miller4890e532007-09-17 11:57:38 +1000384then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000385By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000386.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000387Specifies whether challenge-response authentication is allowed (e.g. via
Damien Millere8c9f262014-10-03 09:24:56 +1000388PAM or through authentication styles supported in
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000389.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000390The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000391.Cm yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100392.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100393Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100394.Xr chroot 2
395to after authentication.
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000396At session startup
397.Xr sshd 8
398checks that all components of the pathname are root-owned directories
399which are not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000400After the chroot,
401.Xr sshd 8
402changes the working directory to the user's home directory.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000403Arguments to
404.Cm ChrootDirectory
405accept the tokens described in the
406.Sx TOKENS
407section.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100408.Pp
409The
410.Cm ChrootDirectory
411must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000412user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100413For an interactive session this requires at least a shell, typically
414.Xr sh 1 ,
415and basic
416.Pa /dev
417nodes such as
418.Xr null 4 ,
419.Xr zero 4 ,
420.Xr stdin 4 ,
421.Xr stdout 4 ,
422.Xr stderr 4 ,
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000423and
Damien Millerd8cb1f12008-02-10 22:40:12 +1100424.Xr tty 4
425devices.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000426For file transfer sessions using SFTP
427no additional configuration of the environment is necessary if the in-process
428sftp-server is used,
Damien Miller426117b2014-07-30 12:33:20 +1000429though sessions which use logging may require
Darren Tucker00fcd712009-06-21 17:56:00 +1000430.Pa /dev/log
Damien Miller426117b2014-07-30 12:33:20 +1000431inside the chroot directory on some operating systems (see
Darren Tucker00fcd712009-06-21 17:56:00 +1000432.Xr sftp-server 8
433for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100434.Pp
jmc@openbsd.orga5a3e332015-01-22 21:00:42 +0000435For safety, it is very important that the directory hierarchy be
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000436prevented from modification by other processes on the system (especially
437those outside the jail).
438Misconfiguration can lead to unsafe environments which
439.Xr sshd 8
440cannot detect.
441.Pp
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000442The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000443.Cm none ,
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000444indicating not to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100445.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000446.It Cm Ciphers
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000447Specifies the ciphers allowed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000448Multiple ciphers must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000449If the specified value begins with a
450.Sq +
451character, then the specified ciphers will be appended to the default set
452instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000453If the specified value begins with a
454.Sq -
455character, then the specified ciphers (including wildcards) will be removed
456from the default set instead of replacing them.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000457.Pp
Damien Miller0fde8ac2013-11-21 14:12:23 +1100458The supported ciphers are:
459.Pp
Damien Millerc1621c82014-04-20 13:22:46 +1000460.Bl -item -compact -offset indent
461.It
4623des-cbc
463.It
464aes128-cbc
465.It
466aes192-cbc
467.It
468aes256-cbc
469.It
470aes128-ctr
471.It
472aes192-ctr
473.It
474aes256-ctr
475.It
476aes128-gcm@openssh.com
477.It
478aes256-gcm@openssh.com
479.It
Damien Millerc1621c82014-04-20 13:22:46 +1000480chacha20-poly1305@openssh.com
481.El
Damien Miller0fde8ac2013-11-21 14:12:23 +1100482.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100483The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000484.Bd -literal -offset indent
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000485chacha20-poly1305@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000486aes128-ctr,aes192-ctr,aes256-ctr,
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000487aes128-gcm@openssh.com,aes256-gcm@openssh.com
Ben Lindstrom9f049032002-06-21 00:59:05 +0000488.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100489.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000490The list of available ciphers may also be obtained using
491.Qq ssh -Q cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000492.It Cm ClientAliveCountMax
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000493Sets the number of client alive messages which may be sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100494.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000495receiving any messages back from the client.
496If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100497sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000498It is important to note that the use of client alive messages is very
499different from
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000500.Cm TCPKeepAlive .
Damien Millerfbf486b2003-05-23 18:44:23 +1000501The client alive messages are sent through the encrypted channel
502and therefore will not be spoofable.
503The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100504.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000505is spoofable.
506The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000507server depend on knowing when a connection has become inactive.
508.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000509The default value is 3.
510If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000511.Cm ClientAliveInterval
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000512is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000513.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100514is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000515will be disconnected after approximately 45 seconds.
Damien Miller1594ad52005-05-26 12:12:19 +1000516.It Cm ClientAliveInterval
517Sets a timeout interval in seconds after which if no data has been received
518from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100519.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000520will send a message through the encrypted
521channel to request a response from the client.
522The default
523is 0, indicating that these messages will not be sent to the client.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000524.It Cm Compression
djm@openbsd.org4577ade2016-09-28 20:32:42 +0000525Specifies whether compression is enabled after
Damien Miller9786e6e2005-07-26 21:54:56 +1000526the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000527The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000528.Cm yes ,
529.Cm delayed
djm@openbsd.org4577ade2016-09-28 20:32:42 +0000530(a legacy synonym for
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000531.Cm yes )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000532or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000533.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000534The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000535.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000536.It Cm DenyGroups
537This keyword can be followed by a list of group name patterns, separated
538by spaces.
539Login is disallowed for users whose primary group or supplementary
540group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000541Only group names are valid; a numerical group ID is not recognized.
542By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100543The allow/deny directives are processed in the following order:
544.Cm DenyUsers ,
545.Cm AllowUsers ,
546.Cm DenyGroups ,
547and finally
548.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100549.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000550See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100551.Xr ssh_config 5
552for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000553.It Cm DenyUsers
554This keyword can be followed by a list of user name patterns, separated
555by spaces.
556Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000557Only user names are valid; a numerical user ID is not recognized.
558By default, login is allowed for all users.
559If the pattern takes the form USER@HOST then USER and HOST
560are separately checked, restricting logins to particular
561users from particular hosts.
jmc@openbsd.orgee1e0a12016-04-27 13:53:48 +0000562HOST criteria may additionally contain addresses to match in CIDR
563address/masklen format.
Damien Millerac73e512006-03-15 11:58:49 +1100564The allow/deny directives are processed in the following order:
565.Cm DenyUsers ,
566.Cm AllowUsers ,
567.Cm DenyGroups ,
568and finally
569.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100570.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000571See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100572.Xr ssh_config 5
573for more information on patterns.
djm@openbsd.org7844f352016-11-30 03:00:05 +0000574.It Cm DisableForwarding
575Disables all forwarding features, including X11,
576.Xr ssh-agent 1 ,
577TCP and StreamLocal.
578This option overrides all other forwarding-related options and may
579simplify restricted configurations.
djm@openbsd.org8f574952017-06-24 06:34:38 +0000580.It Cm ExposeAuthInfo
jmc@openbsd.org5fa14072017-09-27 06:45:53 +0000581Writes a temporary file containing a list of authentication methods and
djm@openbsd.org8f574952017-06-24 06:34:38 +0000582public credentials (e.g. keys) used to authenticate the user.
jmc@openbsd.org40962192017-06-24 06:57:04 +0000583The location of the file is exposed to the user session through the
djm@openbsd.orgf17ee612017-06-24 07:08:57 +0000584.Ev SSH_USER_AUTH
jmc@openbsd.org40962192017-06-24 06:57:04 +0000585environment variable.
jmc@openbsd.org5fa14072017-09-27 06:45:53 +0000586The default is
587.Cm no .
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000588.It Cm FingerprintHash
589Specifies the hash algorithm used when logging key fingerprints.
590Valid options are:
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000591.Cm md5
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000592and
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000593.Cm sha256 .
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000594The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000595.Cm sha256 .
Damien Millere2754432006-07-24 14:06:47 +1000596.It Cm ForceCommand
597Forces the execution of the command specified by
598.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100599ignoring any command supplied by the client and
600.Pa ~/.ssh/rc
601if present.
Damien Millere2754432006-07-24 14:06:47 +1000602The command is invoked by using the user's login shell with the -c option.
603This applies to shell, command, or subsystem execution.
604It is most useful inside a
605.Cm Match
606block.
607The command originally supplied by the client is available in the
608.Ev SSH_ORIGINAL_COMMAND
609environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100610Specifying a command of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000611.Cm internal-sftp
612will force the use of an in-process SFTP server that requires no support
Damien Millercdb6e652008-02-10 22:47:24 +1100613files when used with
614.Cm ChrootDirectory .
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000615The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000616.Cm none .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000617.It Cm GatewayPorts
618Specifies whether remote hosts are allowed to connect to ports
619forwarded for the client.
620By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100621.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000622binds remote port forwardings to the loopback address.
623This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000624.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100625can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100626should allow remote port forwardings to bind to non-loopback addresses, thus
627allowing other hosts to connect.
628The argument may be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000629.Cm no
Damien Millerf91ee4c2005-03-01 21:24:33 +1100630to force remote port forwardings to be available to the local host only,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000631.Cm yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100632to force remote port forwardings to bind to the wildcard address, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000633.Cm clientspecified
Damien Millerf91ee4c2005-03-01 21:24:33 +1100634to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000635The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000636.Cm no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000637.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000638Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100639The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000640.Cm no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000641.It Cm GSSAPICleanupCredentials
642Specifies whether to automatically destroy the user's credentials cache
643on logout.
644The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000645.Cm yes .
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000646.It Cm GSSAPIStrictAcceptorCheck
647Determines whether to be strict about the identity of the GSSAPI acceptor
648a client authenticates against.
649If set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000650.Cm yes
651then the client must authenticate against the host
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000652service on the current hostname.
653If set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000654.Cm no
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000655then the client may authenticate against any service key stored in the
656machine's default store.
657This facility is provided to assist with operation on multi homed machines.
658The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000659.Cm yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000660.It Cm HostbasedAcceptedKeyTypes
661Specifies the key types that will be accepted for hostbased authentication
662as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000663Alternately if the specified value begins with a
664.Sq +
665character, then the specified key types will be appended to the default set
666instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000667If the specified value begins with a
668.Sq -
669character, then the specified key types (including wildcards) will be removed
670from the default set instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000671The default for this option is:
672.Bd -literal -offset 3n
673ecdsa-sha2-nistp256-cert-v01@openssh.com,
674ecdsa-sha2-nistp384-cert-v01@openssh.com,
675ecdsa-sha2-nistp521-cert-v01@openssh.com,
676ssh-ed25519-cert-v01@openssh.com,
677ssh-rsa-cert-v01@openssh.com,
678ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +0000679ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000680.Ed
681.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000682The list of available key types may also be obtained using
683.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000684.It Cm HostbasedAuthentication
685Specifies whether rhosts or /etc/hosts.equiv authentication together
686with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100687(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000688The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000689.Cm no .
Damien Millerb594f382006-08-30 11:06:34 +1000690.It Cm HostbasedUsesNameFromPacketOnly
691Specifies whether or not the server will attempt to perform a reverse
692name lookup when matching the name in the
693.Pa ~/.shosts ,
694.Pa ~/.rhosts ,
695and
696.Pa /etc/hosts.equiv
697files during
698.Cm HostbasedAuthentication .
699A setting of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000700.Cm yes
Damien Millerb594f382006-08-30 11:06:34 +1000701means that
702.Xr sshd 8
703uses the name supplied by the client rather than
704attempting to resolve the name from the TCP connection itself.
705The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000706.Cm no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100707.It Cm HostCertificate
708Specifies a file containing a public host certificate.
709The certificate's public key must match a private host key already specified
710by
711.Cm HostKey .
712The default behaviour of
713.Xr sshd 8
714is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000715.It Cm HostKey
716Specifies a file containing a private host key
717used by SSH.
naddy@openbsd.orgffe65492016-08-15 12:32:04 +0000718The defaults are
Damien Miller8ba0ead2013-12-18 17:46:27 +1100719.Pa /etc/ssh/ssh_host_ecdsa_key ,
720.Pa /etc/ssh/ssh_host_ed25519_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000721and
naddy@openbsd.orgffe65492016-08-15 12:32:04 +0000722.Pa /etc/ssh/ssh_host_rsa_key .
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000723.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000724Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100725.Xr sshd 8
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000726will refuse to use a file if it is group/world-accessible
727and that the
728.Cm HostKeyAlgorithms
729option restricts which of the keys are actually used by
730.Xr sshd 8 .
731.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000732It is possible to have multiple host key files.
Damien Miller85b45e02013-07-20 13:21:52 +1000733It is also possible to specify public host key files instead.
734In this case operations on the private key will be delegated
735to an
736.Xr ssh-agent 1 .
737.It Cm HostKeyAgent
738Identifies the UNIX-domain socket used to communicate
739with an agent that has access to the private host keys.
markus@openbsd.org1a75d142016-05-04 14:29:58 +0000740If the string
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000741.Qq SSH_AUTH_SOCK
Damien Miller85b45e02013-07-20 13:21:52 +1000742is specified, the location of the socket will be read from the
743.Ev SSH_AUTH_SOCK
744environment variable.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000745.It Cm HostKeyAlgorithms
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000746Specifies the host key algorithms
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000747that the server offers.
748The default for this option is:
749.Bd -literal -offset 3n
750ecdsa-sha2-nistp256-cert-v01@openssh.com,
751ecdsa-sha2-nistp384-cert-v01@openssh.com,
752ecdsa-sha2-nistp521-cert-v01@openssh.com,
753ssh-ed25519-cert-v01@openssh.com,
754ssh-rsa-cert-v01@openssh.com,
755ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +0000756ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000757.Ed
758.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000759The list of available key types may also be obtained using
760.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000761.It Cm IgnoreRhosts
762Specifies that
763.Pa .rhosts
764and
765.Pa .shosts
766files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000767.Cm HostbasedAuthentication .
768.Pp
769.Pa /etc/hosts.equiv
770and
771.Pa /etc/shosts.equiv
772are still used.
773The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000774.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000775.It Cm IgnoreUserKnownHosts
776Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100777.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000778should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000779.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000780during
djm@openbsd.org62562ce2018-02-10 06:54:38 +0000781.Cm HostbasedAuthentication
782and use only the system-wide known hosts file
783.Pa /etc/ssh/known_hosts .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000784The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000785.Cm no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100786.It Cm IPQoS
787Specifies the IPv4 type-of-service or DSCP class for the connection.
788Accepted values are
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000789.Cm af11 ,
790.Cm af12 ,
791.Cm af13 ,
792.Cm af21 ,
793.Cm af22 ,
794.Cm af23 ,
795.Cm af31 ,
796.Cm af32 ,
797.Cm af33 ,
798.Cm af41 ,
799.Cm af42 ,
800.Cm af43 ,
801.Cm cs0 ,
802.Cm cs1 ,
803.Cm cs2 ,
804.Cm cs3 ,
805.Cm cs4 ,
806.Cm cs5 ,
807.Cm cs6 ,
808.Cm cs7 ,
809.Cm ef ,
810.Cm lowdelay ,
811.Cm throughput ,
812.Cm reliability ,
djm@openbsd.org51676ec2017-07-23 23:37:02 +0000813a numeric value, or
814.Cm none
815to use the operating system default.
Damien Miller928362d2010-12-26 14:26:45 +1100816This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100817If one argument is specified, it is used as the packet class unconditionally.
818If two values are specified, the first is automatically selected for
819interactive sessions and the second for non-interactive sessions.
820The default is
job@openbsd.org5ee84482018-04-04 15:12:17 +0000821.Cm af21
jmc@openbsd.org3e36f282018-04-08 07:36:02 +0000822(Low-Latency Data)
Damien Miller0dac6fb2010-11-20 15:19:38 +1100823for interactive sessions and
job@openbsd.org5ee84482018-04-04 15:12:17 +0000824.Cm cs1
jmc@openbsd.org3e36f282018-04-08 07:36:02 +0000825(Lower Effort)
Damien Miller0dac6fb2010-11-20 15:19:38 +1100826for non-interactive sessions.
Damien Millere1e480a2014-02-04 11:13:17 +1100827.It Cm KbdInteractiveAuthentication
828Specifies whether to allow keyboard-interactive authentication.
829The argument to this keyword must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000830.Cm yes
Damien Millere1e480a2014-02-04 11:13:17 +1100831or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000832.Cm no .
Damien Millere1e480a2014-02-04 11:13:17 +1100833The default is to use whatever value
834.Cm ChallengeResponseAuthentication
835is set to
836(by default
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000837.Cm yes ) .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000838.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000839Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000840.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000841will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000842To use this option, the server needs a
843Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100844The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000845.Cm no .
Damien Miller8448e662004-03-08 23:13:15 +1100846.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000847If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100848an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100849The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000850.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000851.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100852If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000853the password will be validated via any additional local mechanism
854such as
855.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100856The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000857.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000858.It Cm KerberosTicketCleanup
859Specifies whether to automatically destroy the user's ticket cache
860file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100861The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000862.Cm yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000863.It Cm KexAlgorithms
864Specifies the available KEX (Key Exchange) algorithms.
865Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000866Alternately if the specified value begins with a
867.Sq +
868character, then the specified methods will be appended to the default set
869instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000870If the specified value begins with a
871.Sq -
872character, then the specified methods (including wildcards) will be removed
873from the default set instead of replacing them.
Damien Millerc1621c82014-04-20 13:22:46 +1000874The supported algorithms are:
875.Pp
876.Bl -item -compact -offset indent
877.It
djm@openbsd.org16277fc2016-09-22 17:55:13 +0000878curve25519-sha256
879.It
Damien Millerc1621c82014-04-20 13:22:46 +1000880curve25519-sha256@libssh.org
881.It
882diffie-hellman-group1-sha1
883.It
884diffie-hellman-group14-sha1
885.It
djm@openbsd.org680321f2018-02-16 02:40:45 +0000886diffie-hellman-group14-sha256
887.It
888diffie-hellman-group16-sha512
889.It
890diffie-hellman-group18-sha512
891.It
Damien Millerc1621c82014-04-20 13:22:46 +1000892diffie-hellman-group-exchange-sha1
893.It
894diffie-hellman-group-exchange-sha256
895.It
896ecdh-sha2-nistp256
897.It
898ecdh-sha2-nistp384
899.It
900ecdh-sha2-nistp521
901.El
902.Pp
903The default is:
Damien Miller6575c3a2013-12-18 17:47:02 +1100904.Bd -literal -offset indent
djm@openbsd.org16277fc2016-09-22 17:55:13 +0000905curve25519-sha256,curve25519-sha256@libssh.org,
Damien Miller6575c3a2013-12-18 17:47:02 +1100906ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
907diffie-hellman-group-exchange-sha256,
djm@openbsd.org680321f2018-02-16 02:40:45 +0000908diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,
909diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
Damien Miller6575c3a2013-12-18 17:47:02 +1100910.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000911.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000912The list of available key exchange algorithms may also be obtained using
913.Qq ssh -Q kex .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000914.It Cm ListenAddress
915Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100916.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000917should listen on.
918The following forms may be used:
919.Pp
920.Bl -item -offset indent -compact
921.It
922.Cm ListenAddress
923.Sm off
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000924.Ar hostname | address
Ben Lindstrom9f049032002-06-21 00:59:05 +0000925.Sm on
jmc@openbsd.org@openbsd.org68d3bbb2017-10-26 06:44:01 +0000926.Op Cm rdomain Ar domain
Ben Lindstrom9f049032002-06-21 00:59:05 +0000927.It
928.Cm ListenAddress
929.Sm off
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000930.Ar hostname : port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000931.Sm on
jmc@openbsd.org@openbsd.org68d3bbb2017-10-26 06:44:01 +0000932.Op Cm rdomain Ar domain
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000933.It
934.Cm ListenAddress
935.Sm off
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000936.Ar IPv4_address : port
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000937.Sm on
jmc@openbsd.org@openbsd.org68d3bbb2017-10-26 06:44:01 +0000938.Op Cm rdomain Ar domain
Ben Lindstrom9f049032002-06-21 00:59:05 +0000939.It
940.Cm ListenAddress
941.Sm off
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000942.Oo Ar hostname | address Oc : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000943.Sm on
jmc@openbsd.org@openbsd.org68d3bbb2017-10-26 06:44:01 +0000944.Op Cm rdomain Ar domain
Ben Lindstrom9f049032002-06-21 00:59:05 +0000945.El
946.Pp
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000947The optional
948.Cm rdomain
949qualifier requests
950.Xr sshd 8
951listen in an explicit routing domain.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000952If
953.Ar port
954is not specified,
dtucker@openbsd.org531a57a2015-04-29 03:48:56 +0000955sshd will listen on the address and all
Ben Lindstrom9f049032002-06-21 00:59:05 +0000956.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000957options specified.
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000958The default is to listen on all local addresses on the current default
959routing domain.
Damien Miller495dca32003-04-01 21:42:14 +1000960Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000961.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000962options are permitted.
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000963For more information on routing domains, see
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000964.Xr rdomain 4 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000965.It Cm LoginGraceTime
966The server disconnects after this time if the user has not
967successfully logged in.
968If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000969The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000970.It Cm LogLevel
971Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100972.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000973The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100974QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000975The default is INFO.
976DEBUG and DEBUG1 are equivalent.
977DEBUG2 and DEBUG3 each specify higher levels of debugging output.
978Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000979.It Cm MACs
980Specifies the available MAC (message authentication code) algorithms.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000981The MAC algorithm is used for data integrity protection.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000982Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000983If the specified value begins with a
984.Sq +
985character, then the specified algorithms will be appended to the default set
986instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000987If the specified value begins with a
988.Sq -
989character, then the specified algorithms (including wildcards) will be removed
990from the default set instead of replacing them.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000991.Pp
Damien Milleraf43a7a2012-12-12 10:46:31 +1100992The algorithms that contain
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000993.Qq -etm
Damien Milleraf43a7a2012-12-12 10:46:31 +1100994calculate the MAC after encryption (encrypt-then-mac).
995These are considered safer and their use recommended.
Damien Millerc1621c82014-04-20 13:22:46 +1000996The supported MACs are:
997.Pp
998.Bl -item -compact -offset indent
999.It
1000hmac-md5
1001.It
1002hmac-md5-96
1003.It
Damien Millerc1621c82014-04-20 13:22:46 +10001004hmac-sha1
1005.It
1006hmac-sha1-96
1007.It
1008hmac-sha2-256
1009.It
1010hmac-sha2-512
1011.It
1012umac-64@openssh.com
1013.It
1014umac-128@openssh.com
1015.It
1016hmac-md5-etm@openssh.com
1017.It
1018hmac-md5-96-etm@openssh.com
1019.It
Damien Millerc1621c82014-04-20 13:22:46 +10001020hmac-sha1-etm@openssh.com
1021.It
1022hmac-sha1-96-etm@openssh.com
1023.It
1024hmac-sha2-256-etm@openssh.com
1025.It
1026hmac-sha2-512-etm@openssh.com
1027.It
1028umac-64-etm@openssh.com
1029.It
1030umac-128-etm@openssh.com
1031.El
1032.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +11001033The default is:
Damien Miller22b7b492007-06-11 14:07:12 +10001034.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +11001035umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1036hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001037hmac-sha1-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +10001038umac-64@openssh.com,umac-128@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001039hmac-sha2-256,hmac-sha2-512,hmac-sha1
Damien Miller22b7b492007-06-11 14:07:12 +10001040.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001041.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001042The list of available MAC algorithms may also be obtained using
1043.Qq ssh -Q mac .
Darren Tucker45150472006-07-12 22:34:17 +10001044.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +10001045Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +10001046If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +10001047.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001048line are satisfied, the keywords on the following lines override those
1049set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +10001050.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001051line or the end of the file.
Damien Millerfc5d6752014-02-28 10:01:28 +11001052If a keyword appears in multiple
1053.Cm Match
sobrado@openbsd.org180bcb42014-08-30 16:32:25 +00001054blocks that are satisfied, only the first instance of the keyword is
Damien Millerfc5d6752014-02-28 10:01:28 +11001055applied.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001056.Pp
Damien Millerd04f3572006-07-24 13:46:50 +10001057The arguments to
Darren Tucker45150472006-07-12 22:34:17 +10001058.Cm Match
Damien Millercf31f382013-10-24 21:02:56 +11001059are one or more criteria-pattern pairs or the single token
1060.Cm All
1061which matches all criteria.
Darren Tucker45150472006-07-12 22:34:17 +10001062The available criteria are
1063.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +10001064.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +10001065.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +10001066.Cm LocalAddress ,
1067.Cm LocalPort ,
djm@openbsd.org68af80e2017-10-25 00:19:47 +00001068.Cm RDomain ,
Darren Tucker45150472006-07-12 22:34:17 +10001069and
djm@openbsd.org68af80e2017-10-25 00:19:47 +00001070.Cm Address
1071(with
1072.Cm RDomain
1073representing the
1074.Xr rdomain 4
1075on which the connection was received.)
1076.Pp
Darren Tucker7a3935d2008-06-10 22:59:10 +10001077The match patterns may consist of single entries or comma-separated
1078lists and may use the wildcard and negation operators described in the
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001079.Sx PATTERNS
1080section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +10001081.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001082.Pp
1083The patterns in an
1084.Cm Address
1085criteria may additionally contain addresses to match in CIDR
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001086address/masklen format,
1087such as 192.0.2.0/24 or 2001:db8::/32.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001088Note that the mask length provided must be consistent with the address -
1089it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +10001090or one with bits set in this host portion of the address.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001091For example, 192.0.2.0/33 and 192.0.2.0/8, respectively.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001092.Pp
Darren Tucker45150472006-07-12 22:34:17 +10001093Only a subset of keywords may be used on the lines following a
1094.Cm Match
1095keyword.
1096Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +10001097.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +11001098.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +10001099.Cm AllowGroups ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001100.Cm AllowStreamLocalForwarding ,
Damien Miller9b439df2006-07-24 14:04:00 +10001101.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +10001102.Cm AllowUsers ,
Damien Millera6e3f012012-11-04 23:21:40 +11001103.Cm AuthenticationMethods ,
Damien Miller09d3e122012-10-31 08:58:58 +11001104.Cm AuthorizedKeysCommand ,
1105.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +11001106.Cm AuthorizedKeysFile ,
djm@openbsd.orgb6b91082015-11-13 02:57:46 +00001107.Cm AuthorizedPrincipalsCommand ,
1108.Cm AuthorizedPrincipalsCommandUser ,
Damien Millerab6de352010-06-26 09:38:45 +10001109.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +11001110.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +10001111.Cm ChrootDirectory ,
markus@openbsd.orgf0ddede2016-11-23 23:14:15 +00001112.Cm ClientAliveCountMax ,
1113.Cm ClientAliveInterval ,
Damien Millerc24da772012-06-20 21:53:58 +10001114.Cm DenyGroups ,
1115.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +10001116.Cm ForceCommand ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001117.Cm GatewayPorts ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +00001118.Cm GSSAPIAuthentication ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001119.Cm HostbasedAcceptedKeyTypes ,
Damien Miller25434de2008-05-19 14:29:08 +10001120.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +10001121.Cm HostbasedUsesNameFromPacketOnly ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001122.Cm IPQoS ,
Darren Tucker1d75f222007-03-01 21:31:28 +11001123.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +11001124.Cm KerberosAuthentication ,
djm@openbsd.org54cd41a2017-05-17 01:24:17 +00001125.Cm LogLevel ,
Damien Miller307c1d12008-06-16 07:56:20 +10001126.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +10001127.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +11001128.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +11001129.Cm PermitEmptyPasswords ,
djm@openbsd.org04df4322018-06-06 18:24:00 +00001130.Cm PermitListen ,
Damien Millerd1de9952006-07-24 14:05:48 +10001131.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +11001132.Cm PermitRootLogin ,
Damien Miller5ff30c62013-10-30 22:21:50 +11001133.Cm PermitTTY ,
Damien Millerab6de352010-06-26 09:38:45 +10001134.Cm PermitTunnel ,
Damien Miller72e6b5c2014-07-04 09:00:04 +10001135.Cm PermitUserRC ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001136.Cm PubkeyAcceptedKeyTypes ,
Darren Tucker1477ea12009-10-07 08:36:05 +11001137.Cm PubkeyAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001138.Cm RekeyLimit ,
1139.Cm RevokedKeys ,
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001140.Cm RDomain ,
djm@openbsd.org28013752018-06-09 03:03:10 +00001141.Cm SetEnv ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001142.Cm StreamLocalBindMask ,
1143.Cm StreamLocalBindUnlink ,
1144.Cm TrustedUserCAKeys ,
Damien Millerd1de9952006-07-24 14:05:48 +10001145.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +11001146.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +10001147and
Damien Miller0296ae82009-02-23 11:00:24 +11001148.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +10001149.It Cm MaxAuthTries
1150Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +10001151connection.
1152Once the number of failures reaches half this value,
1153additional failures are logged.
1154The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +10001155.It Cm MaxSessions
djm@openbsd.orgcac3b662016-02-05 02:37:56 +00001156Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1157sessions permitted per network connection.
1158Multiple sessions may be established by clients that support connection
1159multiplexing.
1160Setting
1161.Cm MaxSessions
1162to 1 will effectively disable session multiplexing, whereas setting it to 0
1163will prevent all shell, login and subsystem sessions while still permitting
1164forwarding.
Damien Miller7207f642008-05-19 15:34:50 +10001165The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001166.It Cm MaxStartups
1167Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001168SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001169Additional connections will be dropped until authentication succeeds or the
1170.Cm LoginGraceTime
1171expires for a connection.
Damien Miller1f583df2013-02-12 11:02:08 +11001172The default is 10:30:100.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001173.Pp
1174Alternatively, random early drop can be enabled by specifying
1175the three colon separated values
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001176start:rate:full (e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +11001177.Xr sshd 8
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001178will refuse connection attempts with a probability of rate/100 (30%)
1179if there are currently start (10) unauthenticated connections.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001180The probability increases linearly and all connection attempts
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001181are refused if the number of unauthenticated connections reaches full (60).
Ben Lindstrom9f049032002-06-21 00:59:05 +00001182.It Cm PasswordAuthentication
1183Specifies whether password authentication is allowed.
1184The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001185.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001186.It Cm PermitEmptyPasswords
1187When password authentication is allowed, it specifies whether the
1188server allows login to accounts with empty password strings.
1189The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001190.Cm no .
djm@openbsd.org04df4322018-06-06 18:24:00 +00001191.It Cm PermitListen
1192Specifies the addresses/ports on which a remote TCP port forwarding may listen.
1193The listen specification must be one of the following forms:
1194.Pp
1195.Bl -item -offset indent -compact
1196.It
1197.Cm PermitListen
1198.Sm off
1199.Ar host : port
1200.Sm on
1201.It
1202.Cm PermitListen
1203.Sm off
1204.Ar IPv4_addr : port
1205.Sm on
1206.It
1207.Cm PermitListen
1208.Sm off
1209.Ar \&[ IPv6_addr \&] : port
1210.Sm on
1211.El
1212.Pp
1213Multiple permissions may be specified by separating them with whitespace.
1214An argument of
1215.Cm any
1216can be used to remove all restrictions and permit any listen requests.
1217An argument of
1218.Cm none
1219can be used to prohibit all listen requests.
1220The host name may contain wildcards as described in the PATTERNS section in
1221.Xr ssh_config 5 .
1222The wildcard
1223.Sq *
1224can also be used in place of a port number to allow all ports.
1225By default all port forwarding listen requests are permitted.
jmc@openbsd.org6ff6fda2018-06-07 11:26:14 +00001226Note that the
djm@openbsd.org04df4322018-06-06 18:24:00 +00001227.Cm GatewayPorts
1228option may further restrict which addresses may be listened on.
Damien Miller9b439df2006-07-24 14:04:00 +10001229.It Cm PermitOpen
1230Specifies the destinations to which TCP port forwarding is permitted.
1231The forwarding specification must be one of the following forms:
1232.Pp
1233.Bl -item -offset indent -compact
1234.It
1235.Cm PermitOpen
1236.Sm off
1237.Ar host : port
1238.Sm on
1239.It
1240.Cm PermitOpen
1241.Sm off
1242.Ar IPv4_addr : port
1243.Sm on
1244.It
1245.Cm PermitOpen
1246.Sm off
1247.Ar \&[ IPv6_addr \&] : port
1248.Sm on
1249.El
1250.Pp
Damien Millera765cf42006-07-24 14:08:13 +10001251Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +10001252An argument of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001253.Cm any
Damien Miller9b439df2006-07-24 14:04:00 +10001254can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +10001255An argument of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001256.Cm none
Darren Tuckerba9ea322012-05-19 19:37:33 +10001257can be used to prohibit all forwarding requests.
jmc@openbsd.org32d921c2016-07-19 12:59:16 +00001258The wildcard
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001259.Sq *
jmc@openbsd.org32d921c2016-07-19 12:59:16 +00001260can be used for host or port to allow all hosts or ports, respectively.
Damien Miller65bc2c42006-07-24 14:04:16 +10001261By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001262.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +11001263Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +00001264.Xr ssh 1 .
1265The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001266.Cm yes ,
1267.Cm prohibit-password ,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001268.Cm forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001269or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001270.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001271The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001272.Cm prohibit-password .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001273.Pp
1274If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001275.Cm prohibit-password
jmc@openbsd.org071325f2017-10-13 16:50:45 +00001276(or its deprecated alias,
1277.Cm without-password ) ,
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001278password and keyboard-interactive authentication are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001279.Pp
1280If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001281.Cm forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001282root login with public key authentication will be allowed,
1283but only if the
1284.Ar command
1285option has been specified
1286(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +10001287normally not allowed).
1288All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001289.Pp
1290If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001291.Cm no ,
Darren Tuckerb3509012005-01-20 11:01:46 +11001292root is not allowed to log in.
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +00001293.It Cm PermitTTY
1294Specifies whether
1295.Xr pty 4
1296allocation is permitted.
1297The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001298.Cm yes .
Damien Millerd27b9472005-12-13 19:29:02 +11001299.It Cm PermitTunnel
1300Specifies whether
1301.Xr tun 4
1302device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +11001303The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001304.Cm yes ,
1305.Cm point-to-point
Damien Miller991dba42006-07-10 20:16:27 +10001306(layer 3),
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001307.Cm ethernet
Damien Miller991dba42006-07-10 20:16:27 +10001308(layer 2), or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001309.Cm no .
Damien Miller991dba42006-07-10 20:16:27 +10001310Specifying
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001311.Cm yes
Damien Miller991dba42006-07-10 20:16:27 +10001312permits both
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001313.Cm point-to-point
Damien Miller991dba42006-07-10 20:16:27 +10001314and
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001315.Cm ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +11001316The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001317.Cm no .
djm@openbsd.org48dffd52014-09-09 09:45:36 +00001318.Pp
1319Independent of this setting, the permissions of the selected
1320.Xr tun 4
1321device must allow access to the user.
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001322.It Cm PermitUserEnvironment
1323Specifies whether
1324.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001325and
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001326.Cm environment=
1327options in
1328.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001329are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +11001330.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001331The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001332.Cm no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001333Enabling environment processing may enable users to bypass access
1334restrictions in some configurations using mechanisms such as
1335.Ev LD_PRELOAD .
Damien Miller72e6b5c2014-07-04 09:00:04 +10001336.It Cm PermitUserRC
1337Specifies whether any
1338.Pa ~/.ssh/rc
1339file is executed.
1340The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001341.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001342.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +00001343Specifies the file that contains the process ID of the
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001344SSH daemon, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001345.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001346to not write one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001347The default is
1348.Pa /var/run/sshd.pid .
1349.It Cm Port
1350Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +11001351.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001352listens on.
1353The default is 22.
1354Multiple options of this type are permitted.
1355See also
1356.Cm ListenAddress .
1357.It Cm PrintLastLog
1358Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001359.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +11001360should print the date and time of the last user login when a user logs
1361in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001362The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001363.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001364.It Cm PrintMotd
1365Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001366.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001367should print
1368.Pa /etc/motd
1369when a user logs in interactively.
1370(On some systems it is also printed by the shell,
1371.Pa /etc/profile ,
1372or equivalent.)
1373The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001374.Cm yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001375.It Cm PubkeyAcceptedKeyTypes
1376Specifies the key types that will be accepted for public key authentication
1377as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001378Alternately if the specified value begins with a
1379.Sq +
1380character, then the specified key types will be appended to the default set
1381instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001382If the specified value begins with a
1383.Sq -
1384character, then the specified key types (including wildcards) will be removed
1385from the default set instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001386The default for this option is:
1387.Bd -literal -offset 3n
1388ecdsa-sha2-nistp256-cert-v01@openssh.com,
1389ecdsa-sha2-nistp384-cert-v01@openssh.com,
1390ecdsa-sha2-nistp521-cert-v01@openssh.com,
1391ssh-ed25519-cert-v01@openssh.com,
1392ssh-rsa-cert-v01@openssh.com,
1393ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +00001394ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001395.Ed
1396.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001397The list of available key types may also be obtained using
1398.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001399.It Cm PubkeyAuthentication
1400Specifies whether public key authentication is allowed.
1401The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001402.Cm yes .
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001403.It Cm RekeyLimit
1404Specifies the maximum amount of data that may be transmitted before the
1405session key is renegotiated, optionally followed a maximum amount of
1406time that may pass before the session key is renegotiated.
1407The first argument is specified in bytes and may have a suffix of
1408.Sq K ,
1409.Sq M ,
1410or
1411.Sq G
1412to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1413The default is between
1414.Sq 1G
1415and
1416.Sq 4G ,
1417depending on the cipher.
1418The optional second value is specified in seconds and may use any of the
1419units documented in the
1420.Sx TIME FORMATS
Darren Tucker64d22942013-05-16 20:31:29 +10001421section.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001422The default value for
1423.Cm RekeyLimit
1424is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001425.Cm default none ,
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001426which means that rekeying is performed after the cipher's default amount
1427of data has been sent or received and no time based rekeying is done.
Damien Miller1aed65e2010-03-04 21:53:35 +11001428.It Cm RevokedKeys
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001429Specifies revoked public keys file, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001430.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001431to not use one.
Damien Miller1aed65e2010-03-04 21:53:35 +11001432Keys listed in this file will be refused for public key authentication.
1433Note that if this file is not readable, then public key authentication will
1434be refused for all users.
Damien Millerf3747bf2013-01-18 11:44:04 +11001435Keys may be specified as a text file, listing one public key per line, or as
1436an OpenSSH Key Revocation List (KRL) as generated by
Damien Miller72abeb72013-01-20 22:33:44 +11001437.Xr ssh-keygen 1 .
Damien Millerfecfd112013-07-18 16:11:50 +10001438For more information on KRLs, see the KEY REVOCATION LISTS section in
Damien Millerf3747bf2013-01-18 11:44:04 +11001439.Xr ssh-keygen 1 .
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001440.It Cm RDomain
1441Specifies an explicit routing domain that is applied after authentication
1442has completed.
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +00001443The user session, as well and any forwarded or listening IP sockets,
1444will be bound to this
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001445.Xr rdomain 4 .
1446If the routing domain is set to
1447.Cm \&%D ,
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +00001448then the domain in which the incoming connection was received will be applied.
djm@openbsd.org28013752018-06-09 03:03:10 +00001449.It Cm SetEnv
1450Specifies one or more environment variables to set in child sessions started
1451by
1452.Xr sshd 8
1453as
1454.Dq NAME=VALUE .
1455The environment value may be quoted (e.g. if it contains whitespace
1456characters).
1457Environment variables set by
1458.Cm SetEnv
1459override the default environment and any variables specified by the user
1460via
1461.Cm AcceptEnv
1462or
1463.Cm PermitUserEnvironment .
Damien Miller7acefbb2014-07-18 14:11:24 +10001464.It Cm StreamLocalBindMask
1465Sets the octal file creation mode mask
1466.Pq umask
1467used when creating a Unix-domain socket file for local or remote
1468port forwarding.
1469This option is only used for port forwarding to a Unix-domain socket file.
1470.Pp
1471The default value is 0177, which creates a Unix-domain socket file that is
1472readable and writable only by the owner.
1473Note that not all operating systems honor the file mode on Unix-domain
1474socket files.
1475.It Cm StreamLocalBindUnlink
1476Specifies whether to remove an existing Unix-domain socket file for local
1477or remote port forwarding before creating a new one.
1478If the socket file already exists and
1479.Cm StreamLocalBindUnlink
1480is not enabled,
1481.Nm sshd
1482will be unable to forward the port to the Unix-domain socket file.
1483This option is only used for port forwarding to a Unix-domain socket file.
1484.Pp
1485The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001486.Cm yes
Damien Miller7acefbb2014-07-18 14:11:24 +10001487or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001488.Cm no .
Damien Miller7acefbb2014-07-18 14:11:24 +10001489The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001490.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001491.It Cm StrictModes
1492Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001493.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001494should check file modes and ownership of the
1495user's files and home directory before accepting login.
1496This is normally desirable because novices sometimes accidentally leave their
1497directory or files world-writable.
1498The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001499.Cm yes .
Darren Tuckerf788a912010-01-08 17:06:47 +11001500Note that this does not apply to
1501.Cm ChrootDirectory ,
1502whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001503.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +11001504Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +10001505Arguments should be a subsystem name and a command (with optional arguments)
1506to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001507.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001508The command
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001509.Cm sftp-server
1510implements the SFTP file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001511.Pp
1512Alternately the name
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001513.Cm internal-sftp
1514implements an in-process SFTP server.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001515This may simplify configurations using
1516.Cm ChrootDirectory
1517to force a different filesystem root on clients.
1518.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001519By default no subsystems are defined.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001520.It Cm SyslogFacility
1521Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001522.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001523The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1524LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1525The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001526.It Cm TCPKeepAlive
1527Specifies whether the system should send TCP keepalive messages to the
1528other side.
1529If they are sent, death of the connection or crash of one
1530of the machines will be properly noticed.
1531However, this means that
1532connections will die if the route is down temporarily, and some people
1533find it annoying.
1534On the other hand, if TCP keepalives are not sent,
1535sessions may hang indefinitely on the server, leaving
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001536.Qq ghost
Damien Miller12c150e2003-12-17 16:31:10 +11001537users and consuming server resources.
1538.Pp
1539The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001540.Cm yes
Damien Miller12c150e2003-12-17 16:31:10 +11001541(to send TCP keepalive messages), and the server will notice
1542if the network goes down or the client host crashes.
1543This avoids infinitely hanging sessions.
1544.Pp
1545To disable TCP keepalive messages, the value should be set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001546.Cm no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001547.It Cm TrustedUserCAKeys
1548Specifies a file containing public keys of certificate authorities that are
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001549trusted to sign user certificates for authentication, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001550.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001551to not use one.
Damien Miller72b33822010-03-05 07:39:01 +11001552Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001553.Ql #
1554are allowed.
1555If a certificate is presented for authentication and has its signing CA key
1556listed in this file, then it may be used for authentication for any user
1557listed in the certificate's principals list.
1558Note that certificates that lack a list of principals will not be permitted
1559for authentication using
1560.Cm TrustedUserCAKeys .
Damien Millerfecfd112013-07-18 16:11:50 +10001561For more details on certificates, see the CERTIFICATES section in
Damien Miller1aed65e2010-03-04 21:53:35 +11001562.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001563.It Cm UseDNS
1564Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001565.Xr sshd 8
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001566should look up the remote host name, and to check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001567the resolved host name for the remote IP address maps back to the
1568very same IP address.
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001569.Pp
1570If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001571.Cm no
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001572(the default) then only addresses and not host names may be used in
djm@openbsd.org0235a5f2016-03-17 17:19:43 +00001573.Pa ~/.ssh/authorized_keys
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001574.Cm from
1575and
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +00001576.Nm
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001577.Cm Match
1578.Cm Host
1579directives.
Damien Miller2e193e22003-05-14 15:13:03 +10001580.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001581Enables the Pluggable Authentication Module interface.
1582If set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001583.Cm yes
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001584this will enable PAM authentication using
1585.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001586and
1587.Cm PasswordAuthentication
1588in addition to PAM account and session module processing for all
1589authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001590.Pp
1591Because PAM challenge-response authentication usually serves an equivalent
1592role to password authentication, you should disable either
1593.Cm PasswordAuthentication
1594or
1595.Cm ChallengeResponseAuthentication.
1596.Pp
1597If
1598.Cm UsePAM
1599is enabled, you will not be able to run
1600.Xr sshd 8
1601as a non-root user.
1602The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001603.Cm no .
Damien Miller23528812012-04-22 11:24:43 +10001604.It Cm VersionAddendum
1605Optionally specifies additional text to append to the SSH protocol banner
1606sent by the server upon connection.
1607The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001608.Cm none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001609.It Cm X11DisplayOffset
1610Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001611.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001612X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001613This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001614The default is 10.
1615.It Cm X11Forwarding
1616Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001617The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001618.Cm yes
Damien Miller101c4a72002-09-19 11:51:21 +10001619or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001620.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001621The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001622.Cm no .
Damien Miller101c4a72002-09-19 11:51:21 +10001623.Pp
1624When X11 forwarding is enabled, there may be additional exposure to
1625the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001626.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001627proxy display is configured to listen on the wildcard address (see
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001628.Cm X11UseLocalhost ) ,
1629though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001630Additionally, the authentication spoofing and authentication data
1631verification and substitution occur on the client side.
1632The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001633display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001634forwarding (see the warnings for
1635.Cm ForwardX11
1636in
Damien Millerf1ce5052003-06-11 22:04:39 +10001637.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001638A system administrator may have a stance in which they want to
1639protect clients that may expose themselves to attack by unwittingly
1640requesting X11 forwarding, which can warrant a
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001641.Cm no
Damien Miller101c4a72002-09-19 11:51:21 +10001642setting.
1643.Pp
1644Note that disabling X11 forwarding does not prevent users from
1645forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001646.It Cm X11UseLocalhost
1647Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001648.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001649should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001650the wildcard address.
1651By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001652sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001653hostname part of the
1654.Ev DISPLAY
1655environment variable to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001656.Cm localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001657This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001658However, some older X11 clients may not function with this
1659configuration.
1660.Cm X11UseLocalhost
1661may be set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001662.Cm no
Ben Lindstrom9f049032002-06-21 00:59:05 +00001663to specify that the forwarding server should be bound to the wildcard
1664address.
1665The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001666.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +00001667or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001668.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001669The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001670.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001671.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001672Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001673.Xr xauth 1
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001674program, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001675.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001676to not use one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001677The default is
1678.Pa /usr/X11R6/bin/xauth .
1679.El
Damien Millere3beba22006-03-15 11:59:25 +11001680.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001681.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001682command-line arguments and configuration file options that specify time
1683may be expressed using a sequence of the form:
1684.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001685.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001686.Sm on
1687where
1688.Ar time
1689is a positive integer value and
1690.Ar qualifier
1691is one of the following:
1692.Pp
1693.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001694.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001695seconds
1696.It Cm s | Cm S
1697seconds
1698.It Cm m | Cm M
1699minutes
1700.It Cm h | Cm H
1701hours
1702.It Cm d | Cm D
1703days
1704.It Cm w | Cm W
1705weeks
1706.El
1707.Pp
1708Each member of the sequence is added together to calculate
1709the total time value.
1710.Pp
1711Time format examples:
1712.Pp
1713.Bl -tag -width Ds -compact -offset indent
1714.It 600
1715600 seconds (10 minutes)
1716.It 10m
171710 minutes
1718.It 1h30m
17191 hour 30 minutes (90 minutes)
1720.El
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001721.Sh TOKENS
1722Arguments to some keywords can make use of tokens,
1723which are expanded at runtime:
1724.Pp
1725.Bl -tag -width XXXX -offset indent -compact
1726.It %%
1727A literal
1728.Sq % .
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001729.It \&%D
1730The routing domain in which the incoming connection was received.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001731.It %F
1732The fingerprint of the CA key.
1733.It %f
1734The fingerprint of the key or certificate.
1735.It %h
1736The home directory of the user.
1737.It %i
1738The key ID in the certificate.
1739.It %K
1740The base64-encoded CA key.
1741.It %k
1742The base64-encoded key or certificate for authentication.
1743.It %s
1744The serial number of the certificate.
1745.It \&%T
1746The type of the CA key.
1747.It %t
1748The key or certificate type.
jmc@openbsd.org29402842018-06-01 05:50:18 +00001749.It \&%U
1750The numeric user ID of the target user.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001751.It %u
1752The username.
1753.El
1754.Pp
1755.Cm AuthorizedKeysCommand
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001756accepts the tokens %%, %f, %h, %k, %t, %U, and %u.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001757.Pp
1758.Cm AuthorizedKeysFile
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001759accepts the tokens %%, %h, %U, and %u.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001760.Pp
1761.Cm AuthorizedPrincipalsCommand
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001762accepts the tokens %%, %F, %f, %h, %i, %K, %k, %s, %T, %t, %U, and %u.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001763.Pp
1764.Cm AuthorizedPrincipalsFile
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001765accepts the tokens %%, %h, %U, and %u.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001766.Pp
1767.Cm ChrootDirectory
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001768accepts the tokens %%, %h, %U, and %u.
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001769.Pp
1770.Cm RoutingDomain
1771accepts the token %D.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001772.Sh FILES
1773.Bl -tag -width Ds
1774.It Pa /etc/ssh/sshd_config
1775Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001776.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001777This file should be writable by root only, but it is recommended
1778(though not necessary) that it be world-readable.
1779.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001780.Sh SEE ALSO
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001781.Xr sftp-server 8 ,
Damien Millerf1ce5052003-06-11 22:04:39 +10001782.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001783.Sh AUTHORS
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001784.An -nosplit
Ben Lindstrom9f049032002-06-21 00:59:05 +00001785OpenSSH is a derivative of the original and free
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001786ssh 1.2.12 release by
1787.An Tatu Ylonen .
1788.An Aaron Campbell , Bob Beck , Markus Friedl , Niels Provos ,
1789.An Theo de Raadt
1790and
1791.An Dug Song
Ben Lindstrom9f049032002-06-21 00:59:05 +00001792removed many bugs, re-added newer features and
1793created OpenSSH.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001794.An Markus Friedl
1795contributed the support for SSH protocol versions 1.5 and 2.0.
1796.An Niels Provos
1797and
1798.An Markus Friedl
1799contributed support for privilege separation.