blob: 76ec69baf37a3d380944dcf9b337a836d458aebb [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.\"
naddy@openbsd.org141df482019-12-21 20:22:34 +000036.\" $OpenBSD: sshd_config.5,v 1.297 2019/12/21 20:22:34 naddy Exp $
37.Dd $Mdocdate: December 21 2019 $
Ben Lindstrom9f049032002-06-21 00:59:05 +000038.Dt SSHD_CONFIG 5
39.Os
40.Sh NAME
41.Nm sshd_config
jmc@openbsd.org483cc722019-11-30 07:07:59 +000042.Nd OpenSSH 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.
djm@openbsd.org472269f2018-07-20 05:01:10 +0000189This option must be followed by one or more lists of comma-separated
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
Damien Miller87f08be2018-07-20 13:18:28 +1000208.Cm bsdauth
Damien Miller91a55f22013-04-23 15:18:10 +1000209or
Damien Miller87f08be2018-07-20 13:18:28 +1000210.Cm pam .
Damien Miller91a55f22013-04-23 15:18:10 +1000211depending on the server configuration.
212For example,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000213.Qq keyboard-interactive:bsdauth
Damien Miller91a55f22013-04-23 15:18:10 +1000214would restrict keyboard interactive authentication to the
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000215.Cm bsdauth
Damien Miller91a55f22013-04-23 15:18:10 +1000216device.
217.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000218If the publickey method is listed more than once,
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000219.Xr sshd 8
220verifies that keys that have been used successfully are not reused for
221subsequent authentications.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000222For example,
223.Qq publickey,publickey
224requires successful authentication using two different public keys.
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000225.Pp
Damien Millera6e3f012012-11-04 23:21:40 +1100226Note that each authentication method listed should also be explicitly enabled
227in the configuration.
djm@openbsd.org8042bad2017-09-01 05:50:48 +0000228.Pp
229The available authentication methods are:
230.Qq gssapi-with-mic ,
231.Qq hostbased ,
232.Qq keyboard-interactive ,
233.Qq none
234(used for access to password-less accounts when
jmc@openbsd.orgf41bcd72018-05-15 05:40:11 +0000235.Cm PermitEmptyPasswords
djm@openbsd.org8042bad2017-09-01 05:50:48 +0000236is enabled),
237.Qq password
238and
239.Qq publickey .
Damien Miller09d3e122012-10-31 08:58:58 +1100240.It Cm AuthorizedKeysCommand
Damien Millerf33580e2012-11-04 22:22:52 +1100241Specifies a program to be used to look up the user's public keys.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000242The program must be owned by root, not writable by group or others and
243specified by an absolute path.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000244Arguments to
245.Cm AuthorizedKeysCommand
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000246accept the tokens described in the
247.Sx TOKENS
248section.
249If no arguments are specified then the username of the target user is used.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000250.Pp
251The program should produce on standard output zero or
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000252more lines of authorized_keys output (see
253.Sx AUTHORIZED_KEYS
254in
Damien Millerf33580e2012-11-04 22:22:52 +1100255.Xr sshd 8 ) .
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000256If a key supplied by
257.Cm AuthorizedKeysCommand
258does not successfully authenticate
Damien Miller09d3e122012-10-31 08:58:58 +1100259and authorize the user then public key authentication continues using the usual
260.Cm AuthorizedKeysFile
261files.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000262By default, no
263.Cm AuthorizedKeysCommand
264is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100265.It Cm AuthorizedKeysCommandUser
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000266Specifies the user under whose account the
267.Cm AuthorizedKeysCommand
268is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100269It is recommended to use a dedicated user that has no other role on the host
270than running authorized keys commands.
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000271If
djm@openbsd.orgd663bea2014-12-11 05:25:06 +0000272.Cm AuthorizedKeysCommand
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000273is specified but
274.Cm AuthorizedKeysCommandUser
275is not, then
276.Xr sshd 8
277will refuse to start.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000278.It Cm AuthorizedKeysFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000279Specifies the file that contains the public keys used for user authentication.
schwarze@openbsd.orgdb7606d2019-05-14 12:47:17 +0000280The format is described in the AUTHORIZED_KEYS FILE FORMAT section of
Damien Miller6018a362010-07-02 13:35:19 +1000281.Xr sshd 8 .
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000282Arguments to
Ben Lindstrom9f049032002-06-21 00:59:05 +0000283.Cm AuthorizedKeysFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000284accept the tokens described in the
285.Sx TOKENS
286section.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000287After expansion,
288.Cm AuthorizedKeysFile
289is taken to be an absolute path or one relative to the user's home
290directory.
Damien Millerb9132fc2011-05-29 21:41:40 +1000291Multiple files may be listed, separated by whitespace.
djm@openbsd.org2bca8a42015-09-11 03:13:36 +0000292Alternately this option may be set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000293.Cm none
djm@openbsd.org2bca8a42015-09-11 03:13:36 +0000294to skip checking for user keys in files.
Damien Millerb9132fc2011-05-29 21:41:40 +1000295The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000296.Qq .ssh/authorized_keys .ssh/authorized_keys2 .
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000297.It Cm AuthorizedPrincipalsCommand
298Specifies a program to be used to generate the list of allowed
299certificate principals as per
300.Cm AuthorizedPrincipalsFile .
301The program must be owned by root, not writable by group or others and
302specified by an absolute path.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000303Arguments to
304.Cm AuthorizedPrincipalsCommand
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000305accept the tokens described in the
306.Sx TOKENS
307section.
308If no arguments are specified then the username of the target user is used.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000309.Pp
310The program should produce on standard output zero or
311more lines of
312.Cm AuthorizedPrincipalsFile
313output.
314If either
315.Cm AuthorizedPrincipalsCommand
316or
317.Cm AuthorizedPrincipalsFile
318is specified, then certificates offered by the client for authentication
319must contain a principal that is listed.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000320By default, no
321.Cm AuthorizedPrincipalsCommand
322is run.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000323.It Cm AuthorizedPrincipalsCommandUser
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000324Specifies the user under whose account the
325.Cm AuthorizedPrincipalsCommand
326is run.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000327It is recommended to use a dedicated user that has no other role on the host
328than running authorized principals commands.
329If
330.Cm AuthorizedPrincipalsCommand
331is specified but
332.Cm AuthorizedPrincipalsCommandUser
333is not, then
334.Xr sshd 8
335will refuse to start.
Damien Miller30da3442010-05-10 11:58:03 +1000336.It Cm AuthorizedPrincipalsFile
337Specifies a file that lists principal names that are accepted for
338certificate authentication.
339When using certificates signed by a key listed in
340.Cm TrustedUserCAKeys ,
341this file lists names, one of which must appear in the certificate for it
342to be accepted for authentication.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000343Names are listed one per line preceded by key options (as described in
344.Sx AUTHORIZED_KEYS FILE FORMAT
345in
Damien Millerd59dab82010-07-02 13:37:17 +1000346.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000347Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000348.Ql #
349are ignored.
350.Pp
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000351Arguments to
Damien Miller30da3442010-05-10 11:58:03 +1000352.Cm AuthorizedPrincipalsFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000353accept the tokens described in the
354.Sx TOKENS
355section.
Damien Miller30da3442010-05-10 11:58:03 +1000356After expansion,
357.Cm AuthorizedPrincipalsFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000358is taken to be an absolute path or one relative to the user's home directory.
Damien Miller8fef9eb2012-04-22 11:25:10 +1000359The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000360.Cm none ,
Damien Miller8fef9eb2012-04-22 11:25:10 +1000361i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000362of the user must appear in a certificate's principals list for it to be
363accepted.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000364.Pp
Damien Miller30da3442010-05-10 11:58:03 +1000365Note that
366.Cm AuthorizedPrincipalsFile
367is only used when authentication proceeds using a CA listed in
368.Cm TrustedUserCAKeys
369and is not consulted for certification authorities trusted via
370.Pa ~/.ssh/authorized_keys ,
371though the
372.Cm principals=
373key option offers a similar facility (see
374.Xr sshd 8
375for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000376.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000377The contents of the specified file are sent to the remote user before
378authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000379If the argument is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000380.Cm none
Damien Miller4890e532007-09-17 11:57:38 +1000381then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000382By default, no banner is displayed.
djm@openbsd.org86e57372018-09-20 03:28:06 +0000383.It Cm CASignatureAlgorithms
384Specifies which algorithms are allowed for signing of certificates
385by certificate authorities (CAs).
386The default is:
387.Bd -literal -offset indent
dtucker@openbsd.org0e2fe182019-07-23 23:06:57 +0000388ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org86e57372018-09-20 03:28:06 +0000389ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
390.Ed
391.Pp
392Certificates signed using other algorithms will not be accepted for
393public key or host-based authentication.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000394.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000395Specifies whether challenge-response authentication is allowed (e.g. via
Damien Millere8c9f262014-10-03 09:24:56 +1000396PAM or through authentication styles supported in
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000397.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000398The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000399.Cm yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100400.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100401Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100402.Xr chroot 2
403to after authentication.
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000404At session startup
405.Xr sshd 8
406checks that all components of the pathname are root-owned directories
407which are not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000408After the chroot,
409.Xr sshd 8
410changes the working directory to the user's home directory.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000411Arguments to
412.Cm ChrootDirectory
413accept the tokens described in the
414.Sx TOKENS
415section.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100416.Pp
417The
418.Cm ChrootDirectory
419must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000420user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100421For an interactive session this requires at least a shell, typically
422.Xr sh 1 ,
423and basic
424.Pa /dev
425nodes such as
426.Xr null 4 ,
427.Xr zero 4 ,
428.Xr stdin 4 ,
429.Xr stdout 4 ,
430.Xr stderr 4 ,
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000431and
Damien Millerd8cb1f12008-02-10 22:40:12 +1100432.Xr tty 4
433devices.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000434For file transfer sessions using SFTP
435no additional configuration of the environment is necessary if the in-process
436sftp-server is used,
Damien Miller426117b2014-07-30 12:33:20 +1000437though sessions which use logging may require
Darren Tucker00fcd712009-06-21 17:56:00 +1000438.Pa /dev/log
Damien Miller426117b2014-07-30 12:33:20 +1000439inside the chroot directory on some operating systems (see
Darren Tucker00fcd712009-06-21 17:56:00 +1000440.Xr sftp-server 8
441for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100442.Pp
jmc@openbsd.orga5a3e332015-01-22 21:00:42 +0000443For safety, it is very important that the directory hierarchy be
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000444prevented from modification by other processes on the system (especially
445those outside the jail).
446Misconfiguration can lead to unsafe environments which
447.Xr sshd 8
448cannot detect.
449.Pp
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000450The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000451.Cm none ,
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000452indicating not to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100453.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000454.It Cm Ciphers
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000455Specifies the ciphers allowed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000456Multiple ciphers must be comma-separated.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +0000457If the specified list begins with a
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000458.Sq +
459character, then the specified ciphers will be appended to the default set
460instead of replacing them.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +0000461If the specified list begins with a
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000462.Sq -
463character, then the specified ciphers (including wildcards) will be removed
464from the default set instead of replacing them.
naddy@openbsd.org91a21352019-09-06 14:45:34 +0000465If the specified list begins with a
466.Sq ^
467character, then the specified ciphers will be placed at the head of the
468default set.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000469.Pp
Damien Miller0fde8ac2013-11-21 14:12:23 +1100470The supported ciphers are:
471.Pp
Damien Millerc1621c82014-04-20 13:22:46 +1000472.Bl -item -compact -offset indent
473.It
4743des-cbc
475.It
476aes128-cbc
477.It
478aes192-cbc
479.It
480aes256-cbc
481.It
482aes128-ctr
483.It
484aes192-ctr
485.It
486aes256-ctr
487.It
488aes128-gcm@openssh.com
489.It
490aes256-gcm@openssh.com
491.It
Damien Millerc1621c82014-04-20 13:22:46 +1000492chacha20-poly1305@openssh.com
493.El
Damien Miller0fde8ac2013-11-21 14:12:23 +1100494.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100495The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000496.Bd -literal -offset indent
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000497chacha20-poly1305@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000498aes128-ctr,aes192-ctr,aes256-ctr,
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000499aes128-gcm@openssh.com,aes256-gcm@openssh.com
Ben Lindstrom9f049032002-06-21 00:59:05 +0000500.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100501.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000502The list of available ciphers may also be obtained using
503.Qq ssh -Q cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000504.It Cm ClientAliveCountMax
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000505Sets the number of client alive messages which may be sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100506.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000507receiving any messages back from the client.
508If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100509sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000510It is important to note that the use of client alive messages is very
511different from
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000512.Cm TCPKeepAlive .
Damien Millerfbf486b2003-05-23 18:44:23 +1000513The client alive messages are sent through the encrypted channel
514and therefore will not be spoofable.
515The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100516.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000517is spoofable.
518The client alive mechanism is valuable when the client or
dtucker@openbsd.org8fdbc722019-08-09 04:24:03 +0000519server depend on knowing when a connection has become unresponsive.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000520.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000521The default value is 3.
522If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000523.Cm ClientAliveInterval
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000524is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000525.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100526is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000527will be disconnected after approximately 45 seconds.
Damien Miller1594ad52005-05-26 12:12:19 +1000528.It Cm ClientAliveInterval
529Sets a timeout interval in seconds after which if no data has been received
530from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100531.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000532will send a message through the encrypted
533channel to request a response from the client.
534The default
535is 0, indicating that these messages will not be sent to the client.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000536.It Cm Compression
djm@openbsd.org4577ade2016-09-28 20:32:42 +0000537Specifies whether compression is enabled after
Damien Miller9786e6e2005-07-26 21:54:56 +1000538the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000539The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000540.Cm yes ,
541.Cm delayed
djm@openbsd.org4577ade2016-09-28 20:32:42 +0000542(a legacy synonym for
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000543.Cm yes )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000544or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000545.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000546The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000547.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000548.It Cm DenyGroups
549This keyword can be followed by a list of group name patterns, separated
550by spaces.
551Login is disallowed for users whose primary group or supplementary
552group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000553Only group names are valid; a numerical group ID is not recognized.
554By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100555The allow/deny directives are processed in the following order:
556.Cm DenyUsers ,
557.Cm AllowUsers ,
558.Cm DenyGroups ,
559and finally
560.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100561.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000562See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100563.Xr ssh_config 5
564for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000565.It Cm DenyUsers
566This keyword can be followed by a list of user name patterns, separated
567by spaces.
568Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000569Only user names are valid; a numerical user ID is not recognized.
570By default, login is allowed for all users.
571If the pattern takes the form USER@HOST then USER and HOST
572are separately checked, restricting logins to particular
573users from particular hosts.
jmc@openbsd.orgee1e0a12016-04-27 13:53:48 +0000574HOST criteria may additionally contain addresses to match in CIDR
575address/masklen format.
Damien Millerac73e512006-03-15 11:58:49 +1100576The allow/deny directives are processed in the following order:
577.Cm DenyUsers ,
578.Cm AllowUsers ,
579.Cm DenyGroups ,
580and finally
581.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100582.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000583See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100584.Xr ssh_config 5
585for more information on patterns.
djm@openbsd.org7844f352016-11-30 03:00:05 +0000586.It Cm DisableForwarding
587Disables all forwarding features, including X11,
588.Xr ssh-agent 1 ,
589TCP and StreamLocal.
590This option overrides all other forwarding-related options and may
591simplify restricted configurations.
djm@openbsd.org8f574952017-06-24 06:34:38 +0000592.It Cm ExposeAuthInfo
jmc@openbsd.org5fa14072017-09-27 06:45:53 +0000593Writes a temporary file containing a list of authentication methods and
djm@openbsd.org8f574952017-06-24 06:34:38 +0000594public credentials (e.g. keys) used to authenticate the user.
jmc@openbsd.org40962192017-06-24 06:57:04 +0000595The location of the file is exposed to the user session through the
djm@openbsd.orgf17ee612017-06-24 07:08:57 +0000596.Ev SSH_USER_AUTH
jmc@openbsd.org40962192017-06-24 06:57:04 +0000597environment variable.
jmc@openbsd.org5fa14072017-09-27 06:45:53 +0000598The default is
599.Cm no .
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000600.It Cm FingerprintHash
601Specifies the hash algorithm used when logging key fingerprints.
602Valid options are:
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000603.Cm md5
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000604and
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000605.Cm sha256 .
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000606The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000607.Cm sha256 .
Damien Millere2754432006-07-24 14:06:47 +1000608.It Cm ForceCommand
609Forces the execution of the command specified by
610.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100611ignoring any command supplied by the client and
612.Pa ~/.ssh/rc
613if present.
Damien Millere2754432006-07-24 14:06:47 +1000614The command is invoked by using the user's login shell with the -c option.
615This applies to shell, command, or subsystem execution.
616It is most useful inside a
617.Cm Match
618block.
619The command originally supplied by the client is available in the
620.Ev SSH_ORIGINAL_COMMAND
621environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100622Specifying a command of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000623.Cm internal-sftp
624will force the use of an in-process SFTP server that requires no support
Damien Millercdb6e652008-02-10 22:47:24 +1100625files when used with
626.Cm ChrootDirectory .
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000627The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000628.Cm none .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000629.It Cm GatewayPorts
630Specifies whether remote hosts are allowed to connect to ports
631forwarded for the client.
632By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100633.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000634binds remote port forwardings to the loopback address.
635This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000636.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100637can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100638should allow remote port forwardings to bind to non-loopback addresses, thus
639allowing other hosts to connect.
640The argument may be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000641.Cm no
Damien Millerf91ee4c2005-03-01 21:24:33 +1100642to force remote port forwardings to be available to the local host only,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000643.Cm yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100644to force remote port forwardings to bind to the wildcard address, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000645.Cm clientspecified
Damien Millerf91ee4c2005-03-01 21:24:33 +1100646to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000647The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000648.Cm no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000649.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000650Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100651The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000652.Cm no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000653.It Cm GSSAPICleanupCredentials
654Specifies whether to automatically destroy the user's credentials cache
655on logout.
656The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000657.Cm yes .
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000658.It Cm GSSAPIStrictAcceptorCheck
659Determines whether to be strict about the identity of the GSSAPI acceptor
660a client authenticates against.
661If set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000662.Cm yes
663then the client must authenticate against the host
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000664service on the current hostname.
665If set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000666.Cm no
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000667then the client may authenticate against any service key stored in the
668machine's default store.
669This facility is provided to assist with operation on multi homed machines.
670The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000671.Cm yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000672.It Cm HostbasedAcceptedKeyTypes
673Specifies the key types that will be accepted for hostbased authentication
djm@openbsd.org312d2f22018-07-04 13:49:31 +0000674as a list of comma-separated patterns.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +0000675Alternately if the specified list begins with a
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000676.Sq +
677character, then the specified key types will be appended to the default set
678instead of replacing them.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +0000679If the specified list begins with a
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000680.Sq -
681character, then the specified key types (including wildcards) will be removed
682from the default set instead of replacing them.
naddy@openbsd.org91a21352019-09-06 14:45:34 +0000683If the specified list begins with a
684.Sq ^
685character, then the specified key types will be placed at the head of the
686default set.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000687The default for this option is:
688.Bd -literal -offset 3n
689ecdsa-sha2-nistp256-cert-v01@openssh.com,
690ecdsa-sha2-nistp384-cert-v01@openssh.com,
691ecdsa-sha2-nistp521-cert-v01@openssh.com,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +0000692sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000693ssh-ed25519-cert-v01@openssh.com,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +0000694sk-ssh-ed25519-cert-v01@openssh.com,
naddy@openbsd.orgaa4c6402019-11-07 08:38:38 +0000695rsa-sha2-512-cert-v01@openssh.com,
696rsa-sha2-256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000697ssh-rsa-cert-v01@openssh.com,
698ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +0000699sk-ecdsa-sha2-nistp256@openssh.com,
700ssh-ed25519,sk-ssh-ed25519@openssh.com,
701rsa-sha2-512,rsa-sha2-256,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000702.Ed
703.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000704The list of available key types may also be obtained using
705.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000706.It Cm HostbasedAuthentication
707Specifies whether rhosts or /etc/hosts.equiv authentication together
708with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100709(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000710The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000711.Cm no .
Damien Millerb594f382006-08-30 11:06:34 +1000712.It Cm HostbasedUsesNameFromPacketOnly
713Specifies whether or not the server will attempt to perform a reverse
714name lookup when matching the name in the
715.Pa ~/.shosts ,
716.Pa ~/.rhosts ,
717and
718.Pa /etc/hosts.equiv
719files during
720.Cm HostbasedAuthentication .
721A setting of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000722.Cm yes
Damien Millerb594f382006-08-30 11:06:34 +1000723means that
724.Xr sshd 8
725uses the name supplied by the client rather than
726attempting to resolve the name from the TCP connection itself.
727The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000728.Cm no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100729.It Cm HostCertificate
730Specifies a file containing a public host certificate.
731The certificate's public key must match a private host key already specified
732by
733.Cm HostKey .
734The default behaviour of
735.Xr sshd 8
736is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000737.It Cm HostKey
738Specifies a file containing a private host key
739used by SSH.
naddy@openbsd.orgffe65492016-08-15 12:32:04 +0000740The defaults are
Damien Miller8ba0ead2013-12-18 17:46:27 +1100741.Pa /etc/ssh/ssh_host_ecdsa_key ,
742.Pa /etc/ssh/ssh_host_ed25519_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000743and
naddy@openbsd.orgffe65492016-08-15 12:32:04 +0000744.Pa /etc/ssh/ssh_host_rsa_key .
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000745.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000746Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100747.Xr sshd 8
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000748will refuse to use a file if it is group/world-accessible
749and that the
750.Cm HostKeyAlgorithms
751option restricts which of the keys are actually used by
752.Xr sshd 8 .
753.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000754It is possible to have multiple host key files.
Damien Miller85b45e02013-07-20 13:21:52 +1000755It is also possible to specify public host key files instead.
756In this case operations on the private key will be delegated
757to an
758.Xr ssh-agent 1 .
759.It Cm HostKeyAgent
760Identifies the UNIX-domain socket used to communicate
761with an agent that has access to the private host keys.
markus@openbsd.org1a75d142016-05-04 14:29:58 +0000762If the string
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000763.Qq SSH_AUTH_SOCK
Damien Miller85b45e02013-07-20 13:21:52 +1000764is specified, the location of the socket will be read from the
765.Ev SSH_AUTH_SOCK
766environment variable.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000767.It Cm HostKeyAlgorithms
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000768Specifies the host key algorithms
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000769that the server offers.
770The default for this option is:
771.Bd -literal -offset 3n
772ecdsa-sha2-nistp256-cert-v01@openssh.com,
773ecdsa-sha2-nistp384-cert-v01@openssh.com,
774ecdsa-sha2-nistp521-cert-v01@openssh.com,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +0000775sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000776ssh-ed25519-cert-v01@openssh.com,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +0000777sk-ssh-ed25519-cert-v01@openssh.com,
naddy@openbsd.orgaa4c6402019-11-07 08:38:38 +0000778rsa-sha2-512-cert-v01@openssh.com,
779rsa-sha2-256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000780ssh-rsa-cert-v01@openssh.com,
781ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +0000782sk-ecdsa-sha2-nistp256@openssh.com,
783ssh-ed25519,sk-ssh-ed25519@openssh.com,
784rsa-sha2-512,rsa-sha2-256,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000785.Ed
786.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000787The list of available key types may also be obtained using
788.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000789.It Cm IgnoreRhosts
790Specifies that
791.Pa .rhosts
792and
793.Pa .shosts
794files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000795.Cm HostbasedAuthentication .
796.Pp
797.Pa /etc/hosts.equiv
798and
799.Pa /etc/shosts.equiv
800are still used.
801The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000802.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000803.It Cm IgnoreUserKnownHosts
804Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100805.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000806should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000807.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000808during
djm@openbsd.org62562ce2018-02-10 06:54:38 +0000809.Cm HostbasedAuthentication
810and use only the system-wide known hosts file
811.Pa /etc/ssh/known_hosts .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000812The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000813.Cm no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100814.It Cm IPQoS
815Specifies the IPv4 type-of-service or DSCP class for the connection.
816Accepted values are
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000817.Cm af11 ,
818.Cm af12 ,
819.Cm af13 ,
820.Cm af21 ,
821.Cm af22 ,
822.Cm af23 ,
823.Cm af31 ,
824.Cm af32 ,
825.Cm af33 ,
826.Cm af41 ,
827.Cm af42 ,
828.Cm af43 ,
829.Cm cs0 ,
830.Cm cs1 ,
831.Cm cs2 ,
832.Cm cs3 ,
833.Cm cs4 ,
834.Cm cs5 ,
835.Cm cs6 ,
836.Cm cs7 ,
837.Cm ef ,
838.Cm lowdelay ,
839.Cm throughput ,
840.Cm reliability ,
djm@openbsd.org51676ec2017-07-23 23:37:02 +0000841a numeric value, or
842.Cm none
843to use the operating system default.
Damien Miller928362d2010-12-26 14:26:45 +1100844This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100845If one argument is specified, it is used as the packet class unconditionally.
846If two values are specified, the first is automatically selected for
847interactive sessions and the second for non-interactive sessions.
848The default is
job@openbsd.org5ee84482018-04-04 15:12:17 +0000849.Cm af21
jmc@openbsd.org3e36f282018-04-08 07:36:02 +0000850(Low-Latency Data)
Damien Miller0dac6fb2010-11-20 15:19:38 +1100851for interactive sessions and
job@openbsd.org5ee84482018-04-04 15:12:17 +0000852.Cm cs1
jmc@openbsd.org3e36f282018-04-08 07:36:02 +0000853(Lower Effort)
Damien Miller0dac6fb2010-11-20 15:19:38 +1100854for non-interactive sessions.
Damien Millere1e480a2014-02-04 11:13:17 +1100855.It Cm KbdInteractiveAuthentication
856Specifies whether to allow keyboard-interactive authentication.
857The argument to this keyword must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000858.Cm yes
Damien Millere1e480a2014-02-04 11:13:17 +1100859or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000860.Cm no .
Damien Millere1e480a2014-02-04 11:13:17 +1100861The default is to use whatever value
862.Cm ChallengeResponseAuthentication
863is set to
864(by default
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000865.Cm yes ) .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000866.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000867Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000868.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000869will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000870To use this option, the server needs a
871Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100872The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000873.Cm no .
Damien Miller8448e662004-03-08 23:13:15 +1100874.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000875If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100876an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100877The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000878.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000879.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100880If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000881the password will be validated via any additional local mechanism
882such as
883.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100884The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000885.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000886.It Cm KerberosTicketCleanup
887Specifies whether to automatically destroy the user's ticket cache
888file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100889The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000890.Cm yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000891.It Cm KexAlgorithms
892Specifies the available KEX (Key Exchange) algorithms.
893Multiple algorithms must be comma-separated.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +0000894Alternately if the specified list begins with a
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000895.Sq +
896character, then the specified methods will be appended to the default set
897instead of replacing them.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +0000898If the specified list begins with a
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000899.Sq -
900character, then the specified methods (including wildcards) will be removed
901from the default set instead of replacing them.
naddy@openbsd.org91a21352019-09-06 14:45:34 +0000902If the specified list begins with a
903.Sq ^
904character, then the specified methods will be placed at the head of the
905default set.
Damien Millerc1621c82014-04-20 13:22:46 +1000906The supported algorithms are:
907.Pp
908.Bl -item -compact -offset indent
909.It
djm@openbsd.org16277fc2016-09-22 17:55:13 +0000910curve25519-sha256
911.It
Damien Millerc1621c82014-04-20 13:22:46 +1000912curve25519-sha256@libssh.org
913.It
914diffie-hellman-group1-sha1
915.It
916diffie-hellman-group14-sha1
917.It
djm@openbsd.org680321f2018-02-16 02:40:45 +0000918diffie-hellman-group14-sha256
919.It
920diffie-hellman-group16-sha512
921.It
922diffie-hellman-group18-sha512
923.It
Damien Millerc1621c82014-04-20 13:22:46 +1000924diffie-hellman-group-exchange-sha1
925.It
926diffie-hellman-group-exchange-sha256
927.It
928ecdh-sha2-nistp256
929.It
930ecdh-sha2-nistp384
931.It
932ecdh-sha2-nistp521
933.El
934.Pp
935The default is:
Damien Miller6575c3a2013-12-18 17:47:02 +1100936.Bd -literal -offset indent
djm@openbsd.org16277fc2016-09-22 17:55:13 +0000937curve25519-sha256,curve25519-sha256@libssh.org,
Damien Miller6575c3a2013-12-18 17:47:02 +1100938ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
939diffie-hellman-group-exchange-sha256,
djm@openbsd.org680321f2018-02-16 02:40:45 +0000940diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,
941diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
Damien Miller6575c3a2013-12-18 17:47:02 +1100942.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000943.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000944The list of available key exchange algorithms may also be obtained using
945.Qq ssh -Q kex .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000946.It Cm ListenAddress
947Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100948.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000949should listen on.
950The following forms may be used:
951.Pp
952.Bl -item -offset indent -compact
953.It
954.Cm ListenAddress
955.Sm off
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000956.Ar hostname | address
Ben Lindstrom9f049032002-06-21 00:59:05 +0000957.Sm on
jmc@openbsd.org@openbsd.org68d3bbb2017-10-26 06:44:01 +0000958.Op Cm rdomain Ar domain
Ben Lindstrom9f049032002-06-21 00:59:05 +0000959.It
960.Cm ListenAddress
961.Sm off
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000962.Ar hostname : port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000963.Sm on
jmc@openbsd.org@openbsd.org68d3bbb2017-10-26 06:44:01 +0000964.Op Cm rdomain Ar domain
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000965.It
966.Cm ListenAddress
967.Sm off
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000968.Ar IPv4_address : port
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000969.Sm on
jmc@openbsd.org@openbsd.org68d3bbb2017-10-26 06:44:01 +0000970.Op Cm rdomain Ar domain
Ben Lindstrom9f049032002-06-21 00:59:05 +0000971.It
972.Cm ListenAddress
973.Sm off
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000974.Oo Ar hostname | address Oc : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000975.Sm on
jmc@openbsd.org@openbsd.org68d3bbb2017-10-26 06:44:01 +0000976.Op Cm rdomain Ar domain
Ben Lindstrom9f049032002-06-21 00:59:05 +0000977.El
978.Pp
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000979The optional
980.Cm rdomain
981qualifier requests
982.Xr sshd 8
983listen in an explicit routing domain.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000984If
985.Ar port
986is not specified,
dtucker@openbsd.org531a57a2015-04-29 03:48:56 +0000987sshd will listen on the address and all
Ben Lindstrom9f049032002-06-21 00:59:05 +0000988.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000989options specified.
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000990The default is to listen on all local addresses on the current default
991routing domain.
Damien Miller495dca32003-04-01 21:42:14 +1000992Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000993.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000994options are permitted.
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000995For more information on routing domains, see
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000996.Xr rdomain 4 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000997.It Cm LoginGraceTime
998The server disconnects after this time if the user has not
999successfully logged in.
1000If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +10001001The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001002.It Cm LogLevel
1003Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001004.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001005The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +11001006QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +10001007The default is INFO.
1008DEBUG and DEBUG1 are equivalent.
1009DEBUG2 and DEBUG3 each specify higher levels of debugging output.
1010Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001011.It Cm MACs
1012Specifies the available MAC (message authentication code) algorithms.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +00001013The MAC algorithm is used for data integrity protection.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001014Multiple algorithms must be comma-separated.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +00001015If the specified list begins with a
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001016.Sq +
1017character, then the specified algorithms will be appended to the default set
1018instead of replacing them.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +00001019If the specified list begins with a
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001020.Sq -
1021character, then the specified algorithms (including wildcards) will be removed
1022from the default set instead of replacing them.
naddy@openbsd.org91a21352019-09-06 14:45:34 +00001023If the specified list begins with a
1024.Sq ^
1025character, then the specified algorithms will be placed at the head of the
1026default set.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001027.Pp
Damien Milleraf43a7a2012-12-12 10:46:31 +11001028The algorithms that contain
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001029.Qq -etm
Damien Milleraf43a7a2012-12-12 10:46:31 +11001030calculate the MAC after encryption (encrypt-then-mac).
1031These are considered safer and their use recommended.
Damien Millerc1621c82014-04-20 13:22:46 +10001032The supported MACs are:
1033.Pp
1034.Bl -item -compact -offset indent
1035.It
1036hmac-md5
1037.It
1038hmac-md5-96
1039.It
Damien Millerc1621c82014-04-20 13:22:46 +10001040hmac-sha1
1041.It
1042hmac-sha1-96
1043.It
1044hmac-sha2-256
1045.It
1046hmac-sha2-512
1047.It
1048umac-64@openssh.com
1049.It
1050umac-128@openssh.com
1051.It
1052hmac-md5-etm@openssh.com
1053.It
1054hmac-md5-96-etm@openssh.com
1055.It
Damien Millerc1621c82014-04-20 13:22:46 +10001056hmac-sha1-etm@openssh.com
1057.It
1058hmac-sha1-96-etm@openssh.com
1059.It
1060hmac-sha2-256-etm@openssh.com
1061.It
1062hmac-sha2-512-etm@openssh.com
1063.It
1064umac-64-etm@openssh.com
1065.It
1066umac-128-etm@openssh.com
1067.El
1068.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +11001069The default is:
Damien Miller22b7b492007-06-11 14:07:12 +10001070.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +11001071umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1072hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001073hmac-sha1-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +10001074umac-64@openssh.com,umac-128@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001075hmac-sha2-256,hmac-sha2-512,hmac-sha1
Damien Miller22b7b492007-06-11 14:07:12 +10001076.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001077.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001078The list of available MAC algorithms may also be obtained using
1079.Qq ssh -Q mac .
Darren Tucker45150472006-07-12 22:34:17 +10001080.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +10001081Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +10001082If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +10001083.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001084line are satisfied, the keywords on the following lines override those
1085set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +10001086.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001087line or the end of the file.
Damien Millerfc5d6752014-02-28 10:01:28 +11001088If a keyword appears in multiple
1089.Cm Match
sobrado@openbsd.org180bcb42014-08-30 16:32:25 +00001090blocks that are satisfied, only the first instance of the keyword is
Damien Millerfc5d6752014-02-28 10:01:28 +11001091applied.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001092.Pp
Damien Millerd04f3572006-07-24 13:46:50 +10001093The arguments to
Darren Tucker45150472006-07-12 22:34:17 +10001094.Cm Match
Damien Millercf31f382013-10-24 21:02:56 +11001095are one or more criteria-pattern pairs or the single token
1096.Cm All
1097which matches all criteria.
Darren Tucker45150472006-07-12 22:34:17 +10001098The available criteria are
1099.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +10001100.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +10001101.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +10001102.Cm LocalAddress ,
1103.Cm LocalPort ,
djm@openbsd.org68af80e2017-10-25 00:19:47 +00001104.Cm RDomain ,
Darren Tucker45150472006-07-12 22:34:17 +10001105and
djm@openbsd.org68af80e2017-10-25 00:19:47 +00001106.Cm Address
1107(with
1108.Cm RDomain
1109representing the
1110.Xr rdomain 4
jmc@openbsd.org62949c52019-03-22 20:58:34 +00001111on which the connection was received).
djm@openbsd.org68af80e2017-10-25 00:19:47 +00001112.Pp
Darren Tucker7a3935d2008-06-10 22:59:10 +10001113The match patterns may consist of single entries or comma-separated
1114lists and may use the wildcard and negation operators described in the
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001115.Sx PATTERNS
1116section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +10001117.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001118.Pp
1119The patterns in an
1120.Cm Address
1121criteria may additionally contain addresses to match in CIDR
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001122address/masklen format,
1123such as 192.0.2.0/24 or 2001:db8::/32.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001124Note that the mask length provided must be consistent with the address -
1125it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +10001126or one with bits set in this host portion of the address.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001127For example, 192.0.2.0/33 and 192.0.2.0/8, respectively.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001128.Pp
Darren Tucker45150472006-07-12 22:34:17 +10001129Only a subset of keywords may be used on the lines following a
1130.Cm Match
1131keyword.
1132Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +10001133.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +11001134.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +10001135.Cm AllowGroups ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001136.Cm AllowStreamLocalForwarding ,
Damien Miller9b439df2006-07-24 14:04:00 +10001137.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +10001138.Cm AllowUsers ,
Damien Millera6e3f012012-11-04 23:21:40 +11001139.Cm AuthenticationMethods ,
Damien Miller09d3e122012-10-31 08:58:58 +11001140.Cm AuthorizedKeysCommand ,
1141.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +11001142.Cm AuthorizedKeysFile ,
djm@openbsd.orgb6b91082015-11-13 02:57:46 +00001143.Cm AuthorizedPrincipalsCommand ,
1144.Cm AuthorizedPrincipalsCommandUser ,
Damien Millerab6de352010-06-26 09:38:45 +10001145.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +11001146.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +10001147.Cm ChrootDirectory ,
markus@openbsd.orgf0ddede2016-11-23 23:14:15 +00001148.Cm ClientAliveCountMax ,
1149.Cm ClientAliveInterval ,
Damien Millerc24da772012-06-20 21:53:58 +10001150.Cm DenyGroups ,
1151.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +10001152.Cm ForceCommand ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001153.Cm GatewayPorts ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +00001154.Cm GSSAPIAuthentication ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001155.Cm HostbasedAcceptedKeyTypes ,
Damien Miller25434de2008-05-19 14:29:08 +10001156.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +10001157.Cm HostbasedUsesNameFromPacketOnly ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001158.Cm IPQoS ,
Darren Tucker1d75f222007-03-01 21:31:28 +11001159.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +11001160.Cm KerberosAuthentication ,
djm@openbsd.org54cd41a2017-05-17 01:24:17 +00001161.Cm LogLevel ,
Damien Miller307c1d12008-06-16 07:56:20 +10001162.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +10001163.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +11001164.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +11001165.Cm PermitEmptyPasswords ,
djm@openbsd.org04df4322018-06-06 18:24:00 +00001166.Cm PermitListen ,
Damien Millerd1de9952006-07-24 14:05:48 +10001167.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +11001168.Cm PermitRootLogin ,
Damien Miller5ff30c62013-10-30 22:21:50 +11001169.Cm PermitTTY ,
Damien Millerab6de352010-06-26 09:38:45 +10001170.Cm PermitTunnel ,
Damien Miller72e6b5c2014-07-04 09:00:04 +10001171.Cm PermitUserRC ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001172.Cm PubkeyAcceptedKeyTypes ,
Darren Tucker1477ea12009-10-07 08:36:05 +11001173.Cm PubkeyAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001174.Cm RekeyLimit ,
1175.Cm RevokedKeys ,
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001176.Cm RDomain ,
djm@openbsd.org28013752018-06-09 03:03:10 +00001177.Cm SetEnv ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001178.Cm StreamLocalBindMask ,
1179.Cm StreamLocalBindUnlink ,
1180.Cm TrustedUserCAKeys ,
Damien Millerd1de9952006-07-24 14:05:48 +10001181.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +11001182.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +10001183and
jmc@openbsd.org76af9c52019-06-12 05:53:21 +00001184.Cm X11UseLocalhost .
Darren Tucker89413db2004-05-24 10:36:23 +10001185.It Cm MaxAuthTries
1186Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +10001187connection.
1188Once the number of failures reaches half this value,
1189additional failures are logged.
1190The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +10001191.It Cm MaxSessions
djm@openbsd.orgcac3b662016-02-05 02:37:56 +00001192Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1193sessions permitted per network connection.
1194Multiple sessions may be established by clients that support connection
1195multiplexing.
1196Setting
1197.Cm MaxSessions
1198to 1 will effectively disable session multiplexing, whereas setting it to 0
1199will prevent all shell, login and subsystem sessions while still permitting
1200forwarding.
Damien Miller7207f642008-05-19 15:34:50 +10001201The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001202.It Cm MaxStartups
1203Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001204SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001205Additional connections will be dropped until authentication succeeds or the
1206.Cm LoginGraceTime
1207expires for a connection.
Damien Miller1f583df2013-02-12 11:02:08 +11001208The default is 10:30:100.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001209.Pp
1210Alternatively, random early drop can be enabled by specifying
1211the three colon separated values
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001212start:rate:full (e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +11001213.Xr sshd 8
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001214will refuse connection attempts with a probability of rate/100 (30%)
1215if there are currently start (10) unauthenticated connections.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001216The probability increases linearly and all connection attempts
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001217are refused if the number of unauthenticated connections reaches full (60).
Ben Lindstrom9f049032002-06-21 00:59:05 +00001218.It Cm PasswordAuthentication
1219Specifies whether password authentication is allowed.
1220The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001221.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001222.It Cm PermitEmptyPasswords
1223When password authentication is allowed, it specifies whether the
1224server allows login to accounts with empty password strings.
1225The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001226.Cm no .
djm@openbsd.org04df4322018-06-06 18:24:00 +00001227.It Cm PermitListen
1228Specifies the addresses/ports on which a remote TCP port forwarding may listen.
1229The listen specification must be one of the following forms:
1230.Pp
1231.Bl -item -offset indent -compact
1232.It
1233.Cm PermitListen
1234.Sm off
djm@openbsd.org87ddd672018-06-19 02:59:41 +00001235.Ar port
1236.Sm on
1237.It
1238.Cm PermitListen
1239.Sm off
djm@openbsd.org04df4322018-06-06 18:24:00 +00001240.Ar host : port
1241.Sm on
djm@openbsd.org04df4322018-06-06 18:24:00 +00001242.El
1243.Pp
1244Multiple permissions may be specified by separating them with whitespace.
1245An argument of
1246.Cm any
1247can be used to remove all restrictions and permit any listen requests.
1248An argument of
1249.Cm none
1250can be used to prohibit all listen requests.
1251The host name may contain wildcards as described in the PATTERNS section in
1252.Xr ssh_config 5 .
1253The wildcard
1254.Sq *
1255can also be used in place of a port number to allow all ports.
1256By default all port forwarding listen requests are permitted.
jmc@openbsd.org6ff6fda2018-06-07 11:26:14 +00001257Note that the
djm@openbsd.org04df4322018-06-06 18:24:00 +00001258.Cm GatewayPorts
1259option may further restrict which addresses may be listened on.
djm@openbsd.org87ddd672018-06-19 02:59:41 +00001260Note also that
1261.Xr ssh 1
1262will request a listen host of
1263.Dq localhost
dtucker@openbsd.org177d6c82019-01-23 20:48:52 +00001264if no listen host was specifically requested, and this name is
jmc@openbsd.orgf535ff92018-06-19 05:36:57 +00001265treated differently to explicit localhost addresses of
djm@openbsd.org87ddd672018-06-19 02:59:41 +00001266.Dq 127.0.0.1
1267and
1268.Dq ::1 .
Damien Miller9b439df2006-07-24 14:04:00 +10001269.It Cm PermitOpen
1270Specifies the destinations to which TCP port forwarding is permitted.
1271The forwarding specification must be one of the following forms:
1272.Pp
1273.Bl -item -offset indent -compact
1274.It
1275.Cm PermitOpen
1276.Sm off
1277.Ar host : port
1278.Sm on
1279.It
1280.Cm PermitOpen
1281.Sm off
1282.Ar IPv4_addr : port
1283.Sm on
1284.It
1285.Cm PermitOpen
1286.Sm off
1287.Ar \&[ IPv6_addr \&] : port
1288.Sm on
1289.El
1290.Pp
Damien Millera765cf42006-07-24 14:08:13 +10001291Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +10001292An argument of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001293.Cm any
Damien Miller9b439df2006-07-24 14:04:00 +10001294can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +10001295An argument of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001296.Cm none
Darren Tuckerba9ea322012-05-19 19:37:33 +10001297can be used to prohibit all forwarding requests.
jmc@openbsd.org32d921c2016-07-19 12:59:16 +00001298The wildcard
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001299.Sq *
jmc@openbsd.org32d921c2016-07-19 12:59:16 +00001300can be used for host or port to allow all hosts or ports, respectively.
Damien Miller65bc2c42006-07-24 14:04:16 +10001301By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001302.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +11001303Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +00001304.Xr ssh 1 .
1305The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001306.Cm yes ,
1307.Cm prohibit-password ,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001308.Cm forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001309or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001310.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001311The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001312.Cm prohibit-password .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001313.Pp
1314If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001315.Cm prohibit-password
jmc@openbsd.org071325f2017-10-13 16:50:45 +00001316(or its deprecated alias,
1317.Cm without-password ) ,
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001318password and keyboard-interactive authentication are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001319.Pp
1320If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001321.Cm forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001322root login with public key authentication will be allowed,
1323but only if the
1324.Ar command
1325option has been specified
1326(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +10001327normally not allowed).
1328All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001329.Pp
1330If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001331.Cm no ,
Darren Tuckerb3509012005-01-20 11:01:46 +11001332root is not allowed to log in.
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +00001333.It Cm PermitTTY
1334Specifies whether
1335.Xr pty 4
1336allocation is permitted.
1337The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001338.Cm yes .
Damien Millerd27b9472005-12-13 19:29:02 +11001339.It Cm PermitTunnel
1340Specifies whether
1341.Xr tun 4
1342device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +11001343The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001344.Cm yes ,
1345.Cm point-to-point
Damien Miller991dba42006-07-10 20:16:27 +10001346(layer 3),
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001347.Cm ethernet
Damien Miller991dba42006-07-10 20:16:27 +10001348(layer 2), or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001349.Cm no .
Damien Miller991dba42006-07-10 20:16:27 +10001350Specifying
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001351.Cm yes
Damien Miller991dba42006-07-10 20:16:27 +10001352permits both
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001353.Cm point-to-point
Damien Miller991dba42006-07-10 20:16:27 +10001354and
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001355.Cm ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +11001356The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001357.Cm no .
djm@openbsd.org48dffd52014-09-09 09:45:36 +00001358.Pp
1359Independent of this setting, the permissions of the selected
1360.Xr tun 4
1361device must allow access to the user.
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001362.It Cm PermitUserEnvironment
1363Specifies whether
1364.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001365and
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001366.Cm environment=
1367options in
1368.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001369are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +11001370.Xr sshd 8 .
djm@openbsd.org95344c22018-07-03 10:59:35 +00001371Valid options are
1372.Cm yes ,
1373.Cm no
1374or a pattern-list specifying which environment variable names to accept
1375(for example
1376.Qq LANG,LC_* ) .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001377The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001378.Cm no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001379Enabling environment processing may enable users to bypass access
1380restrictions in some configurations using mechanisms such as
1381.Ev LD_PRELOAD .
Damien Miller72e6b5c2014-07-04 09:00:04 +10001382.It Cm PermitUserRC
1383Specifies whether any
1384.Pa ~/.ssh/rc
1385file is executed.
1386The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001387.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001388.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +00001389Specifies the file that contains the process ID of the
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001390SSH daemon, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001391.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001392to not write one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001393The default is
1394.Pa /var/run/sshd.pid .
1395.It Cm Port
1396Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +11001397.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001398listens on.
1399The default is 22.
1400Multiple options of this type are permitted.
1401See also
1402.Cm ListenAddress .
1403.It Cm PrintLastLog
1404Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001405.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +11001406should print the date and time of the last user login when a user logs
1407in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001408The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001409.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001410.It Cm PrintMotd
1411Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001412.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001413should print
1414.Pa /etc/motd
1415when a user logs in interactively.
1416(On some systems it is also printed by the shell,
1417.Pa /etc/profile ,
1418or equivalent.)
1419The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001420.Cm yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001421.It Cm PubkeyAcceptedKeyTypes
1422Specifies the key types that will be accepted for public key authentication
djm@openbsd.org312d2f22018-07-04 13:49:31 +00001423as a list of comma-separated patterns.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +00001424Alternately if the specified list begins with a
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001425.Sq +
1426character, then the specified key types will be appended to the default set
1427instead of replacing them.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +00001428If the specified list begins with a
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001429.Sq -
1430character, then the specified key types (including wildcards) will be removed
1431from the default set instead of replacing them.
naddy@openbsd.org91a21352019-09-06 14:45:34 +00001432If the specified list begins with a
1433.Sq ^
1434character, then the specified key types will be placed at the head of the
1435default set.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001436The default for this option is:
1437.Bd -literal -offset 3n
1438ecdsa-sha2-nistp256-cert-v01@openssh.com,
1439ecdsa-sha2-nistp384-cert-v01@openssh.com,
1440ecdsa-sha2-nistp521-cert-v01@openssh.com,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +00001441sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001442ssh-ed25519-cert-v01@openssh.com,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +00001443sk-ssh-ed25519-cert-v01@openssh.com,
naddy@openbsd.orgaa4c6402019-11-07 08:38:38 +00001444rsa-sha2-512-cert-v01@openssh.com,
1445rsa-sha2-256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001446ssh-rsa-cert-v01@openssh.com,
1447ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +00001448sk-ecdsa-sha2-nistp256@openssh.com,
1449ssh-ed25519,sk-ssh-ed25519@openssh.com,
1450rsa-sha2-512,rsa-sha2-256,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001451.Ed
1452.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001453The list of available key types may also be obtained using
1454.Qq ssh -Q key .
djm@openbsd.org0fddf292019-11-25 00:52:46 +00001455.It Cm PubkeyAuthOptions
1456Sets one or more public key authentication options.
1457Two option keywords are currently supported:
jmc@openbsd.org8635afa2019-11-26 22:42:26 +00001458.Cm none
1459(the default; indicating no additional options are enabled)
djm@openbsd.org0fddf292019-11-25 00:52:46 +00001460and
1461.Cm touch-required .
1462.Pp
1463The
1464.Cm touch-required
naddy@openbsd.org141df482019-12-21 20:22:34 +00001465option causes public key authentication using a FIDO authenticator algorithm
jmc@openbsd.org8635afa2019-11-26 22:42:26 +00001466(i.e.\&
djm@openbsd.org0fddf292019-11-25 00:52:46 +00001467.Cm ecdsa-sk
1468or
1469.Cm ed25519-sk )
1470to always require the signature to attest that a physically present user
naddy@openbsd.org141df482019-12-21 20:22:34 +00001471explicitly confirmed the authentication (usually by touching the authenticator).
djm@openbsd.org0fddf292019-11-25 00:52:46 +00001472By default,
1473.Xr sshd 8
naddy@openbsd.org141df482019-12-21 20:22:34 +00001474requires user presence unless overridden with an authorized_keys option.
djm@openbsd.org0fddf292019-11-25 00:52:46 +00001475The
1476.Cm touch-required
1477flag disables this override.
naddy@openbsd.org141df482019-12-21 20:22:34 +00001478This option has no effect for other, non-authenticator public key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001479.It Cm PubkeyAuthentication
1480Specifies whether public key authentication is allowed.
1481The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001482.Cm yes .
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001483.It Cm RekeyLimit
1484Specifies the maximum amount of data that may be transmitted before the
1485session key is renegotiated, optionally followed a maximum amount of
1486time that may pass before the session key is renegotiated.
1487The first argument is specified in bytes and may have a suffix of
1488.Sq K ,
1489.Sq M ,
1490or
1491.Sq G
1492to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1493The default is between
1494.Sq 1G
1495and
1496.Sq 4G ,
1497depending on the cipher.
1498The optional second value is specified in seconds and may use any of the
1499units documented in the
1500.Sx TIME FORMATS
Darren Tucker64d22942013-05-16 20:31:29 +10001501section.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001502The default value for
1503.Cm RekeyLimit
1504is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001505.Cm default none ,
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001506which means that rekeying is performed after the cipher's default amount
1507of data has been sent or received and no time based rekeying is done.
Damien Miller1aed65e2010-03-04 21:53:35 +11001508.It Cm RevokedKeys
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001509Specifies revoked public keys file, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001510.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001511to not use one.
Damien Miller1aed65e2010-03-04 21:53:35 +11001512Keys listed in this file will be refused for public key authentication.
1513Note that if this file is not readable, then public key authentication will
1514be refused for all users.
Damien Millerf3747bf2013-01-18 11:44:04 +11001515Keys may be specified as a text file, listing one public key per line, or as
1516an OpenSSH Key Revocation List (KRL) as generated by
Damien Miller72abeb72013-01-20 22:33:44 +11001517.Xr ssh-keygen 1 .
Damien Millerfecfd112013-07-18 16:11:50 +10001518For more information on KRLs, see the KEY REVOCATION LISTS section in
Damien Millerf3747bf2013-01-18 11:44:04 +11001519.Xr ssh-keygen 1 .
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001520.It Cm RDomain
1521Specifies an explicit routing domain that is applied after authentication
1522has completed.
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +00001523The user session, as well and any forwarded or listening IP sockets,
1524will be bound to this
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001525.Xr rdomain 4 .
1526If the routing domain is set to
1527.Cm \&%D ,
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +00001528then the domain in which the incoming connection was received will be applied.
naddy@openbsd.orgae024b22019-12-19 15:09:30 +00001529.It Cm SecurityKeyProvider
naddy@openbsd.org141df482019-12-21 20:22:34 +00001530Specifies a path to a library that will be used when loading
1531FIDO authenticator-hosted keys, overriding the default of using
1532the built-in USB HID support.
djm@openbsd.org28013752018-06-09 03:03:10 +00001533.It Cm SetEnv
1534Specifies one or more environment variables to set in child sessions started
1535by
1536.Xr sshd 8
1537as
1538.Dq NAME=VALUE .
1539The environment value may be quoted (e.g. if it contains whitespace
1540characters).
1541Environment variables set by
1542.Cm SetEnv
1543override the default environment and any variables specified by the user
1544via
1545.Cm AcceptEnv
1546or
1547.Cm PermitUserEnvironment .
Damien Miller7acefbb2014-07-18 14:11:24 +10001548.It Cm StreamLocalBindMask
1549Sets the octal file creation mode mask
1550.Pq umask
1551used when creating a Unix-domain socket file for local or remote
1552port forwarding.
1553This option is only used for port forwarding to a Unix-domain socket file.
1554.Pp
1555The default value is 0177, which creates a Unix-domain socket file that is
1556readable and writable only by the owner.
1557Note that not all operating systems honor the file mode on Unix-domain
1558socket files.
1559.It Cm StreamLocalBindUnlink
1560Specifies whether to remove an existing Unix-domain socket file for local
1561or remote port forwarding before creating a new one.
1562If the socket file already exists and
1563.Cm StreamLocalBindUnlink
1564is not enabled,
1565.Nm sshd
1566will be unable to forward the port to the Unix-domain socket file.
1567This option is only used for port forwarding to a Unix-domain socket file.
1568.Pp
1569The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001570.Cm yes
Damien Miller7acefbb2014-07-18 14:11:24 +10001571or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001572.Cm no .
Damien Miller7acefbb2014-07-18 14:11:24 +10001573The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001574.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001575.It Cm StrictModes
1576Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001577.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001578should check file modes and ownership of the
1579user's files and home directory before accepting login.
1580This is normally desirable because novices sometimes accidentally leave their
1581directory or files world-writable.
1582The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001583.Cm yes .
Darren Tuckerf788a912010-01-08 17:06:47 +11001584Note that this does not apply to
1585.Cm ChrootDirectory ,
1586whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001587.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +11001588Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +10001589Arguments should be a subsystem name and a command (with optional arguments)
1590to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001591.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001592The command
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001593.Cm sftp-server
1594implements the SFTP file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001595.Pp
1596Alternately the name
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001597.Cm internal-sftp
1598implements an in-process SFTP server.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001599This may simplify configurations using
1600.Cm ChrootDirectory
1601to force a different filesystem root on clients.
1602.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001603By default no subsystems are defined.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001604.It Cm SyslogFacility
1605Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001606.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001607The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1608LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1609The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001610.It Cm TCPKeepAlive
1611Specifies whether the system should send TCP keepalive messages to the
1612other side.
1613If they are sent, death of the connection or crash of one
1614of the machines will be properly noticed.
1615However, this means that
1616connections will die if the route is down temporarily, and some people
1617find it annoying.
1618On the other hand, if TCP keepalives are not sent,
1619sessions may hang indefinitely on the server, leaving
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001620.Qq ghost
Damien Miller12c150e2003-12-17 16:31:10 +11001621users and consuming server resources.
1622.Pp
1623The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001624.Cm yes
Damien Miller12c150e2003-12-17 16:31:10 +11001625(to send TCP keepalive messages), and the server will notice
1626if the network goes down or the client host crashes.
1627This avoids infinitely hanging sessions.
1628.Pp
1629To disable TCP keepalive messages, the value should be set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001630.Cm no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001631.It Cm TrustedUserCAKeys
1632Specifies a file containing public keys of certificate authorities that are
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001633trusted to sign user certificates for authentication, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001634.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001635to not use one.
Damien Miller72b33822010-03-05 07:39:01 +11001636Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001637.Ql #
1638are allowed.
1639If a certificate is presented for authentication and has its signing CA key
1640listed in this file, then it may be used for authentication for any user
1641listed in the certificate's principals list.
1642Note that certificates that lack a list of principals will not be permitted
1643for authentication using
1644.Cm TrustedUserCAKeys .
Damien Millerfecfd112013-07-18 16:11:50 +10001645For more details on certificates, see the CERTIFICATES section in
Damien Miller1aed65e2010-03-04 21:53:35 +11001646.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001647.It Cm UseDNS
1648Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001649.Xr sshd 8
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001650should look up the remote host name, and to check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001651the resolved host name for the remote IP address maps back to the
1652very same IP address.
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001653.Pp
1654If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001655.Cm no
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001656(the default) then only addresses and not host names may be used in
djm@openbsd.org0235a5f2016-03-17 17:19:43 +00001657.Pa ~/.ssh/authorized_keys
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001658.Cm from
1659and
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +00001660.Nm
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001661.Cm Match
1662.Cm Host
1663directives.
Damien Miller2e193e22003-05-14 15:13:03 +10001664.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001665Enables the Pluggable Authentication Module interface.
1666If set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001667.Cm yes
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001668this will enable PAM authentication using
1669.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001670and
1671.Cm PasswordAuthentication
1672in addition to PAM account and session module processing for all
1673authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001674.Pp
1675Because PAM challenge-response authentication usually serves an equivalent
1676role to password authentication, you should disable either
1677.Cm PasswordAuthentication
1678or
1679.Cm ChallengeResponseAuthentication.
1680.Pp
1681If
1682.Cm UsePAM
1683is enabled, you will not be able to run
1684.Xr sshd 8
1685as a non-root user.
1686The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001687.Cm no .
Damien Miller23528812012-04-22 11:24:43 +10001688.It Cm VersionAddendum
1689Optionally specifies additional text to append to the SSH protocol banner
1690sent by the server upon connection.
1691The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001692.Cm none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001693.It Cm X11DisplayOffset
1694Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001695.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001696X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001697This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001698The default is 10.
1699.It Cm X11Forwarding
1700Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001701The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001702.Cm yes
Damien Miller101c4a72002-09-19 11:51:21 +10001703or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001704.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001705The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001706.Cm no .
Damien Miller101c4a72002-09-19 11:51:21 +10001707.Pp
1708When X11 forwarding is enabled, there may be additional exposure to
1709the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001710.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001711proxy display is configured to listen on the wildcard address (see
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001712.Cm X11UseLocalhost ) ,
1713though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001714Additionally, the authentication spoofing and authentication data
1715verification and substitution occur on the client side.
1716The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001717display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001718forwarding (see the warnings for
1719.Cm ForwardX11
1720in
Damien Millerf1ce5052003-06-11 22:04:39 +10001721.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001722A system administrator may have a stance in which they want to
1723protect clients that may expose themselves to attack by unwittingly
1724requesting X11 forwarding, which can warrant a
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001725.Cm no
Damien Miller101c4a72002-09-19 11:51:21 +10001726setting.
1727.Pp
1728Note that disabling X11 forwarding does not prevent users from
1729forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001730.It Cm X11UseLocalhost
1731Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001732.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001733should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001734the wildcard address.
1735By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001736sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001737hostname part of the
1738.Ev DISPLAY
1739environment variable to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001740.Cm localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001741This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001742However, some older X11 clients may not function with this
1743configuration.
1744.Cm X11UseLocalhost
1745may be set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001746.Cm no
Ben Lindstrom9f049032002-06-21 00:59:05 +00001747to specify that the forwarding server should be bound to the wildcard
1748address.
1749The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001750.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +00001751or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001752.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001753The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001754.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001755.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001756Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001757.Xr xauth 1
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001758program, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001759.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001760to not use one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001761The default is
1762.Pa /usr/X11R6/bin/xauth .
1763.El
Damien Millere3beba22006-03-15 11:59:25 +11001764.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001765.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001766command-line arguments and configuration file options that specify time
1767may be expressed using a sequence of the form:
1768.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001769.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001770.Sm on
1771where
1772.Ar time
1773is a positive integer value and
1774.Ar qualifier
1775is one of the following:
1776.Pp
1777.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001778.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001779seconds
1780.It Cm s | Cm S
1781seconds
1782.It Cm m | Cm M
1783minutes
1784.It Cm h | Cm H
1785hours
1786.It Cm d | Cm D
1787days
1788.It Cm w | Cm W
1789weeks
1790.El
1791.Pp
1792Each member of the sequence is added together to calculate
1793the total time value.
1794.Pp
1795Time format examples:
1796.Pp
1797.Bl -tag -width Ds -compact -offset indent
1798.It 600
1799600 seconds (10 minutes)
1800.It 10m
180110 minutes
1802.It 1h30m
18031 hour 30 minutes (90 minutes)
1804.El
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001805.Sh TOKENS
1806Arguments to some keywords can make use of tokens,
1807which are expanded at runtime:
1808.Pp
1809.Bl -tag -width XXXX -offset indent -compact
1810.It %%
1811A literal
1812.Sq % .
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001813.It \&%D
1814The routing domain in which the incoming connection was received.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001815.It %F
1816The fingerprint of the CA key.
1817.It %f
1818The fingerprint of the key or certificate.
1819.It %h
1820The home directory of the user.
1821.It %i
1822The key ID in the certificate.
1823.It %K
1824The base64-encoded CA key.
1825.It %k
1826The base64-encoded key or certificate for authentication.
1827.It %s
1828The serial number of the certificate.
1829.It \&%T
1830The type of the CA key.
1831.It %t
1832The key or certificate type.
jmc@openbsd.org29402842018-06-01 05:50:18 +00001833.It \&%U
1834The numeric user ID of the target user.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001835.It %u
1836The username.
1837.El
1838.Pp
1839.Cm AuthorizedKeysCommand
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001840accepts the tokens %%, %f, %h, %k, %t, %U, and %u.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001841.Pp
1842.Cm AuthorizedKeysFile
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001843accepts the tokens %%, %h, %U, and %u.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001844.Pp
1845.Cm AuthorizedPrincipalsCommand
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001846accepts the tokens %%, %F, %f, %h, %i, %K, %k, %s, %T, %t, %U, and %u.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001847.Pp
1848.Cm AuthorizedPrincipalsFile
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001849accepts the tokens %%, %h, %U, and %u.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001850.Pp
1851.Cm ChrootDirectory
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001852accepts the tokens %%, %h, %U, and %u.
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001853.Pp
1854.Cm RoutingDomain
1855accepts the token %D.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001856.Sh FILES
1857.Bl -tag -width Ds
1858.It Pa /etc/ssh/sshd_config
1859Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001860.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001861This file should be writable by root only, but it is recommended
1862(though not necessary) that it be world-readable.
1863.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001864.Sh SEE ALSO
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001865.Xr sftp-server 8 ,
Damien Millerf1ce5052003-06-11 22:04:39 +10001866.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001867.Sh AUTHORS
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001868.An -nosplit
Ben Lindstrom9f049032002-06-21 00:59:05 +00001869OpenSSH is a derivative of the original and free
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001870ssh 1.2.12 release by
1871.An Tatu Ylonen .
1872.An Aaron Campbell , Bob Beck , Markus Friedl , Niels Provos ,
1873.An Theo de Raadt
1874and
1875.An Dug Song
Ben Lindstrom9f049032002-06-21 00:59:05 +00001876removed many bugs, re-added newer features and
1877created OpenSSH.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001878.An Markus Friedl
1879contributed the support for SSH protocol versions 1.5 and 2.0.
1880.An Niels Provos
1881and
1882.An Markus Friedl
1883contributed support for privilege separation.