blob: e6ae8714507e975e09032243c313e169a7fb0a6b [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.\"
dtucker@openbsd.org8fdbc722019-08-09 04:24:03 +000036.\" $OpenBSD: sshd_config.5,v 1.288 2019/08/09 04:24:03 dtucker Exp $
37.Dd $Mdocdate: August 9 2019 $
Ben Lindstrom9f049032002-06-21 00:59:05 +000038.Dt SSHD_CONFIG 5
39.Os
40.Sh NAME
41.Nm sshd_config
42.Nd OpenSSH SSH daemon configuration file
Ben Lindstrom9f049032002-06-21 00:59:05 +000043.Sh DESCRIPTION
Damien Millerf4f22b52006-03-15 11:57:25 +110044.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +000045reads configuration data from
46.Pa /etc/ssh/sshd_config
47(or the file specified with
48.Fl f
49on the command line).
50The file contains keyword-argument pairs, one per line.
benno@openbsd.orgcfa46822017-10-09 20:12:51 +000051For each keyword, the first obtained value will be used.
Ben Lindstrom9f049032002-06-21 00:59:05 +000052Lines starting with
53.Ql #
54and empty lines are interpreted as comments.
Damien Miller306d1182006-03-15 12:05:59 +110055Arguments may optionally be enclosed in double quotes
56.Pq \&"
57in order to represent arguments containing spaces.
Ben Lindstrom9f049032002-06-21 00:59:05 +000058.Pp
59The possible
60keywords and their meanings are as follows (note that
61keywords are case-insensitive and arguments are case-sensitive):
62.Bl -tag -width Ds
Darren Tucker46bc0752004-05-02 22:11:30 +100063.It Cm AcceptEnv
64Specifies what environment variables sent by the client will be copied into
65the session's
66.Xr environ 7 .
67See
68.Cm SendEnv
djm@openbsd.org7082bb52018-06-09 03:01:12 +000069and
70.Cm SetEnv
Darren Tucker46bc0752004-05-02 22:11:30 +100071in
72.Xr ssh_config 5
73for how to configure the client.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +000074The
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +000075.Ev TERM
djm@openbsd.org1678d422018-06-09 03:18:11 +000076environment variable is always accepted whenever the client
djm@openbsd.org732d61f2015-06-05 03:44:14 +000077requests a pseudo-terminal as it is required by the protocol.
Darren Tucker46bc0752004-05-02 22:11:30 +100078Variables are specified by name, which may contain the wildcard characters
Damien Miller208f1ed2006-03-15 11:56:03 +110079.Ql *
Darren Tucker46bc0752004-05-02 22:11:30 +100080and
81.Ql \&? .
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100082Multiple environment variables may be separated by whitespace or spread
Darren Tucker46bc0752004-05-02 22:11:30 +100083across multiple
84.Cm AcceptEnv
85directives.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100086Be warned that some environment variables could be used to bypass restricted
Darren Tucker46bc0752004-05-02 22:11:30 +100087user environments.
88For this reason, care should be taken in the use of this directive.
89The default is not to accept any environment variables.
Darren Tucker0f383232005-01-20 10:57:56 +110090.It Cm AddressFamily
91Specifies which address family should be used by
Damien Millerf4f22b52006-03-15 11:57:25 +110092.Xr sshd 8 .
Darren Tucker0f383232005-01-20 10:57:56 +110093Valid arguments are
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +000094.Cm any
95(the default),
96.Cm inet
Damien Miller5b0d63f2006-03-15 11:56:56 +110097(use IPv4 only), or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +000098.Cm inet6
Darren Tucker0f383232005-01-20 10:57:56 +110099(use IPv6 only).
Damien Millere9890192008-05-19 14:59:02 +1000100.It Cm AllowAgentForwarding
101Specifies whether
102.Xr ssh-agent 1
103forwarding is permitted.
104The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000105.Cm yes .
Damien Millere9890192008-05-19 14:59:02 +1000106Note that disabling agent forwarding does not improve security
107unless users are also denied shell access, as they can always install
108their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000109.It Cm AllowGroups
110This keyword can be followed by a list of group name patterns, separated
111by spaces.
112If specified, login is allowed only for users whose primary
113group or supplementary group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000114Only group names are valid; a numerical group ID is not recognized.
115By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100116The allow/deny directives are processed in the following order:
117.Cm DenyUsers ,
118.Cm AllowUsers ,
119.Cm DenyGroups ,
120and finally
121.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100122.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000123See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100124.Xr ssh_config 5
125for more information on patterns.
Damien Miller7acefbb2014-07-18 14:11:24 +1000126.It Cm AllowStreamLocalForwarding
127Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
128The available options are
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000129.Cm yes
130(the default)
Damien Miller7acefbb2014-07-18 14:11:24 +1000131or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000132.Cm all
Damien Miller7acefbb2014-07-18 14:11:24 +1000133to allow StreamLocal forwarding,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000134.Cm no
Damien Miller7acefbb2014-07-18 14:11:24 +1000135to prevent all StreamLocal forwarding,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000136.Cm local
Damien Miller7acefbb2014-07-18 14:11:24 +1000137to allow local (from the perspective of
138.Xr ssh 1 )
139forwarding only or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000140.Cm remote
Damien Miller7acefbb2014-07-18 14:11:24 +1000141to allow remote forwarding only.
Damien Miller7acefbb2014-07-18 14:11:24 +1000142Note that disabling StreamLocal forwarding does not improve security unless
143users are also denied shell access, as they can always install their
144own forwarders.
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000145.It Cm AllowTcpForwarding
146Specifies whether TCP forwarding is permitted.
147The available options are
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000148.Cm yes
149(the default)
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000150or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000151.Cm all
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000152to allow TCP forwarding,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000153.Cm no
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000154to prevent all TCP forwarding,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000155.Cm local
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000156to allow local (from the perspective of
157.Xr ssh 1 )
158forwarding only or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000159.Cm remote
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000160to allow remote forwarding only.
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000161Note that disabling TCP forwarding does not improve security unless
162users are also denied shell access, as they can always install their
163own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000164.It Cm AllowUsers
165This keyword can be followed by a list of user name patterns, separated
166by spaces.
Damien Miller5a93add2003-01-24 11:34:52 +1100167If specified, login is allowed only for user names that
Ben Lindstrom9f049032002-06-21 00:59:05 +0000168match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000169Only user names are valid; a numerical user ID is not recognized.
170By default, login is allowed for all users.
171If the pattern takes the form USER@HOST then USER and HOST
172are separately checked, restricting logins to particular
173users from particular hosts.
jmc@openbsd.orgee1e0a12016-04-27 13:53:48 +0000174HOST criteria may additionally contain addresses to match in CIDR
175address/masklen format.
Damien Millerac73e512006-03-15 11:58:49 +1100176The allow/deny directives are processed in the following order:
177.Cm DenyUsers ,
178.Cm AllowUsers ,
179.Cm DenyGroups ,
180and finally
181.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100182.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000183See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100184.Xr ssh_config 5
185for more information on patterns.
Damien Millera6e3f012012-11-04 23:21:40 +1100186.It Cm AuthenticationMethods
187Specifies the authentication methods that must be successfully completed
188for a user to be granted access.
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.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000457If the specified value begins with a
458.Sq +
459character, then the specified ciphers will be appended to the default set
460instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000461If the specified value begins with a
462.Sq -
463character, then the specified ciphers (including wildcards) will be removed
464from the default set instead of replacing them.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000465.Pp
Damien Miller0fde8ac2013-11-21 14:12:23 +1100466The supported ciphers are:
467.Pp
Damien Millerc1621c82014-04-20 13:22:46 +1000468.Bl -item -compact -offset indent
469.It
4703des-cbc
471.It
472aes128-cbc
473.It
474aes192-cbc
475.It
476aes256-cbc
477.It
478aes128-ctr
479.It
480aes192-ctr
481.It
482aes256-ctr
483.It
484aes128-gcm@openssh.com
485.It
486aes256-gcm@openssh.com
487.It
Damien Millerc1621c82014-04-20 13:22:46 +1000488chacha20-poly1305@openssh.com
489.El
Damien Miller0fde8ac2013-11-21 14:12:23 +1100490.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100491The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000492.Bd -literal -offset indent
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000493chacha20-poly1305@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000494aes128-ctr,aes192-ctr,aes256-ctr,
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000495aes128-gcm@openssh.com,aes256-gcm@openssh.com
Ben Lindstrom9f049032002-06-21 00:59:05 +0000496.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100497.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000498The list of available ciphers may also be obtained using
499.Qq ssh -Q cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000500.It Cm ClientAliveCountMax
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000501Sets the number of client alive messages which may be sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100502.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000503receiving any messages back from the client.
504If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100505sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000506It is important to note that the use of client alive messages is very
507different from
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000508.Cm TCPKeepAlive .
Damien Millerfbf486b2003-05-23 18:44:23 +1000509The client alive messages are sent through the encrypted channel
510and therefore will not be spoofable.
511The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100512.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000513is spoofable.
514The client alive mechanism is valuable when the client or
dtucker@openbsd.org8fdbc722019-08-09 04:24:03 +0000515server depend on knowing when a connection has become unresponsive.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000516.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000517The default value is 3.
518If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000519.Cm ClientAliveInterval
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000520is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000521.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100522is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000523will be disconnected after approximately 45 seconds.
Damien Miller1594ad52005-05-26 12:12:19 +1000524.It Cm ClientAliveInterval
525Sets a timeout interval in seconds after which if no data has been received
526from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100527.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000528will send a message through the encrypted
529channel to request a response from the client.
530The default
531is 0, indicating that these messages will not be sent to the client.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000532.It Cm Compression
djm@openbsd.org4577ade2016-09-28 20:32:42 +0000533Specifies whether compression is enabled after
Damien Miller9786e6e2005-07-26 21:54:56 +1000534the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000535The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000536.Cm yes ,
537.Cm delayed
djm@openbsd.org4577ade2016-09-28 20:32:42 +0000538(a legacy synonym for
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000539.Cm yes )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000540or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000541.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000542The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000543.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000544.It Cm DenyGroups
545This keyword can be followed by a list of group name patterns, separated
546by spaces.
547Login is disallowed for users whose primary group or supplementary
548group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000549Only group names are valid; a numerical group ID is not recognized.
550By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100551The allow/deny directives are processed in the following order:
552.Cm DenyUsers ,
553.Cm AllowUsers ,
554.Cm DenyGroups ,
555and finally
556.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100557.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000558See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100559.Xr ssh_config 5
560for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000561.It Cm DenyUsers
562This keyword can be followed by a list of user name patterns, separated
563by spaces.
564Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000565Only user names are valid; a numerical user ID is not recognized.
566By default, login is allowed for all users.
567If the pattern takes the form USER@HOST then USER and HOST
568are separately checked, restricting logins to particular
569users from particular hosts.
jmc@openbsd.orgee1e0a12016-04-27 13:53:48 +0000570HOST criteria may additionally contain addresses to match in CIDR
571address/masklen format.
Damien Millerac73e512006-03-15 11:58:49 +1100572The allow/deny directives are processed in the following order:
573.Cm DenyUsers ,
574.Cm AllowUsers ,
575.Cm DenyGroups ,
576and finally
577.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100578.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000579See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100580.Xr ssh_config 5
581for more information on patterns.
djm@openbsd.org7844f352016-11-30 03:00:05 +0000582.It Cm DisableForwarding
583Disables all forwarding features, including X11,
584.Xr ssh-agent 1 ,
585TCP and StreamLocal.
586This option overrides all other forwarding-related options and may
587simplify restricted configurations.
djm@openbsd.org8f574952017-06-24 06:34:38 +0000588.It Cm ExposeAuthInfo
jmc@openbsd.org5fa14072017-09-27 06:45:53 +0000589Writes a temporary file containing a list of authentication methods and
djm@openbsd.org8f574952017-06-24 06:34:38 +0000590public credentials (e.g. keys) used to authenticate the user.
jmc@openbsd.org40962192017-06-24 06:57:04 +0000591The location of the file is exposed to the user session through the
djm@openbsd.orgf17ee612017-06-24 07:08:57 +0000592.Ev SSH_USER_AUTH
jmc@openbsd.org40962192017-06-24 06:57:04 +0000593environment variable.
jmc@openbsd.org5fa14072017-09-27 06:45:53 +0000594The default is
595.Cm no .
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000596.It Cm FingerprintHash
597Specifies the hash algorithm used when logging key fingerprints.
598Valid options are:
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000599.Cm md5
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000600and
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000601.Cm sha256 .
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000602The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000603.Cm sha256 .
Damien Millere2754432006-07-24 14:06:47 +1000604.It Cm ForceCommand
605Forces the execution of the command specified by
606.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100607ignoring any command supplied by the client and
608.Pa ~/.ssh/rc
609if present.
Damien Millere2754432006-07-24 14:06:47 +1000610The command is invoked by using the user's login shell with the -c option.
611This applies to shell, command, or subsystem execution.
612It is most useful inside a
613.Cm Match
614block.
615The command originally supplied by the client is available in the
616.Ev SSH_ORIGINAL_COMMAND
617environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100618Specifying a command of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000619.Cm internal-sftp
620will force the use of an in-process SFTP server that requires no support
Damien Millercdb6e652008-02-10 22:47:24 +1100621files when used with
622.Cm ChrootDirectory .
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000623The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000624.Cm none .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000625.It Cm GatewayPorts
626Specifies whether remote hosts are allowed to connect to ports
627forwarded for the client.
628By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100629.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000630binds remote port forwardings to the loopback address.
631This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000632.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100633can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100634should allow remote port forwardings to bind to non-loopback addresses, thus
635allowing other hosts to connect.
636The argument may be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000637.Cm no
Damien Millerf91ee4c2005-03-01 21:24:33 +1100638to force remote port forwardings to be available to the local host only,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000639.Cm yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100640to force remote port forwardings to bind to the wildcard address, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000641.Cm clientspecified
Damien Millerf91ee4c2005-03-01 21:24:33 +1100642to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000643The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000644.Cm no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000645.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000646Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100647The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000648.Cm no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000649.It Cm GSSAPICleanupCredentials
650Specifies whether to automatically destroy the user's credentials cache
651on logout.
652The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000653.Cm yes .
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000654.It Cm GSSAPIStrictAcceptorCheck
655Determines whether to be strict about the identity of the GSSAPI acceptor
656a client authenticates against.
657If set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000658.Cm yes
659then the client must authenticate against the host
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000660service on the current hostname.
661If set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000662.Cm no
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000663then the client may authenticate against any service key stored in the
664machine's default store.
665This facility is provided to assist with operation on multi homed machines.
666The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000667.Cm yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000668.It Cm HostbasedAcceptedKeyTypes
669Specifies the key types that will be accepted for hostbased authentication
djm@openbsd.org312d2f22018-07-04 13:49:31 +0000670as a list of comma-separated patterns.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000671Alternately if the specified value begins with a
672.Sq +
673character, then the specified key types will be appended to the default set
674instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000675If the specified value begins with a
676.Sq -
677character, then the specified key types (including wildcards) will be removed
678from the default set instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000679The default for this option is:
680.Bd -literal -offset 3n
681ecdsa-sha2-nistp256-cert-v01@openssh.com,
682ecdsa-sha2-nistp384-cert-v01@openssh.com,
683ecdsa-sha2-nistp521-cert-v01@openssh.com,
684ssh-ed25519-cert-v01@openssh.com,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +0000685rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000686ssh-rsa-cert-v01@openssh.com,
687ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +0000688ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000689.Ed
690.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000691The list of available key types may also be obtained using
692.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000693.It Cm HostbasedAuthentication
694Specifies whether rhosts or /etc/hosts.equiv authentication together
695with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100696(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000697The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000698.Cm no .
Damien Millerb594f382006-08-30 11:06:34 +1000699.It Cm HostbasedUsesNameFromPacketOnly
700Specifies whether or not the server will attempt to perform a reverse
701name lookup when matching the name in the
702.Pa ~/.shosts ,
703.Pa ~/.rhosts ,
704and
705.Pa /etc/hosts.equiv
706files during
707.Cm HostbasedAuthentication .
708A setting of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000709.Cm yes
Damien Millerb594f382006-08-30 11:06:34 +1000710means that
711.Xr sshd 8
712uses the name supplied by the client rather than
713attempting to resolve the name from the TCP connection itself.
714The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000715.Cm no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100716.It Cm HostCertificate
717Specifies a file containing a public host certificate.
718The certificate's public key must match a private host key already specified
719by
720.Cm HostKey .
721The default behaviour of
722.Xr sshd 8
723is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000724.It Cm HostKey
725Specifies a file containing a private host key
726used by SSH.
naddy@openbsd.orgffe65492016-08-15 12:32:04 +0000727The defaults are
Damien Miller8ba0ead2013-12-18 17:46:27 +1100728.Pa /etc/ssh/ssh_host_ecdsa_key ,
729.Pa /etc/ssh/ssh_host_ed25519_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000730and
naddy@openbsd.orgffe65492016-08-15 12:32:04 +0000731.Pa /etc/ssh/ssh_host_rsa_key .
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000732.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000733Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100734.Xr sshd 8
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000735will refuse to use a file if it is group/world-accessible
736and that the
737.Cm HostKeyAlgorithms
738option restricts which of the keys are actually used by
739.Xr sshd 8 .
740.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000741It is possible to have multiple host key files.
Damien Miller85b45e02013-07-20 13:21:52 +1000742It is also possible to specify public host key files instead.
743In this case operations on the private key will be delegated
744to an
745.Xr ssh-agent 1 .
746.It Cm HostKeyAgent
747Identifies the UNIX-domain socket used to communicate
748with an agent that has access to the private host keys.
markus@openbsd.org1a75d142016-05-04 14:29:58 +0000749If the string
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000750.Qq SSH_AUTH_SOCK
Damien Miller85b45e02013-07-20 13:21:52 +1000751is specified, the location of the socket will be read from the
752.Ev SSH_AUTH_SOCK
753environment variable.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000754.It Cm HostKeyAlgorithms
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000755Specifies the host key algorithms
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000756that the server offers.
757The default for this option is:
758.Bd -literal -offset 3n
759ecdsa-sha2-nistp256-cert-v01@openssh.com,
760ecdsa-sha2-nistp384-cert-v01@openssh.com,
761ecdsa-sha2-nistp521-cert-v01@openssh.com,
762ssh-ed25519-cert-v01@openssh.com,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +0000763rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000764ssh-rsa-cert-v01@openssh.com,
765ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +0000766ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000767.Ed
768.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000769The list of available key types may also be obtained using
770.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000771.It Cm IgnoreRhosts
772Specifies that
773.Pa .rhosts
774and
775.Pa .shosts
776files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000777.Cm HostbasedAuthentication .
778.Pp
779.Pa /etc/hosts.equiv
780and
781.Pa /etc/shosts.equiv
782are still used.
783The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000784.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000785.It Cm IgnoreUserKnownHosts
786Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100787.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000788should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000789.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000790during
djm@openbsd.org62562ce2018-02-10 06:54:38 +0000791.Cm HostbasedAuthentication
792and use only the system-wide known hosts file
793.Pa /etc/ssh/known_hosts .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000794The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000795.Cm no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100796.It Cm IPQoS
797Specifies the IPv4 type-of-service or DSCP class for the connection.
798Accepted values are
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000799.Cm af11 ,
800.Cm af12 ,
801.Cm af13 ,
802.Cm af21 ,
803.Cm af22 ,
804.Cm af23 ,
805.Cm af31 ,
806.Cm af32 ,
807.Cm af33 ,
808.Cm af41 ,
809.Cm af42 ,
810.Cm af43 ,
811.Cm cs0 ,
812.Cm cs1 ,
813.Cm cs2 ,
814.Cm cs3 ,
815.Cm cs4 ,
816.Cm cs5 ,
817.Cm cs6 ,
818.Cm cs7 ,
819.Cm ef ,
820.Cm lowdelay ,
821.Cm throughput ,
822.Cm reliability ,
djm@openbsd.org51676ec2017-07-23 23:37:02 +0000823a numeric value, or
824.Cm none
825to use the operating system default.
Damien Miller928362d2010-12-26 14:26:45 +1100826This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100827If one argument is specified, it is used as the packet class unconditionally.
828If two values are specified, the first is automatically selected for
829interactive sessions and the second for non-interactive sessions.
830The default is
job@openbsd.org5ee84482018-04-04 15:12:17 +0000831.Cm af21
jmc@openbsd.org3e36f282018-04-08 07:36:02 +0000832(Low-Latency Data)
Damien Miller0dac6fb2010-11-20 15:19:38 +1100833for interactive sessions and
job@openbsd.org5ee84482018-04-04 15:12:17 +0000834.Cm cs1
jmc@openbsd.org3e36f282018-04-08 07:36:02 +0000835(Lower Effort)
Damien Miller0dac6fb2010-11-20 15:19:38 +1100836for non-interactive sessions.
Damien Millere1e480a2014-02-04 11:13:17 +1100837.It Cm KbdInteractiveAuthentication
838Specifies whether to allow keyboard-interactive authentication.
839The argument to this keyword must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000840.Cm yes
Damien Millere1e480a2014-02-04 11:13:17 +1100841or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000842.Cm no .
Damien Millere1e480a2014-02-04 11:13:17 +1100843The default is to use whatever value
844.Cm ChallengeResponseAuthentication
845is set to
846(by default
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000847.Cm yes ) .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000848.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000849Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000850.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000851will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000852To use this option, the server needs a
853Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100854The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000855.Cm no .
Damien Miller8448e662004-03-08 23:13:15 +1100856.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000857If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100858an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100859The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000860.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000861.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100862If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000863the password will be validated via any additional local mechanism
864such as
865.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100866The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000867.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000868.It Cm KerberosTicketCleanup
869Specifies whether to automatically destroy the user's ticket cache
870file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100871The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000872.Cm yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000873.It Cm KexAlgorithms
874Specifies the available KEX (Key Exchange) algorithms.
875Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000876Alternately if the specified value begins with a
877.Sq +
878character, then the specified methods will be appended to the default set
879instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000880If the specified value begins with a
881.Sq -
882character, then the specified methods (including wildcards) will be removed
883from the default set instead of replacing them.
Damien Millerc1621c82014-04-20 13:22:46 +1000884The supported algorithms are:
885.Pp
886.Bl -item -compact -offset indent
887.It
djm@openbsd.org16277fc2016-09-22 17:55:13 +0000888curve25519-sha256
889.It
Damien Millerc1621c82014-04-20 13:22:46 +1000890curve25519-sha256@libssh.org
891.It
892diffie-hellman-group1-sha1
893.It
894diffie-hellman-group14-sha1
895.It
djm@openbsd.org680321f2018-02-16 02:40:45 +0000896diffie-hellman-group14-sha256
897.It
898diffie-hellman-group16-sha512
899.It
900diffie-hellman-group18-sha512
901.It
Damien Millerc1621c82014-04-20 13:22:46 +1000902diffie-hellman-group-exchange-sha1
903.It
904diffie-hellman-group-exchange-sha256
905.It
906ecdh-sha2-nistp256
907.It
908ecdh-sha2-nistp384
909.It
910ecdh-sha2-nistp521
911.El
912.Pp
913The default is:
Damien Miller6575c3a2013-12-18 17:47:02 +1100914.Bd -literal -offset indent
djm@openbsd.org16277fc2016-09-22 17:55:13 +0000915curve25519-sha256,curve25519-sha256@libssh.org,
Damien Miller6575c3a2013-12-18 17:47:02 +1100916ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
917diffie-hellman-group-exchange-sha256,
djm@openbsd.org680321f2018-02-16 02:40:45 +0000918diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,
919diffie-hellman-group14-sha256,diffie-hellman-group14-sha1
Damien Miller6575c3a2013-12-18 17:47:02 +1100920.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000921.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000922The list of available key exchange algorithms may also be obtained using
923.Qq ssh -Q kex .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000924.It Cm ListenAddress
925Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100926.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000927should listen on.
928The following forms may be used:
929.Pp
930.Bl -item -offset indent -compact
931.It
932.Cm ListenAddress
933.Sm off
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000934.Ar hostname | address
Ben Lindstrom9f049032002-06-21 00:59:05 +0000935.Sm on
jmc@openbsd.org@openbsd.org68d3bbb2017-10-26 06:44:01 +0000936.Op Cm rdomain Ar domain
Ben Lindstrom9f049032002-06-21 00:59:05 +0000937.It
938.Cm ListenAddress
939.Sm off
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000940.Ar hostname : port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000941.Sm on
jmc@openbsd.org@openbsd.org68d3bbb2017-10-26 06:44:01 +0000942.Op Cm rdomain Ar domain
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000943.It
944.Cm ListenAddress
945.Sm off
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000946.Ar IPv4_address : port
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000947.Sm on
jmc@openbsd.org@openbsd.org68d3bbb2017-10-26 06:44:01 +0000948.Op Cm rdomain Ar domain
Ben Lindstrom9f049032002-06-21 00:59:05 +0000949.It
950.Cm ListenAddress
951.Sm off
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000952.Oo Ar hostname | address Oc : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000953.Sm on
jmc@openbsd.org@openbsd.org68d3bbb2017-10-26 06:44:01 +0000954.Op Cm rdomain Ar domain
Ben Lindstrom9f049032002-06-21 00:59:05 +0000955.El
956.Pp
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000957The optional
958.Cm rdomain
959qualifier requests
960.Xr sshd 8
961listen in an explicit routing domain.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000962If
963.Ar port
964is not specified,
dtucker@openbsd.org531a57a2015-04-29 03:48:56 +0000965sshd will listen on the address and all
Ben Lindstrom9f049032002-06-21 00:59:05 +0000966.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000967options specified.
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000968The default is to listen on all local addresses on the current default
969routing domain.
Damien Miller495dca32003-04-01 21:42:14 +1000970Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000971.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000972options are permitted.
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000973For more information on routing domains, see
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000974.Xr rdomain 4 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000975.It Cm LoginGraceTime
976The server disconnects after this time if the user has not
977successfully logged in.
978If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000979The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000980.It Cm LogLevel
981Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100982.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000983The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100984QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000985The default is INFO.
986DEBUG and DEBUG1 are equivalent.
987DEBUG2 and DEBUG3 each specify higher levels of debugging output.
988Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000989.It Cm MACs
990Specifies the available MAC (message authentication code) algorithms.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000991The MAC algorithm is used for data integrity protection.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000992Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000993If the specified value begins with a
994.Sq +
995character, then the specified algorithms will be appended to the default set
996instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000997If the specified value begins with a
998.Sq -
999character, then the specified algorithms (including wildcards) will be removed
1000from the default set instead of replacing them.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001001.Pp
Damien Milleraf43a7a2012-12-12 10:46:31 +11001002The algorithms that contain
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001003.Qq -etm
Damien Milleraf43a7a2012-12-12 10:46:31 +11001004calculate the MAC after encryption (encrypt-then-mac).
1005These are considered safer and their use recommended.
Damien Millerc1621c82014-04-20 13:22:46 +10001006The supported MACs are:
1007.Pp
1008.Bl -item -compact -offset indent
1009.It
1010hmac-md5
1011.It
1012hmac-md5-96
1013.It
Damien Millerc1621c82014-04-20 13:22:46 +10001014hmac-sha1
1015.It
1016hmac-sha1-96
1017.It
1018hmac-sha2-256
1019.It
1020hmac-sha2-512
1021.It
1022umac-64@openssh.com
1023.It
1024umac-128@openssh.com
1025.It
1026hmac-md5-etm@openssh.com
1027.It
1028hmac-md5-96-etm@openssh.com
1029.It
Damien Millerc1621c82014-04-20 13:22:46 +10001030hmac-sha1-etm@openssh.com
1031.It
1032hmac-sha1-96-etm@openssh.com
1033.It
1034hmac-sha2-256-etm@openssh.com
1035.It
1036hmac-sha2-512-etm@openssh.com
1037.It
1038umac-64-etm@openssh.com
1039.It
1040umac-128-etm@openssh.com
1041.El
1042.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +11001043The default is:
Damien Miller22b7b492007-06-11 14:07:12 +10001044.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +11001045umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1046hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001047hmac-sha1-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +10001048umac-64@openssh.com,umac-128@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001049hmac-sha2-256,hmac-sha2-512,hmac-sha1
Damien Miller22b7b492007-06-11 14:07:12 +10001050.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001051.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001052The list of available MAC algorithms may also be obtained using
1053.Qq ssh -Q mac .
Darren Tucker45150472006-07-12 22:34:17 +10001054.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +10001055Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +10001056If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +10001057.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001058line are satisfied, the keywords on the following lines override those
1059set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +10001060.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001061line or the end of the file.
Damien Millerfc5d6752014-02-28 10:01:28 +11001062If a keyword appears in multiple
1063.Cm Match
sobrado@openbsd.org180bcb42014-08-30 16:32:25 +00001064blocks that are satisfied, only the first instance of the keyword is
Damien Millerfc5d6752014-02-28 10:01:28 +11001065applied.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001066.Pp
Damien Millerd04f3572006-07-24 13:46:50 +10001067The arguments to
Darren Tucker45150472006-07-12 22:34:17 +10001068.Cm Match
Damien Millercf31f382013-10-24 21:02:56 +11001069are one or more criteria-pattern pairs or the single token
1070.Cm All
1071which matches all criteria.
Darren Tucker45150472006-07-12 22:34:17 +10001072The available criteria are
1073.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +10001074.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +10001075.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +10001076.Cm LocalAddress ,
1077.Cm LocalPort ,
djm@openbsd.org68af80e2017-10-25 00:19:47 +00001078.Cm RDomain ,
Darren Tucker45150472006-07-12 22:34:17 +10001079and
djm@openbsd.org68af80e2017-10-25 00:19:47 +00001080.Cm Address
1081(with
1082.Cm RDomain
1083representing the
1084.Xr rdomain 4
jmc@openbsd.org62949c52019-03-22 20:58:34 +00001085on which the connection was received).
djm@openbsd.org68af80e2017-10-25 00:19:47 +00001086.Pp
Darren Tucker7a3935d2008-06-10 22:59:10 +10001087The match patterns may consist of single entries or comma-separated
1088lists and may use the wildcard and negation operators described in the
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001089.Sx PATTERNS
1090section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +10001091.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001092.Pp
1093The patterns in an
1094.Cm Address
1095criteria may additionally contain addresses to match in CIDR
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001096address/masklen format,
1097such as 192.0.2.0/24 or 2001:db8::/32.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001098Note that the mask length provided must be consistent with the address -
1099it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +10001100or one with bits set in this host portion of the address.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001101For example, 192.0.2.0/33 and 192.0.2.0/8, respectively.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001102.Pp
Darren Tucker45150472006-07-12 22:34:17 +10001103Only a subset of keywords may be used on the lines following a
1104.Cm Match
1105keyword.
1106Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +10001107.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +11001108.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +10001109.Cm AllowGroups ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001110.Cm AllowStreamLocalForwarding ,
Damien Miller9b439df2006-07-24 14:04:00 +10001111.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +10001112.Cm AllowUsers ,
Damien Millera6e3f012012-11-04 23:21:40 +11001113.Cm AuthenticationMethods ,
Damien Miller09d3e122012-10-31 08:58:58 +11001114.Cm AuthorizedKeysCommand ,
1115.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +11001116.Cm AuthorizedKeysFile ,
djm@openbsd.orgb6b91082015-11-13 02:57:46 +00001117.Cm AuthorizedPrincipalsCommand ,
1118.Cm AuthorizedPrincipalsCommandUser ,
Damien Millerab6de352010-06-26 09:38:45 +10001119.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +11001120.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +10001121.Cm ChrootDirectory ,
markus@openbsd.orgf0ddede2016-11-23 23:14:15 +00001122.Cm ClientAliveCountMax ,
1123.Cm ClientAliveInterval ,
Damien Millerc24da772012-06-20 21:53:58 +10001124.Cm DenyGroups ,
1125.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +10001126.Cm ForceCommand ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001127.Cm GatewayPorts ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +00001128.Cm GSSAPIAuthentication ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001129.Cm HostbasedAcceptedKeyTypes ,
Damien Miller25434de2008-05-19 14:29:08 +10001130.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +10001131.Cm HostbasedUsesNameFromPacketOnly ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001132.Cm IPQoS ,
Darren Tucker1d75f222007-03-01 21:31:28 +11001133.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +11001134.Cm KerberosAuthentication ,
djm@openbsd.org54cd41a2017-05-17 01:24:17 +00001135.Cm LogLevel ,
Damien Miller307c1d12008-06-16 07:56:20 +10001136.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +10001137.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +11001138.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +11001139.Cm PermitEmptyPasswords ,
djm@openbsd.org04df4322018-06-06 18:24:00 +00001140.Cm PermitListen ,
Damien Millerd1de9952006-07-24 14:05:48 +10001141.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +11001142.Cm PermitRootLogin ,
Damien Miller5ff30c62013-10-30 22:21:50 +11001143.Cm PermitTTY ,
Damien Millerab6de352010-06-26 09:38:45 +10001144.Cm PermitTunnel ,
Damien Miller72e6b5c2014-07-04 09:00:04 +10001145.Cm PermitUserRC ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001146.Cm PubkeyAcceptedKeyTypes ,
Darren Tucker1477ea12009-10-07 08:36:05 +11001147.Cm PubkeyAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001148.Cm RekeyLimit ,
1149.Cm RevokedKeys ,
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001150.Cm RDomain ,
djm@openbsd.org28013752018-06-09 03:03:10 +00001151.Cm SetEnv ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001152.Cm StreamLocalBindMask ,
1153.Cm StreamLocalBindUnlink ,
1154.Cm TrustedUserCAKeys ,
Damien Millerd1de9952006-07-24 14:05:48 +10001155.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +11001156.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +10001157and
jmc@openbsd.org76af9c52019-06-12 05:53:21 +00001158.Cm X11UseLocalhost .
Darren Tucker89413db2004-05-24 10:36:23 +10001159.It Cm MaxAuthTries
1160Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +10001161connection.
1162Once the number of failures reaches half this value,
1163additional failures are logged.
1164The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +10001165.It Cm MaxSessions
djm@openbsd.orgcac3b662016-02-05 02:37:56 +00001166Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1167sessions permitted per network connection.
1168Multiple sessions may be established by clients that support connection
1169multiplexing.
1170Setting
1171.Cm MaxSessions
1172to 1 will effectively disable session multiplexing, whereas setting it to 0
1173will prevent all shell, login and subsystem sessions while still permitting
1174forwarding.
Damien Miller7207f642008-05-19 15:34:50 +10001175The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001176.It Cm MaxStartups
1177Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001178SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001179Additional connections will be dropped until authentication succeeds or the
1180.Cm LoginGraceTime
1181expires for a connection.
Damien Miller1f583df2013-02-12 11:02:08 +11001182The default is 10:30:100.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001183.Pp
1184Alternatively, random early drop can be enabled by specifying
1185the three colon separated values
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001186start:rate:full (e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +11001187.Xr sshd 8
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001188will refuse connection attempts with a probability of rate/100 (30%)
1189if there are currently start (10) unauthenticated connections.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001190The probability increases linearly and all connection attempts
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001191are refused if the number of unauthenticated connections reaches full (60).
Ben Lindstrom9f049032002-06-21 00:59:05 +00001192.It Cm PasswordAuthentication
1193Specifies whether password authentication is allowed.
1194The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001195.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001196.It Cm PermitEmptyPasswords
1197When password authentication is allowed, it specifies whether the
1198server allows login to accounts with empty password strings.
1199The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001200.Cm no .
djm@openbsd.org04df4322018-06-06 18:24:00 +00001201.It Cm PermitListen
1202Specifies the addresses/ports on which a remote TCP port forwarding may listen.
1203The listen specification must be one of the following forms:
1204.Pp
1205.Bl -item -offset indent -compact
1206.It
1207.Cm PermitListen
1208.Sm off
djm@openbsd.org87ddd672018-06-19 02:59:41 +00001209.Ar port
1210.Sm on
1211.It
1212.Cm PermitListen
1213.Sm off
djm@openbsd.org04df4322018-06-06 18:24:00 +00001214.Ar host : port
1215.Sm on
djm@openbsd.org04df4322018-06-06 18:24:00 +00001216.El
1217.Pp
1218Multiple permissions may be specified by separating them with whitespace.
1219An argument of
1220.Cm any
1221can be used to remove all restrictions and permit any listen requests.
1222An argument of
1223.Cm none
1224can be used to prohibit all listen requests.
1225The host name may contain wildcards as described in the PATTERNS section in
1226.Xr ssh_config 5 .
1227The wildcard
1228.Sq *
1229can also be used in place of a port number to allow all ports.
1230By default all port forwarding listen requests are permitted.
jmc@openbsd.org6ff6fda2018-06-07 11:26:14 +00001231Note that the
djm@openbsd.org04df4322018-06-06 18:24:00 +00001232.Cm GatewayPorts
1233option may further restrict which addresses may be listened on.
djm@openbsd.org87ddd672018-06-19 02:59:41 +00001234Note also that
1235.Xr ssh 1
1236will request a listen host of
1237.Dq localhost
dtucker@openbsd.org177d6c82019-01-23 20:48:52 +00001238if no listen host was specifically requested, and this name is
jmc@openbsd.orgf535ff92018-06-19 05:36:57 +00001239treated differently to explicit localhost addresses of
djm@openbsd.org87ddd672018-06-19 02:59:41 +00001240.Dq 127.0.0.1
1241and
1242.Dq ::1 .
Damien Miller9b439df2006-07-24 14:04:00 +10001243.It Cm PermitOpen
1244Specifies the destinations to which TCP port forwarding is permitted.
1245The forwarding specification must be one of the following forms:
1246.Pp
1247.Bl -item -offset indent -compact
1248.It
1249.Cm PermitOpen
1250.Sm off
1251.Ar host : port
1252.Sm on
1253.It
1254.Cm PermitOpen
1255.Sm off
1256.Ar IPv4_addr : port
1257.Sm on
1258.It
1259.Cm PermitOpen
1260.Sm off
1261.Ar \&[ IPv6_addr \&] : port
1262.Sm on
1263.El
1264.Pp
Damien Millera765cf42006-07-24 14:08:13 +10001265Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +10001266An argument of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001267.Cm any
Damien Miller9b439df2006-07-24 14:04:00 +10001268can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +10001269An argument of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001270.Cm none
Darren Tuckerba9ea322012-05-19 19:37:33 +10001271can be used to prohibit all forwarding requests.
jmc@openbsd.org32d921c2016-07-19 12:59:16 +00001272The wildcard
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001273.Sq *
jmc@openbsd.org32d921c2016-07-19 12:59:16 +00001274can be used for host or port to allow all hosts or ports, respectively.
Damien Miller65bc2c42006-07-24 14:04:16 +10001275By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001276.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +11001277Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +00001278.Xr ssh 1 .
1279The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001280.Cm yes ,
1281.Cm prohibit-password ,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001282.Cm forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001283or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001284.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001285The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001286.Cm prohibit-password .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001287.Pp
1288If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001289.Cm prohibit-password
jmc@openbsd.org071325f2017-10-13 16:50:45 +00001290(or its deprecated alias,
1291.Cm without-password ) ,
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001292password and keyboard-interactive authentication are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001293.Pp
1294If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001295.Cm forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001296root login with public key authentication will be allowed,
1297but only if the
1298.Ar command
1299option has been specified
1300(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +10001301normally not allowed).
1302All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001303.Pp
1304If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001305.Cm no ,
Darren Tuckerb3509012005-01-20 11:01:46 +11001306root is not allowed to log in.
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +00001307.It Cm PermitTTY
1308Specifies whether
1309.Xr pty 4
1310allocation is permitted.
1311The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001312.Cm yes .
Damien Millerd27b9472005-12-13 19:29:02 +11001313.It Cm PermitTunnel
1314Specifies whether
1315.Xr tun 4
1316device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +11001317The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001318.Cm yes ,
1319.Cm point-to-point
Damien Miller991dba42006-07-10 20:16:27 +10001320(layer 3),
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001321.Cm ethernet
Damien Miller991dba42006-07-10 20:16:27 +10001322(layer 2), or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001323.Cm no .
Damien Miller991dba42006-07-10 20:16:27 +10001324Specifying
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001325.Cm yes
Damien Miller991dba42006-07-10 20:16:27 +10001326permits both
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001327.Cm point-to-point
Damien Miller991dba42006-07-10 20:16:27 +10001328and
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001329.Cm ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +11001330The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001331.Cm no .
djm@openbsd.org48dffd52014-09-09 09:45:36 +00001332.Pp
1333Independent of this setting, the permissions of the selected
1334.Xr tun 4
1335device must allow access to the user.
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001336.It Cm PermitUserEnvironment
1337Specifies whether
1338.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001339and
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001340.Cm environment=
1341options in
1342.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001343are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +11001344.Xr sshd 8 .
djm@openbsd.org95344c22018-07-03 10:59:35 +00001345Valid options are
1346.Cm yes ,
1347.Cm no
1348or a pattern-list specifying which environment variable names to accept
1349(for example
1350.Qq LANG,LC_* ) .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001351The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001352.Cm no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001353Enabling environment processing may enable users to bypass access
1354restrictions in some configurations using mechanisms such as
1355.Ev LD_PRELOAD .
Damien Miller72e6b5c2014-07-04 09:00:04 +10001356.It Cm PermitUserRC
1357Specifies whether any
1358.Pa ~/.ssh/rc
1359file is executed.
1360The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001361.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001362.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +00001363Specifies the file that contains the process ID of the
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001364SSH daemon, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001365.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001366to not write one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001367The default is
1368.Pa /var/run/sshd.pid .
1369.It Cm Port
1370Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +11001371.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001372listens on.
1373The default is 22.
1374Multiple options of this type are permitted.
1375See also
1376.Cm ListenAddress .
1377.It Cm PrintLastLog
1378Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001379.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +11001380should print the date and time of the last user login when a user logs
1381in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001382The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001383.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001384.It Cm PrintMotd
1385Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001386.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001387should print
1388.Pa /etc/motd
1389when a user logs in interactively.
1390(On some systems it is also printed by the shell,
1391.Pa /etc/profile ,
1392or equivalent.)
1393The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001394.Cm yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001395.It Cm PubkeyAcceptedKeyTypes
1396Specifies the key types that will be accepted for public key authentication
djm@openbsd.org312d2f22018-07-04 13:49:31 +00001397as a list of comma-separated patterns.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001398Alternately if the specified value begins with a
1399.Sq +
1400character, then the specified key types will be appended to the default set
1401instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001402If the specified value begins with a
1403.Sq -
1404character, then the specified key types (including wildcards) will be removed
1405from the default set instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001406The default for this option is:
1407.Bd -literal -offset 3n
1408ecdsa-sha2-nistp256-cert-v01@openssh.com,
1409ecdsa-sha2-nistp384-cert-v01@openssh.com,
1410ecdsa-sha2-nistp521-cert-v01@openssh.com,
1411ssh-ed25519-cert-v01@openssh.com,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +00001412rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001413ssh-rsa-cert-v01@openssh.com,
1414ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org4ba0d542018-07-03 11:39:54 +00001415ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001416.Ed
1417.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001418The list of available key types may also be obtained using
1419.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001420.It Cm PubkeyAuthentication
1421Specifies whether public key authentication is allowed.
1422The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001423.Cm yes .
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001424.It Cm RekeyLimit
1425Specifies the maximum amount of data that may be transmitted before the
1426session key is renegotiated, optionally followed a maximum amount of
1427time that may pass before the session key is renegotiated.
1428The first argument is specified in bytes and may have a suffix of
1429.Sq K ,
1430.Sq M ,
1431or
1432.Sq G
1433to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1434The default is between
1435.Sq 1G
1436and
1437.Sq 4G ,
1438depending on the cipher.
1439The optional second value is specified in seconds and may use any of the
1440units documented in the
1441.Sx TIME FORMATS
Darren Tucker64d22942013-05-16 20:31:29 +10001442section.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001443The default value for
1444.Cm RekeyLimit
1445is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001446.Cm default none ,
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001447which means that rekeying is performed after the cipher's default amount
1448of data has been sent or received and no time based rekeying is done.
Damien Miller1aed65e2010-03-04 21:53:35 +11001449.It Cm RevokedKeys
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001450Specifies revoked public keys file, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001451.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001452to not use one.
Damien Miller1aed65e2010-03-04 21:53:35 +11001453Keys listed in this file will be refused for public key authentication.
1454Note that if this file is not readable, then public key authentication will
1455be refused for all users.
Damien Millerf3747bf2013-01-18 11:44:04 +11001456Keys may be specified as a text file, listing one public key per line, or as
1457an OpenSSH Key Revocation List (KRL) as generated by
Damien Miller72abeb72013-01-20 22:33:44 +11001458.Xr ssh-keygen 1 .
Damien Millerfecfd112013-07-18 16:11:50 +10001459For more information on KRLs, see the KEY REVOCATION LISTS section in
Damien Millerf3747bf2013-01-18 11:44:04 +11001460.Xr ssh-keygen 1 .
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001461.It Cm RDomain
1462Specifies an explicit routing domain that is applied after authentication
1463has completed.
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +00001464The user session, as well and any forwarded or listening IP sockets,
1465will be bound to this
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001466.Xr rdomain 4 .
1467If the routing domain is set to
1468.Cm \&%D ,
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +00001469then the domain in which the incoming connection was received will be applied.
djm@openbsd.org28013752018-06-09 03:03:10 +00001470.It Cm SetEnv
1471Specifies one or more environment variables to set in child sessions started
1472by
1473.Xr sshd 8
1474as
1475.Dq NAME=VALUE .
1476The environment value may be quoted (e.g. if it contains whitespace
1477characters).
1478Environment variables set by
1479.Cm SetEnv
1480override the default environment and any variables specified by the user
1481via
1482.Cm AcceptEnv
1483or
1484.Cm PermitUserEnvironment .
Damien Miller7acefbb2014-07-18 14:11:24 +10001485.It Cm StreamLocalBindMask
1486Sets the octal file creation mode mask
1487.Pq umask
1488used when creating a Unix-domain socket file for local or remote
1489port forwarding.
1490This option is only used for port forwarding to a Unix-domain socket file.
1491.Pp
1492The default value is 0177, which creates a Unix-domain socket file that is
1493readable and writable only by the owner.
1494Note that not all operating systems honor the file mode on Unix-domain
1495socket files.
1496.It Cm StreamLocalBindUnlink
1497Specifies whether to remove an existing Unix-domain socket file for local
1498or remote port forwarding before creating a new one.
1499If the socket file already exists and
1500.Cm StreamLocalBindUnlink
1501is not enabled,
1502.Nm sshd
1503will be unable to forward the port to the Unix-domain socket file.
1504This option is only used for port forwarding to a Unix-domain socket file.
1505.Pp
1506The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001507.Cm yes
Damien Miller7acefbb2014-07-18 14:11:24 +10001508or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001509.Cm no .
Damien Miller7acefbb2014-07-18 14:11:24 +10001510The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001511.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001512.It Cm StrictModes
1513Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001514.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001515should check file modes and ownership of the
1516user's files and home directory before accepting login.
1517This is normally desirable because novices sometimes accidentally leave their
1518directory or files world-writable.
1519The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001520.Cm yes .
Darren Tuckerf788a912010-01-08 17:06:47 +11001521Note that this does not apply to
1522.Cm ChrootDirectory ,
1523whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001524.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +11001525Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +10001526Arguments should be a subsystem name and a command (with optional arguments)
1527to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001528.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001529The command
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001530.Cm sftp-server
1531implements the SFTP file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001532.Pp
1533Alternately the name
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001534.Cm internal-sftp
1535implements an in-process SFTP server.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001536This may simplify configurations using
1537.Cm ChrootDirectory
1538to force a different filesystem root on clients.
1539.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001540By default no subsystems are defined.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001541.It Cm SyslogFacility
1542Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001543.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001544The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1545LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1546The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001547.It Cm TCPKeepAlive
1548Specifies whether the system should send TCP keepalive messages to the
1549other side.
1550If they are sent, death of the connection or crash of one
1551of the machines will be properly noticed.
1552However, this means that
1553connections will die if the route is down temporarily, and some people
1554find it annoying.
1555On the other hand, if TCP keepalives are not sent,
1556sessions may hang indefinitely on the server, leaving
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001557.Qq ghost
Damien Miller12c150e2003-12-17 16:31:10 +11001558users and consuming server resources.
1559.Pp
1560The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001561.Cm yes
Damien Miller12c150e2003-12-17 16:31:10 +11001562(to send TCP keepalive messages), and the server will notice
1563if the network goes down or the client host crashes.
1564This avoids infinitely hanging sessions.
1565.Pp
1566To disable TCP keepalive messages, the value should be set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001567.Cm no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001568.It Cm TrustedUserCAKeys
1569Specifies a file containing public keys of certificate authorities that are
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001570trusted to sign user certificates for authentication, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001571.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001572to not use one.
Damien Miller72b33822010-03-05 07:39:01 +11001573Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001574.Ql #
1575are allowed.
1576If a certificate is presented for authentication and has its signing CA key
1577listed in this file, then it may be used for authentication for any user
1578listed in the certificate's principals list.
1579Note that certificates that lack a list of principals will not be permitted
1580for authentication using
1581.Cm TrustedUserCAKeys .
Damien Millerfecfd112013-07-18 16:11:50 +10001582For more details on certificates, see the CERTIFICATES section in
Damien Miller1aed65e2010-03-04 21:53:35 +11001583.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001584.It Cm UseDNS
1585Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001586.Xr sshd 8
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001587should look up the remote host name, and to check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001588the resolved host name for the remote IP address maps back to the
1589very same IP address.
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001590.Pp
1591If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001592.Cm no
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001593(the default) then only addresses and not host names may be used in
djm@openbsd.org0235a5f2016-03-17 17:19:43 +00001594.Pa ~/.ssh/authorized_keys
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001595.Cm from
1596and
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +00001597.Nm
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001598.Cm Match
1599.Cm Host
1600directives.
Damien Miller2e193e22003-05-14 15:13:03 +10001601.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001602Enables the Pluggable Authentication Module interface.
1603If set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001604.Cm yes
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001605this will enable PAM authentication using
1606.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001607and
1608.Cm PasswordAuthentication
1609in addition to PAM account and session module processing for all
1610authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001611.Pp
1612Because PAM challenge-response authentication usually serves an equivalent
1613role to password authentication, you should disable either
1614.Cm PasswordAuthentication
1615or
1616.Cm ChallengeResponseAuthentication.
1617.Pp
1618If
1619.Cm UsePAM
1620is enabled, you will not be able to run
1621.Xr sshd 8
1622as a non-root user.
1623The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001624.Cm no .
Damien Miller23528812012-04-22 11:24:43 +10001625.It Cm VersionAddendum
1626Optionally specifies additional text to append to the SSH protocol banner
1627sent by the server upon connection.
1628The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001629.Cm none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001630.It Cm X11DisplayOffset
1631Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001632.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001633X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001634This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001635The default is 10.
1636.It Cm X11Forwarding
1637Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001638The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001639.Cm yes
Damien Miller101c4a72002-09-19 11:51:21 +10001640or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001641.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001642The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001643.Cm no .
Damien Miller101c4a72002-09-19 11:51:21 +10001644.Pp
1645When X11 forwarding is enabled, there may be additional exposure to
1646the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001647.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001648proxy display is configured to listen on the wildcard address (see
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001649.Cm X11UseLocalhost ) ,
1650though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001651Additionally, the authentication spoofing and authentication data
1652verification and substitution occur on the client side.
1653The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001654display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001655forwarding (see the warnings for
1656.Cm ForwardX11
1657in
Damien Millerf1ce5052003-06-11 22:04:39 +10001658.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001659A system administrator may have a stance in which they want to
1660protect clients that may expose themselves to attack by unwittingly
1661requesting X11 forwarding, which can warrant a
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001662.Cm no
Damien Miller101c4a72002-09-19 11:51:21 +10001663setting.
1664.Pp
1665Note that disabling X11 forwarding does not prevent users from
1666forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001667.It Cm X11UseLocalhost
1668Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001669.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001670should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001671the wildcard address.
1672By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001673sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001674hostname part of the
1675.Ev DISPLAY
1676environment variable to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001677.Cm localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001678This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001679However, some older X11 clients may not function with this
1680configuration.
1681.Cm X11UseLocalhost
1682may be set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001683.Cm no
Ben Lindstrom9f049032002-06-21 00:59:05 +00001684to specify that the forwarding server should be bound to the wildcard
1685address.
1686The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001687.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +00001688or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001689.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001690The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001691.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001692.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001693Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001694.Xr xauth 1
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001695program, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001696.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001697to not use one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001698The default is
1699.Pa /usr/X11R6/bin/xauth .
1700.El
Damien Millere3beba22006-03-15 11:59:25 +11001701.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001702.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001703command-line arguments and configuration file options that specify time
1704may be expressed using a sequence of the form:
1705.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001706.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001707.Sm on
1708where
1709.Ar time
1710is a positive integer value and
1711.Ar qualifier
1712is one of the following:
1713.Pp
1714.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001715.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001716seconds
1717.It Cm s | Cm S
1718seconds
1719.It Cm m | Cm M
1720minutes
1721.It Cm h | Cm H
1722hours
1723.It Cm d | Cm D
1724days
1725.It Cm w | Cm W
1726weeks
1727.El
1728.Pp
1729Each member of the sequence is added together to calculate
1730the total time value.
1731.Pp
1732Time format examples:
1733.Pp
1734.Bl -tag -width Ds -compact -offset indent
1735.It 600
1736600 seconds (10 minutes)
1737.It 10m
173810 minutes
1739.It 1h30m
17401 hour 30 minutes (90 minutes)
1741.El
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001742.Sh TOKENS
1743Arguments to some keywords can make use of tokens,
1744which are expanded at runtime:
1745.Pp
1746.Bl -tag -width XXXX -offset indent -compact
1747.It %%
1748A literal
1749.Sq % .
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001750.It \&%D
1751The routing domain in which the incoming connection was received.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001752.It %F
1753The fingerprint of the CA key.
1754.It %f
1755The fingerprint of the key or certificate.
1756.It %h
1757The home directory of the user.
1758.It %i
1759The key ID in the certificate.
1760.It %K
1761The base64-encoded CA key.
1762.It %k
1763The base64-encoded key or certificate for authentication.
1764.It %s
1765The serial number of the certificate.
1766.It \&%T
1767The type of the CA key.
1768.It %t
1769The key or certificate type.
jmc@openbsd.org29402842018-06-01 05:50:18 +00001770.It \&%U
1771The numeric user ID of the target user.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001772.It %u
1773The username.
1774.El
1775.Pp
1776.Cm AuthorizedKeysCommand
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001777accepts the tokens %%, %f, %h, %k, %t, %U, and %u.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001778.Pp
1779.Cm AuthorizedKeysFile
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001780accepts the tokens %%, %h, %U, and %u.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001781.Pp
1782.Cm AuthorizedPrincipalsCommand
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001783accepts the tokens %%, %F, %f, %h, %i, %K, %k, %s, %T, %t, %U, and %u.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001784.Pp
1785.Cm AuthorizedPrincipalsFile
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001786accepts the tokens %%, %h, %U, and %u.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001787.Pp
1788.Cm ChrootDirectory
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001789accepts the tokens %%, %h, %U, and %u.
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001790.Pp
1791.Cm RoutingDomain
1792accepts the token %D.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001793.Sh FILES
1794.Bl -tag -width Ds
1795.It Pa /etc/ssh/sshd_config
1796Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001797.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001798This file should be writable by root only, but it is recommended
1799(though not necessary) that it be world-readable.
1800.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001801.Sh SEE ALSO
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001802.Xr sftp-server 8 ,
Damien Millerf1ce5052003-06-11 22:04:39 +10001803.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001804.Sh AUTHORS
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001805.An -nosplit
Ben Lindstrom9f049032002-06-21 00:59:05 +00001806OpenSSH is a derivative of the original and free
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001807ssh 1.2.12 release by
1808.An Tatu Ylonen .
1809.An Aaron Campbell , Bob Beck , Markus Friedl , Niels Provos ,
1810.An Theo de Raadt
1811and
1812.An Dug Song
Ben Lindstrom9f049032002-06-21 00:59:05 +00001813removed many bugs, re-added newer features and
1814created OpenSSH.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001815.An Markus Friedl
1816contributed the support for SSH protocol versions 1.5 and 2.0.
1817.An Niels Provos
1818and
1819.An Markus Friedl
1820contributed support for privilege separation.