blob: 70ccea449d181d92a8d4e89208a934f2e9487204 [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.orgd4d9e1d2020-02-07 03:54:44 +000036.\" $OpenBSD: sshd_config.5,v 1.307 2020/02/07 03:54:44 dtucker Exp $
37.Dd $Mdocdate: February 7 2020 $
Ben Lindstrom9f049032002-06-21 00:59:05 +000038.Dt SSHD_CONFIG 5
39.Os
40.Sh NAME
41.Nm sshd_config
jmc@openbsd.org483cc722019-11-30 07:07:59 +000042.Nd OpenSSH daemon configuration file
Ben Lindstrom9f049032002-06-21 00:59:05 +000043.Sh DESCRIPTION
Damien Millerf4f22b52006-03-15 11:57:25 +110044.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +000045reads configuration data from
46.Pa /etc/ssh/sshd_config
47(or the file specified with
48.Fl f
49on the command line).
50The file contains keyword-argument pairs, one per line.
benno@openbsd.orgcfa46822017-10-09 20:12:51 +000051For each keyword, the first obtained value will be used.
Ben Lindstrom9f049032002-06-21 00:59:05 +000052Lines starting with
53.Ql #
54and empty lines are interpreted as comments.
Damien Miller306d1182006-03-15 12:05:59 +110055Arguments may optionally be enclosed in double quotes
56.Pq \&"
57in order to represent arguments containing spaces.
Ben Lindstrom9f049032002-06-21 00:59:05 +000058.Pp
59The possible
60keywords and their meanings are as follows (note that
61keywords are case-insensitive and arguments are case-sensitive):
62.Bl -tag -width Ds
Darren Tucker46bc0752004-05-02 22:11:30 +100063.It Cm AcceptEnv
64Specifies what environment variables sent by the client will be copied into
65the session's
66.Xr environ 7 .
67See
68.Cm SendEnv
djm@openbsd.org7082bb52018-06-09 03:01:12 +000069and
70.Cm SetEnv
Darren Tucker46bc0752004-05-02 22:11:30 +100071in
72.Xr ssh_config 5
73for how to configure the client.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +000074The
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +000075.Ev TERM
djm@openbsd.org1678d422018-06-09 03:18:11 +000076environment variable is always accepted whenever the client
djm@openbsd.org732d61f2015-06-05 03:44:14 +000077requests a pseudo-terminal as it is required by the protocol.
Darren Tucker46bc0752004-05-02 22:11:30 +100078Variables are specified by name, which may contain the wildcard characters
Damien Miller208f1ed2006-03-15 11:56:03 +110079.Ql *
Darren Tucker46bc0752004-05-02 22:11:30 +100080and
81.Ql \&? .
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100082Multiple environment variables may be separated by whitespace or spread
Darren Tucker46bc0752004-05-02 22:11:30 +100083across multiple
84.Cm AcceptEnv
85directives.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100086Be warned that some environment variables could be used to bypass restricted
Darren Tucker46bc0752004-05-02 22:11:30 +100087user environments.
88For this reason, care should be taken in the use of this directive.
89The default is not to accept any environment variables.
Darren Tucker0f383232005-01-20 10:57:56 +110090.It Cm AddressFamily
91Specifies which address family should be used by
Damien Millerf4f22b52006-03-15 11:57:25 +110092.Xr sshd 8 .
Darren Tucker0f383232005-01-20 10:57:56 +110093Valid arguments are
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +000094.Cm any
95(the default),
96.Cm inet
Damien Miller5b0d63f2006-03-15 11:56:56 +110097(use IPv4 only), or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +000098.Cm inet6
Darren Tucker0f383232005-01-20 10:57:56 +110099(use IPv6 only).
Damien Millere9890192008-05-19 14:59:02 +1000100.It Cm AllowAgentForwarding
101Specifies whether
102.Xr ssh-agent 1
103forwarding is permitted.
104The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000105.Cm yes .
Damien Millere9890192008-05-19 14:59:02 +1000106Note that disabling agent forwarding does not improve security
107unless users are also denied shell access, as they can always install
108their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000109.It Cm AllowGroups
110This keyword can be followed by a list of group name patterns, separated
111by spaces.
112If specified, login is allowed only for users whose primary
113group or supplementary group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000114Only group names are valid; a numerical group ID is not recognized.
115By default, login is allowed for all groups.
djm@openbsd.orgbf986a92020-01-25 22:36:22 +0000116The allow/deny groups directives are processed in the following order:
Damien Millerac73e512006-03-15 11:58:49 +1100117.Cm DenyGroups ,
Damien Millerac73e512006-03-15 11:58:49 +1100118.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100119.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000120See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100121.Xr ssh_config 5
122for more information on patterns.
Damien Miller7acefbb2014-07-18 14:11:24 +1000123.It Cm AllowStreamLocalForwarding
124Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
125The available options are
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000126.Cm yes
127(the default)
Damien Miller7acefbb2014-07-18 14:11:24 +1000128or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000129.Cm all
Damien Miller7acefbb2014-07-18 14:11:24 +1000130to allow StreamLocal forwarding,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000131.Cm no
Damien Miller7acefbb2014-07-18 14:11:24 +1000132to prevent all StreamLocal forwarding,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000133.Cm local
Damien Miller7acefbb2014-07-18 14:11:24 +1000134to allow local (from the perspective of
135.Xr ssh 1 )
136forwarding only or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000137.Cm remote
Damien Miller7acefbb2014-07-18 14:11:24 +1000138to allow remote forwarding only.
Damien Miller7acefbb2014-07-18 14:11:24 +1000139Note that disabling StreamLocal forwarding does not improve security unless
140users are also denied shell access, as they can always install their
141own forwarders.
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000142.It Cm AllowTcpForwarding
143Specifies whether TCP forwarding is permitted.
144The available options are
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000145.Cm yes
146(the default)
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000147or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000148.Cm all
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000149to allow TCP forwarding,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000150.Cm no
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000151to prevent all TCP forwarding,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000152.Cm local
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000153to allow local (from the perspective of
154.Xr ssh 1 )
155forwarding only or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000156.Cm remote
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000157to allow remote forwarding only.
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000158Note that disabling TCP forwarding does not improve security unless
159users are also denied shell access, as they can always install their
160own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000161.It Cm AllowUsers
162This keyword can be followed by a list of user name patterns, separated
163by spaces.
Damien Miller5a93add2003-01-24 11:34:52 +1100164If specified, login is allowed only for user names that
Ben Lindstrom9f049032002-06-21 00:59:05 +0000165match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000166Only user names are valid; a numerical user ID is not recognized.
167By default, login is allowed for all users.
168If the pattern takes the form USER@HOST then USER and HOST
169are separately checked, restricting logins to particular
170users from particular hosts.
jmc@openbsd.orgee1e0a12016-04-27 13:53:48 +0000171HOST criteria may additionally contain addresses to match in CIDR
172address/masklen format.
djm@openbsd.orgbf986a92020-01-25 22:36:22 +0000173The allow/deny users directives are processed in the following order:
Damien Millerac73e512006-03-15 11:58:49 +1100174.Cm DenyUsers ,
djm@openbsd.orgbf986a92020-01-25 22:36:22 +0000175.Cm AllowUsers .
Damien Miller0c2079d2006-03-15 11:54:21 +1100176.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000177See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100178.Xr ssh_config 5
179for more information on patterns.
Damien Millera6e3f012012-11-04 23:21:40 +1100180.It Cm AuthenticationMethods
181Specifies the authentication methods that must be successfully completed
182for a user to be granted access.
djm@openbsd.org472269f2018-07-20 05:01:10 +0000183This option must be followed by one or more lists of comma-separated
djm@openbsd.orgb64faeb2016-06-17 05:03:40 +0000184authentication method names, or by the single string
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000185.Cm any
djm@openbsd.orgb64faeb2016-06-17 05:03:40 +0000186to indicate the default behaviour of accepting any single authentication
jmc@openbsd.orgad23a752016-06-17 06:33:30 +0000187method.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000188If the default is overridden, then successful authentication requires
djm@openbsd.orgb64faeb2016-06-17 05:03:40 +0000189completion of every method in at least one of these lists.
Damien Millera6e3f012012-11-04 23:21:40 +1100190.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000191For example,
192.Qq publickey,password publickey,keyboard-interactive
Damien Millera6e3f012012-11-04 23:21:40 +1100193would require the user to complete public key authentication, followed by
194either password or keyboard interactive authentication.
195Only methods that are next in one or more lists are offered at each stage,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000196so for this example it would not be possible to attempt password or
Damien Millera6e3f012012-11-04 23:21:40 +1100197keyboard-interactive authentication before public key.
198.Pp
Damien Miller91a55f22013-04-23 15:18:10 +1000199For keyboard interactive authentication it is also possible to
200restrict authentication to a specific device by appending a
201colon followed by the device identifier
Damien Miller87f08be2018-07-20 13:18:28 +1000202.Cm bsdauth
Damien Miller91a55f22013-04-23 15:18:10 +1000203or
Damien Miller87f08be2018-07-20 13:18:28 +1000204.Cm pam .
Damien Miller91a55f22013-04-23 15:18:10 +1000205depending on the server configuration.
206For example,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000207.Qq keyboard-interactive:bsdauth
Damien Miller91a55f22013-04-23 15:18:10 +1000208would restrict keyboard interactive authentication to the
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000209.Cm bsdauth
Damien Miller91a55f22013-04-23 15:18:10 +1000210device.
211.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000212If the publickey method is listed more than once,
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000213.Xr sshd 8
214verifies that keys that have been used successfully are not reused for
215subsequent authentications.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000216For example,
217.Qq publickey,publickey
218requires successful authentication using two different public keys.
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000219.Pp
Damien Millera6e3f012012-11-04 23:21:40 +1100220Note that each authentication method listed should also be explicitly enabled
221in the configuration.
djm@openbsd.org8042bad2017-09-01 05:50:48 +0000222.Pp
223The available authentication methods are:
224.Qq gssapi-with-mic ,
225.Qq hostbased ,
226.Qq keyboard-interactive ,
227.Qq none
228(used for access to password-less accounts when
jmc@openbsd.orgf41bcd72018-05-15 05:40:11 +0000229.Cm PermitEmptyPasswords
djm@openbsd.org8042bad2017-09-01 05:50:48 +0000230is enabled),
231.Qq password
232and
233.Qq publickey .
Damien Miller09d3e122012-10-31 08:58:58 +1100234.It Cm AuthorizedKeysCommand
Damien Millerf33580e2012-11-04 22:22:52 +1100235Specifies a program to be used to look up the user's public keys.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000236The program must be owned by root, not writable by group or others and
237specified by an absolute path.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000238Arguments to
239.Cm AuthorizedKeysCommand
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000240accept the tokens described in the
241.Sx TOKENS
242section.
243If no arguments are specified then the username of the target user is used.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000244.Pp
245The program should produce on standard output zero or
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000246more lines of authorized_keys output (see
247.Sx AUTHORIZED_KEYS
248in
Damien Millerf33580e2012-11-04 22:22:52 +1100249.Xr sshd 8 ) .
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000250If a key supplied by
251.Cm AuthorizedKeysCommand
252does not successfully authenticate
Damien Miller09d3e122012-10-31 08:58:58 +1100253and authorize the user then public key authentication continues using the usual
254.Cm AuthorizedKeysFile
255files.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000256By default, no
257.Cm AuthorizedKeysCommand
258is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100259.It Cm AuthorizedKeysCommandUser
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000260Specifies the user under whose account the
261.Cm AuthorizedKeysCommand
262is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100263It is recommended to use a dedicated user that has no other role on the host
264than running authorized keys commands.
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000265If
djm@openbsd.orgd663bea2014-12-11 05:25:06 +0000266.Cm AuthorizedKeysCommand
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000267is specified but
268.Cm AuthorizedKeysCommandUser
269is not, then
270.Xr sshd 8
271will refuse to start.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000272.It Cm AuthorizedKeysFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000273Specifies the file that contains the public keys used for user authentication.
schwarze@openbsd.orgdb7606d2019-05-14 12:47:17 +0000274The format is described in the AUTHORIZED_KEYS FILE FORMAT section of
Damien Miller6018a362010-07-02 13:35:19 +1000275.Xr sshd 8 .
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000276Arguments to
Ben Lindstrom9f049032002-06-21 00:59:05 +0000277.Cm AuthorizedKeysFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000278accept the tokens described in the
279.Sx TOKENS
280section.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000281After expansion,
282.Cm AuthorizedKeysFile
283is taken to be an absolute path or one relative to the user's home
284directory.
Damien Millerb9132fc2011-05-29 21:41:40 +1000285Multiple files may be listed, separated by whitespace.
djm@openbsd.org2bca8a42015-09-11 03:13:36 +0000286Alternately this option may be set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000287.Cm none
djm@openbsd.org2bca8a42015-09-11 03:13:36 +0000288to skip checking for user keys in files.
Damien Millerb9132fc2011-05-29 21:41:40 +1000289The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000290.Qq .ssh/authorized_keys .ssh/authorized_keys2 .
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000291.It Cm AuthorizedPrincipalsCommand
292Specifies a program to be used to generate the list of allowed
293certificate principals as per
294.Cm AuthorizedPrincipalsFile .
295The program must be owned by root, not writable by group or others and
296specified by an absolute path.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000297Arguments to
298.Cm AuthorizedPrincipalsCommand
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000299accept the tokens described in the
300.Sx TOKENS
301section.
302If no arguments are specified then the username of the target user is used.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000303.Pp
304The program should produce on standard output zero or
305more lines of
306.Cm AuthorizedPrincipalsFile
307output.
308If either
309.Cm AuthorizedPrincipalsCommand
310or
311.Cm AuthorizedPrincipalsFile
312is specified, then certificates offered by the client for authentication
313must contain a principal that is listed.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000314By default, no
315.Cm AuthorizedPrincipalsCommand
316is run.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000317.It Cm AuthorizedPrincipalsCommandUser
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000318Specifies the user under whose account the
319.Cm AuthorizedPrincipalsCommand
320is run.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000321It is recommended to use a dedicated user that has no other role on the host
322than running authorized principals commands.
323If
324.Cm AuthorizedPrincipalsCommand
325is specified but
326.Cm AuthorizedPrincipalsCommandUser
327is not, then
328.Xr sshd 8
329will refuse to start.
Damien Miller30da3442010-05-10 11:58:03 +1000330.It Cm AuthorizedPrincipalsFile
331Specifies a file that lists principal names that are accepted for
332certificate authentication.
333When using certificates signed by a key listed in
334.Cm TrustedUserCAKeys ,
335this file lists names, one of which must appear in the certificate for it
336to be accepted for authentication.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000337Names are listed one per line preceded by key options (as described in
338.Sx AUTHORIZED_KEYS FILE FORMAT
339in
Damien Millerd59dab82010-07-02 13:37:17 +1000340.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000341Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000342.Ql #
343are ignored.
344.Pp
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000345Arguments to
Damien Miller30da3442010-05-10 11:58:03 +1000346.Cm AuthorizedPrincipalsFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000347accept the tokens described in the
348.Sx TOKENS
349section.
Damien Miller30da3442010-05-10 11:58:03 +1000350After expansion,
351.Cm AuthorizedPrincipalsFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000352is taken to be an absolute path or one relative to the user's home directory.
Damien Miller8fef9eb2012-04-22 11:25:10 +1000353The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000354.Cm none ,
Damien Miller8fef9eb2012-04-22 11:25:10 +1000355i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000356of the user must appear in a certificate's principals list for it to be
357accepted.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000358.Pp
Damien Miller30da3442010-05-10 11:58:03 +1000359Note that
360.Cm AuthorizedPrincipalsFile
361is only used when authentication proceeds using a CA listed in
362.Cm TrustedUserCAKeys
363and is not consulted for certification authorities trusted via
364.Pa ~/.ssh/authorized_keys ,
365though the
366.Cm principals=
367key option offers a similar facility (see
368.Xr sshd 8
369for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000370.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000371The contents of the specified file are sent to the remote user before
372authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000373If the argument is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000374.Cm none
Damien Miller4890e532007-09-17 11:57:38 +1000375then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000376By default, no banner is displayed.
djm@openbsd.org86e57372018-09-20 03:28:06 +0000377.It Cm CASignatureAlgorithms
378Specifies which algorithms are allowed for signing of certificates
379by certificate authorities (CAs).
380The default is:
381.Bd -literal -offset indent
dtucker@openbsd.org0e2fe182019-07-23 23:06:57 +0000382ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org86e57372018-09-20 03:28:06 +0000383ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
384.Ed
385.Pp
386Certificates signed using other algorithms will not be accepted for
387public key or host-based authentication.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000388.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000389Specifies whether challenge-response authentication is allowed (e.g. via
Damien Millere8c9f262014-10-03 09:24:56 +1000390PAM or through authentication styles supported in
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000391.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000392The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000393.Cm yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100394.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100395Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100396.Xr chroot 2
397to after authentication.
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000398At session startup
399.Xr sshd 8
400checks that all components of the pathname are root-owned directories
401which are not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000402After the chroot,
403.Xr sshd 8
404changes the working directory to the user's home directory.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000405Arguments to
406.Cm ChrootDirectory
407accept the tokens described in the
408.Sx TOKENS
409section.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100410.Pp
411The
412.Cm ChrootDirectory
413must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000414user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100415For an interactive session this requires at least a shell, typically
416.Xr sh 1 ,
417and basic
418.Pa /dev
419nodes such as
420.Xr null 4 ,
421.Xr zero 4 ,
422.Xr stdin 4 ,
423.Xr stdout 4 ,
424.Xr stderr 4 ,
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000425and
Damien Millerd8cb1f12008-02-10 22:40:12 +1100426.Xr tty 4
427devices.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000428For file transfer sessions using SFTP
429no additional configuration of the environment is necessary if the in-process
430sftp-server is used,
Damien Miller426117b2014-07-30 12:33:20 +1000431though sessions which use logging may require
Darren Tucker00fcd712009-06-21 17:56:00 +1000432.Pa /dev/log
Damien Miller426117b2014-07-30 12:33:20 +1000433inside the chroot directory on some operating systems (see
Darren Tucker00fcd712009-06-21 17:56:00 +1000434.Xr sftp-server 8
435for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100436.Pp
jmc@openbsd.orga5a3e332015-01-22 21:00:42 +0000437For safety, it is very important that the directory hierarchy be
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000438prevented from modification by other processes on the system (especially
439those outside the jail).
440Misconfiguration can lead to unsafe environments which
441.Xr sshd 8
442cannot detect.
443.Pp
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000444The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000445.Cm none ,
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000446indicating not to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100447.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000448.It Cm Ciphers
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000449Specifies the ciphers allowed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000450Multiple ciphers must be comma-separated.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +0000451If the specified list begins with a
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000452.Sq +
453character, then the specified ciphers will be appended to the default set
454instead of replacing them.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +0000455If the specified list begins with a
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000456.Sq -
457character, then the specified ciphers (including wildcards) will be removed
458from the default set instead of replacing them.
naddy@openbsd.org91a21352019-09-06 14:45:34 +0000459If the specified list begins with a
460.Sq ^
461character, then the specified ciphers will be placed at the head of the
462default set.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000463.Pp
Damien Miller0fde8ac2013-11-21 14:12:23 +1100464The supported ciphers are:
465.Pp
Damien Millerc1621c82014-04-20 13:22:46 +1000466.Bl -item -compact -offset indent
467.It
4683des-cbc
469.It
470aes128-cbc
471.It
472aes192-cbc
473.It
474aes256-cbc
475.It
476aes128-ctr
477.It
478aes192-ctr
479.It
480aes256-ctr
481.It
482aes128-gcm@openssh.com
483.It
484aes256-gcm@openssh.com
485.It
Damien Millerc1621c82014-04-20 13:22:46 +1000486chacha20-poly1305@openssh.com
487.El
Damien Miller0fde8ac2013-11-21 14:12:23 +1100488.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100489The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000490.Bd -literal -offset indent
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000491chacha20-poly1305@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000492aes128-ctr,aes192-ctr,aes256-ctr,
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000493aes128-gcm@openssh.com,aes256-gcm@openssh.com
Ben Lindstrom9f049032002-06-21 00:59:05 +0000494.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100495.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000496The list of available ciphers may also be obtained using
497.Qq ssh -Q cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000498.It Cm ClientAliveCountMax
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000499Sets the number of client alive messages which may be sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100500.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000501receiving any messages back from the client.
502If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100503sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000504It is important to note that the use of client alive messages is very
505different from
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000506.Cm TCPKeepAlive .
Damien Millerfbf486b2003-05-23 18:44:23 +1000507The client alive messages are sent through the encrypted channel
508and therefore will not be spoofable.
509The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100510.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000511is spoofable.
512The client alive mechanism is valuable when the client or
dtucker@openbsd.org8fdbc722019-08-09 04:24:03 +0000513server depend on knowing when a connection has become unresponsive.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000514.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000515The default value is 3.
516If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000517.Cm ClientAliveInterval
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000518is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000519.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100520is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000521will be disconnected after approximately 45 seconds.
djm@openbsd.org69334992020-01-25 22:41:01 +0000522Setting a zero
523.Cm ClientAliveCountMax
524disables connection termination.
Damien Miller1594ad52005-05-26 12:12:19 +1000525.It Cm ClientAliveInterval
526Sets a timeout interval in seconds after which if no data has been received
527from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100528.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000529will send a message through the encrypted
530channel to request a response from the client.
531The default
532is 0, indicating that these messages will not be sent to the client.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000533.It Cm Compression
djm@openbsd.org4577ade2016-09-28 20:32:42 +0000534Specifies whether compression is enabled after
Damien Miller9786e6e2005-07-26 21:54:56 +1000535the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000536The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000537.Cm yes ,
538.Cm delayed
djm@openbsd.org4577ade2016-09-28 20:32:42 +0000539(a legacy synonym for
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000540.Cm yes )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000541or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000542.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000543The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000544.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000545.It Cm DenyGroups
546This keyword can be followed by a list of group name patterns, separated
547by spaces.
548Login is disallowed for users whose primary group or supplementary
549group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000550Only group names are valid; a numerical group ID is not recognized.
551By default, login is allowed for all groups.
djm@openbsd.orgbf986a92020-01-25 22:36:22 +0000552The allow/deny groups directives are processed in the following order:
Damien Millerac73e512006-03-15 11:58:49 +1100553.Cm DenyGroups ,
Damien Millerac73e512006-03-15 11:58:49 +1100554.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100555.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000556See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100557.Xr ssh_config 5
558for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000559.It Cm DenyUsers
560This keyword can be followed by a list of user name patterns, separated
561by spaces.
562Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000563Only user names are valid; a numerical user ID is not recognized.
564By default, login is allowed for all users.
565If the pattern takes the form USER@HOST then USER and HOST
566are separately checked, restricting logins to particular
567users from particular hosts.
jmc@openbsd.orgee1e0a12016-04-27 13:53:48 +0000568HOST criteria may additionally contain addresses to match in CIDR
569address/masklen format.
djm@openbsd.orgbf986a92020-01-25 22:36:22 +0000570The allow/deny users directives are processed in the following order:
Damien Millerac73e512006-03-15 11:58:49 +1100571.Cm DenyUsers ,
djm@openbsd.orgbf986a92020-01-25 22:36:22 +0000572.Cm AllowUsers .
Damien Miller0c2079d2006-03-15 11:54:21 +1100573.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000574See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100575.Xr ssh_config 5
576for more information on patterns.
djm@openbsd.org7844f352016-11-30 03:00:05 +0000577.It Cm DisableForwarding
578Disables all forwarding features, including X11,
579.Xr ssh-agent 1 ,
580TCP and StreamLocal.
581This option overrides all other forwarding-related options and may
582simplify restricted configurations.
djm@openbsd.org8f574952017-06-24 06:34:38 +0000583.It Cm ExposeAuthInfo
jmc@openbsd.org5fa14072017-09-27 06:45:53 +0000584Writes a temporary file containing a list of authentication methods and
djm@openbsd.org8f574952017-06-24 06:34:38 +0000585public credentials (e.g. keys) used to authenticate the user.
jmc@openbsd.org40962192017-06-24 06:57:04 +0000586The location of the file is exposed to the user session through the
djm@openbsd.orgf17ee612017-06-24 07:08:57 +0000587.Ev SSH_USER_AUTH
jmc@openbsd.org40962192017-06-24 06:57:04 +0000588environment variable.
jmc@openbsd.org5fa14072017-09-27 06:45:53 +0000589The default is
590.Cm no .
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000591.It Cm FingerprintHash
592Specifies the hash algorithm used when logging key fingerprints.
593Valid options are:
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000594.Cm md5
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000595and
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000596.Cm sha256 .
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000597The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000598.Cm sha256 .
Damien Millere2754432006-07-24 14:06:47 +1000599.It Cm ForceCommand
600Forces the execution of the command specified by
601.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100602ignoring any command supplied by the client and
603.Pa ~/.ssh/rc
604if present.
Damien Millere2754432006-07-24 14:06:47 +1000605The command is invoked by using the user's login shell with the -c option.
606This applies to shell, command, or subsystem execution.
607It is most useful inside a
608.Cm Match
609block.
610The command originally supplied by the client is available in the
611.Ev SSH_ORIGINAL_COMMAND
612environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100613Specifying a command of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000614.Cm internal-sftp
615will force the use of an in-process SFTP server that requires no support
Damien Millercdb6e652008-02-10 22:47:24 +1100616files when used with
617.Cm ChrootDirectory .
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000618The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000619.Cm none .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000620.It Cm GatewayPorts
621Specifies whether remote hosts are allowed to connect to ports
622forwarded for the client.
623By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100624.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000625binds remote port forwardings to the loopback address.
626This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000627.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100628can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100629should allow remote port forwardings to bind to non-loopback addresses, thus
630allowing other hosts to connect.
631The argument may be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000632.Cm no
Damien Millerf91ee4c2005-03-01 21:24:33 +1100633to force remote port forwardings to be available to the local host only,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000634.Cm yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100635to force remote port forwardings to bind to the wildcard address, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000636.Cm clientspecified
Damien Millerf91ee4c2005-03-01 21:24:33 +1100637to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000638The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000639.Cm no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000640.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000641Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100642The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000643.Cm no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000644.It Cm GSSAPICleanupCredentials
645Specifies whether to automatically destroy the user's credentials cache
646on logout.
647The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000648.Cm yes .
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000649.It Cm GSSAPIStrictAcceptorCheck
650Determines whether to be strict about the identity of the GSSAPI acceptor
651a client authenticates against.
652If set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000653.Cm yes
654then the client must authenticate against the host
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000655service on the current hostname.
656If set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000657.Cm no
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000658then the client may authenticate against any service key stored in the
659machine's default store.
660This facility is provided to assist with operation on multi homed machines.
661The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000662.Cm yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000663.It Cm HostbasedAcceptedKeyTypes
664Specifies the key types that will be accepted for hostbased authentication
djm@openbsd.org312d2f22018-07-04 13:49:31 +0000665as a list of comma-separated patterns.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +0000666Alternately if the specified list begins with a
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000667.Sq +
668character, then the specified key types will be appended to the default set
669instead of replacing them.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +0000670If the specified list begins with a
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000671.Sq -
672character, then the specified key types (including wildcards) will be removed
673from the default set instead of replacing them.
naddy@openbsd.org91a21352019-09-06 14:45:34 +0000674If the specified list begins with a
675.Sq ^
676character, then the specified key types will be placed at the head of the
677default set.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000678The default for this option is:
679.Bd -literal -offset 3n
680ecdsa-sha2-nistp256-cert-v01@openssh.com,
681ecdsa-sha2-nistp384-cert-v01@openssh.com,
682ecdsa-sha2-nistp521-cert-v01@openssh.com,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +0000683sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000684ssh-ed25519-cert-v01@openssh.com,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +0000685sk-ssh-ed25519-cert-v01@openssh.com,
naddy@openbsd.orgaa4c6402019-11-07 08:38:38 +0000686rsa-sha2-512-cert-v01@openssh.com,
687rsa-sha2-256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000688ssh-rsa-cert-v01@openssh.com,
689ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +0000690sk-ecdsa-sha2-nistp256@openssh.com,
691ssh-ed25519,sk-ssh-ed25519@openssh.com,
692rsa-sha2-512,rsa-sha2-256,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000693.Ed
694.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000695The list of available key types may also be obtained using
dtucker@openbsd.orgd4d9e1d2020-02-07 03:54:44 +0000696.Qq ssh -Q HostbasedAcceptedKeyTypes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000697.It Cm HostbasedAuthentication
698Specifies whether rhosts or /etc/hosts.equiv authentication together
699with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100700(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000701The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000702.Cm no .
Damien Millerb594f382006-08-30 11:06:34 +1000703.It Cm HostbasedUsesNameFromPacketOnly
704Specifies whether or not the server will attempt to perform a reverse
705name lookup when matching the name in the
706.Pa ~/.shosts ,
707.Pa ~/.rhosts ,
708and
709.Pa /etc/hosts.equiv
710files during
711.Cm HostbasedAuthentication .
712A setting of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000713.Cm yes
Damien Millerb594f382006-08-30 11:06:34 +1000714means that
715.Xr sshd 8
716uses the name supplied by the client rather than
717attempting to resolve the name from the TCP connection itself.
718The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000719.Cm no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100720.It Cm HostCertificate
721Specifies a file containing a public host certificate.
722The certificate's public key must match a private host key already specified
723by
724.Cm HostKey .
725The default behaviour of
726.Xr sshd 8
727is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000728.It Cm HostKey
729Specifies a file containing a private host key
730used by SSH.
naddy@openbsd.orgffe65492016-08-15 12:32:04 +0000731The defaults are
Damien Miller8ba0ead2013-12-18 17:46:27 +1100732.Pa /etc/ssh/ssh_host_ecdsa_key ,
733.Pa /etc/ssh/ssh_host_ed25519_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000734and
naddy@openbsd.orgffe65492016-08-15 12:32:04 +0000735.Pa /etc/ssh/ssh_host_rsa_key .
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000736.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000737Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100738.Xr sshd 8
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000739will refuse to use a file if it is group/world-accessible
740and that the
741.Cm HostKeyAlgorithms
742option restricts which of the keys are actually used by
743.Xr sshd 8 .
744.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000745It is possible to have multiple host key files.
Damien Miller85b45e02013-07-20 13:21:52 +1000746It is also possible to specify public host key files instead.
747In this case operations on the private key will be delegated
748to an
749.Xr ssh-agent 1 .
750.It Cm HostKeyAgent
751Identifies the UNIX-domain socket used to communicate
752with an agent that has access to the private host keys.
markus@openbsd.org1a75d142016-05-04 14:29:58 +0000753If the string
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000754.Qq SSH_AUTH_SOCK
Damien Miller85b45e02013-07-20 13:21:52 +1000755is specified, the location of the socket will be read from the
756.Ev SSH_AUTH_SOCK
757environment variable.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000758.It Cm HostKeyAlgorithms
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000759Specifies the host key algorithms
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000760that the server offers.
761The default for this option is:
762.Bd -literal -offset 3n
763ecdsa-sha2-nistp256-cert-v01@openssh.com,
764ecdsa-sha2-nistp384-cert-v01@openssh.com,
765ecdsa-sha2-nistp521-cert-v01@openssh.com,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +0000766sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000767ssh-ed25519-cert-v01@openssh.com,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +0000768sk-ssh-ed25519-cert-v01@openssh.com,
naddy@openbsd.orgaa4c6402019-11-07 08:38:38 +0000769rsa-sha2-512-cert-v01@openssh.com,
770rsa-sha2-256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000771ssh-rsa-cert-v01@openssh.com,
772ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +0000773sk-ecdsa-sha2-nistp256@openssh.com,
774ssh-ed25519,sk-ssh-ed25519@openssh.com,
775rsa-sha2-512,rsa-sha2-256,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000776.Ed
777.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000778The list of available key types may also be obtained using
dtucker@openbsd.orgd4d9e1d2020-02-07 03:54:44 +0000779.Qq ssh -Q HostKeyAlgorithms .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000780.It Cm IgnoreRhosts
781Specifies that
782.Pa .rhosts
783and
784.Pa .shosts
785files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000786.Cm HostbasedAuthentication .
787.Pp
788.Pa /etc/hosts.equiv
789and
790.Pa /etc/shosts.equiv
791are still used.
792The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000793.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000794.It Cm IgnoreUserKnownHosts
795Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100796.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000797should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000798.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000799during
djm@openbsd.org62562ce2018-02-10 06:54:38 +0000800.Cm HostbasedAuthentication
801and use only the system-wide known hosts file
802.Pa /etc/ssh/known_hosts .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000803The default is
djm@openbsd.orgc2bd7f72020-01-31 22:42:45 +0000804.Dq no .
805.It Cm Include
806Include the specified configuration file(s).
jmc@openbsd.org6fb3dd02020-02-01 06:53:12 +0000807Multiple pathnames may be specified and each pathname may contain
djm@openbsd.orgc2bd7f72020-01-31 22:42:45 +0000808.Xr glob 7
809wildcards.
810Files without absolute paths are assumed to be in
811.Pa /etc/ssh .
jmc@openbsd.org6fb3dd02020-02-01 06:53:12 +0000812An
djm@openbsd.orgc2bd7f72020-01-31 22:42:45 +0000813.Cm Include
814directive may appear inside a
815.Cm Match
816block
817to perform conditional inclusion.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100818.It Cm IPQoS
819Specifies the IPv4 type-of-service or DSCP class for the connection.
820Accepted values are
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000821.Cm af11 ,
822.Cm af12 ,
823.Cm af13 ,
824.Cm af21 ,
825.Cm af22 ,
826.Cm af23 ,
827.Cm af31 ,
828.Cm af32 ,
829.Cm af33 ,
830.Cm af41 ,
831.Cm af42 ,
832.Cm af43 ,
833.Cm cs0 ,
834.Cm cs1 ,
835.Cm cs2 ,
836.Cm cs3 ,
837.Cm cs4 ,
838.Cm cs5 ,
839.Cm cs6 ,
840.Cm cs7 ,
841.Cm ef ,
djm@openbsd.org4594c762020-01-28 01:49:36 +0000842.Cm le ,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000843.Cm lowdelay ,
844.Cm throughput ,
845.Cm reliability ,
djm@openbsd.org51676ec2017-07-23 23:37:02 +0000846a numeric value, or
847.Cm none
848to use the operating system default.
Damien Miller928362d2010-12-26 14:26:45 +1100849This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100850If one argument is specified, it is used as the packet class unconditionally.
851If two values are specified, the first is automatically selected for
852interactive sessions and the second for non-interactive sessions.
853The default is
job@openbsd.org5ee84482018-04-04 15:12:17 +0000854.Cm af21
jmc@openbsd.org3e36f282018-04-08 07:36:02 +0000855(Low-Latency Data)
Damien Miller0dac6fb2010-11-20 15:19:38 +1100856for interactive sessions and
job@openbsd.org5ee84482018-04-04 15:12:17 +0000857.Cm cs1
jmc@openbsd.org3e36f282018-04-08 07:36:02 +0000858(Lower Effort)
Damien Miller0dac6fb2010-11-20 15:19:38 +1100859for non-interactive sessions.
Damien Millere1e480a2014-02-04 11:13:17 +1100860.It Cm KbdInteractiveAuthentication
861Specifies whether to allow keyboard-interactive authentication.
862The argument to this keyword must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000863.Cm yes
Damien Millere1e480a2014-02-04 11:13:17 +1100864or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000865.Cm no .
Damien Millere1e480a2014-02-04 11:13:17 +1100866The default is to use whatever value
867.Cm ChallengeResponseAuthentication
868is set to
869(by default
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000870.Cm yes ) .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000871.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000872Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000873.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000874will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000875To use this option, the server needs a
876Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100877The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000878.Cm no .
Damien Miller8448e662004-03-08 23:13:15 +1100879.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000880If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100881an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100882The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000883.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000884.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100885If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000886the password will be validated via any additional local mechanism
887such as
888.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100889The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000890.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000891.It Cm KerberosTicketCleanup
892Specifies whether to automatically destroy the user's ticket cache
893file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100894The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000895.Cm yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000896.It Cm KexAlgorithms
897Specifies the available KEX (Key Exchange) algorithms.
898Multiple algorithms must be comma-separated.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +0000899Alternately if the specified list begins with a
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000900.Sq +
901character, then the specified methods will be appended to the default set
902instead of replacing them.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +0000903If the specified list begins with a
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000904.Sq -
905character, then the specified methods (including wildcards) will be removed
906from the default set instead of replacing them.
naddy@openbsd.org91a21352019-09-06 14:45:34 +0000907If the specified list begins with a
908.Sq ^
909character, then the specified methods will be placed at the head of the
910default set.
Damien Millerc1621c82014-04-20 13:22:46 +1000911The supported algorithms are:
912.Pp
913.Bl -item -compact -offset indent
914.It
djm@openbsd.org16277fc2016-09-22 17:55:13 +0000915curve25519-sha256
916.It
Damien Millerc1621c82014-04-20 13:22:46 +1000917curve25519-sha256@libssh.org
918.It
919diffie-hellman-group1-sha1
920.It
921diffie-hellman-group14-sha1
922.It
djm@openbsd.org680321f2018-02-16 02:40:45 +0000923diffie-hellman-group14-sha256
924.It
925diffie-hellman-group16-sha512
926.It
927diffie-hellman-group18-sha512
928.It
Damien Millerc1621c82014-04-20 13:22:46 +1000929diffie-hellman-group-exchange-sha1
930.It
931diffie-hellman-group-exchange-sha256
932.It
933ecdh-sha2-nistp256
934.It
935ecdh-sha2-nistp384
936.It
937ecdh-sha2-nistp521
dtucker@openbsd.org56bced42020-01-21 06:09:56 +0000938.It
939sntrup4591761x25519-sha512@tinyssh.org
Damien Millerc1621c82014-04-20 13:22:46 +1000940.El
941.Pp
942The default is:
Damien Miller6575c3a2013-12-18 17:47:02 +1100943.Bd -literal -offset indent
djm@openbsd.org16277fc2016-09-22 17:55:13 +0000944curve25519-sha256,curve25519-sha256@libssh.org,
Damien Miller6575c3a2013-12-18 17:47:02 +1100945ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
946diffie-hellman-group-exchange-sha256,
djm@openbsd.org680321f2018-02-16 02:40:45 +0000947diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,
tedu@openbsd.org0b813432020-01-25 07:09:14 +0000948diffie-hellman-group14-sha256
Damien Miller6575c3a2013-12-18 17:47:02 +1100949.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000950.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000951The list of available key exchange algorithms may also be obtained using
dtucker@openbsd.orgd4d9e1d2020-02-07 03:54:44 +0000952.Qq ssh -Q KexAlgorithms .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000953.It Cm ListenAddress
954Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100955.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000956should listen on.
957The following forms may be used:
958.Pp
959.Bl -item -offset indent -compact
960.It
961.Cm ListenAddress
962.Sm off
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000963.Ar hostname | address
Ben Lindstrom9f049032002-06-21 00:59:05 +0000964.Sm on
jmc@openbsd.org@openbsd.org68d3bbb2017-10-26 06:44:01 +0000965.Op Cm rdomain Ar domain
Ben Lindstrom9f049032002-06-21 00:59:05 +0000966.It
967.Cm ListenAddress
968.Sm off
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000969.Ar hostname : port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000970.Sm on
jmc@openbsd.org@openbsd.org68d3bbb2017-10-26 06:44:01 +0000971.Op Cm rdomain Ar domain
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000972.It
973.Cm ListenAddress
974.Sm off
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000975.Ar IPv4_address : port
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000976.Sm on
jmc@openbsd.org@openbsd.org68d3bbb2017-10-26 06:44:01 +0000977.Op Cm rdomain Ar domain
Ben Lindstrom9f049032002-06-21 00:59:05 +0000978.It
979.Cm ListenAddress
980.Sm off
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +0000981.Oo Ar hostname | address Oc : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000982.Sm on
jmc@openbsd.org@openbsd.org68d3bbb2017-10-26 06:44:01 +0000983.Op Cm rdomain Ar domain
Ben Lindstrom9f049032002-06-21 00:59:05 +0000984.El
985.Pp
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000986The optional
987.Cm rdomain
988qualifier requests
989.Xr sshd 8
990listen in an explicit routing domain.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000991If
992.Ar port
993is not specified,
dtucker@openbsd.org531a57a2015-04-29 03:48:56 +0000994sshd will listen on the address and all
Ben Lindstrom9f049032002-06-21 00:59:05 +0000995.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000996options specified.
djm@openbsd.orgacf559e2017-10-25 00:15:35 +0000997The default is to listen on all local addresses on the current default
998routing domain.
Damien Miller495dca32003-04-01 21:42:14 +1000999Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +00001000.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +10001001options are permitted.
djm@openbsd.orgacf559e2017-10-25 00:15:35 +00001002For more information on routing domains, see
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +00001003.Xr rdomain 4 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001004.It Cm LoginGraceTime
1005The server disconnects after this time if the user has not
1006successfully logged in.
1007If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +10001008The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001009.It Cm LogLevel
1010Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001011.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001012The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +11001013QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +10001014The default is INFO.
1015DEBUG and DEBUG1 are equivalent.
1016DEBUG2 and DEBUG3 each specify higher levels of debugging output.
1017Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001018.It Cm MACs
1019Specifies the available MAC (message authentication code) algorithms.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +00001020The MAC algorithm is used for data integrity protection.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001021Multiple algorithms must be comma-separated.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +00001022If the specified list begins with a
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001023.Sq +
1024character, then the specified algorithms will be appended to the default set
1025instead of replacing them.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +00001026If the specified list begins with a
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001027.Sq -
1028character, then the specified algorithms (including wildcards) will be removed
1029from the default set instead of replacing them.
naddy@openbsd.org91a21352019-09-06 14:45:34 +00001030If the specified list begins with a
1031.Sq ^
1032character, then the specified algorithms will be placed at the head of the
1033default set.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001034.Pp
Damien Milleraf43a7a2012-12-12 10:46:31 +11001035The algorithms that contain
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001036.Qq -etm
Damien Milleraf43a7a2012-12-12 10:46:31 +11001037calculate the MAC after encryption (encrypt-then-mac).
1038These are considered safer and their use recommended.
Damien Millerc1621c82014-04-20 13:22:46 +10001039The supported MACs are:
1040.Pp
1041.Bl -item -compact -offset indent
1042.It
1043hmac-md5
1044.It
1045hmac-md5-96
1046.It
Damien Millerc1621c82014-04-20 13:22:46 +10001047hmac-sha1
1048.It
1049hmac-sha1-96
1050.It
1051hmac-sha2-256
1052.It
1053hmac-sha2-512
1054.It
1055umac-64@openssh.com
1056.It
1057umac-128@openssh.com
1058.It
1059hmac-md5-etm@openssh.com
1060.It
1061hmac-md5-96-etm@openssh.com
1062.It
Damien Millerc1621c82014-04-20 13:22:46 +10001063hmac-sha1-etm@openssh.com
1064.It
1065hmac-sha1-96-etm@openssh.com
1066.It
1067hmac-sha2-256-etm@openssh.com
1068.It
1069hmac-sha2-512-etm@openssh.com
1070.It
1071umac-64-etm@openssh.com
1072.It
1073umac-128-etm@openssh.com
1074.El
1075.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +11001076The default is:
Damien Miller22b7b492007-06-11 14:07:12 +10001077.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +11001078umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1079hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001080hmac-sha1-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +10001081umac-64@openssh.com,umac-128@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001082hmac-sha2-256,hmac-sha2-512,hmac-sha1
Damien Miller22b7b492007-06-11 14:07:12 +10001083.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001084.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001085The list of available MAC algorithms may also be obtained using
1086.Qq ssh -Q mac .
Darren Tucker45150472006-07-12 22:34:17 +10001087.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +10001088Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +10001089If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +10001090.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001091line are satisfied, the keywords on the following lines override those
1092set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +10001093.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001094line or the end of the file.
Damien Millerfc5d6752014-02-28 10:01:28 +11001095If a keyword appears in multiple
1096.Cm Match
sobrado@openbsd.org180bcb42014-08-30 16:32:25 +00001097blocks that are satisfied, only the first instance of the keyword is
Damien Millerfc5d6752014-02-28 10:01:28 +11001098applied.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001099.Pp
Damien Millerd04f3572006-07-24 13:46:50 +10001100The arguments to
Darren Tucker45150472006-07-12 22:34:17 +10001101.Cm Match
Damien Millercf31f382013-10-24 21:02:56 +11001102are one or more criteria-pattern pairs or the single token
1103.Cm All
1104which matches all criteria.
Darren Tucker45150472006-07-12 22:34:17 +10001105The available criteria are
1106.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +10001107.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +10001108.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +10001109.Cm LocalAddress ,
1110.Cm LocalPort ,
djm@openbsd.org68af80e2017-10-25 00:19:47 +00001111.Cm RDomain ,
Darren Tucker45150472006-07-12 22:34:17 +10001112and
djm@openbsd.org68af80e2017-10-25 00:19:47 +00001113.Cm Address
1114(with
1115.Cm RDomain
1116representing the
1117.Xr rdomain 4
jmc@openbsd.org62949c52019-03-22 20:58:34 +00001118on which the connection was received).
djm@openbsd.org68af80e2017-10-25 00:19:47 +00001119.Pp
Darren Tucker7a3935d2008-06-10 22:59:10 +10001120The match patterns may consist of single entries or comma-separated
1121lists and may use the wildcard and negation operators described in the
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001122.Sx PATTERNS
1123section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +10001124.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001125.Pp
1126The patterns in an
1127.Cm Address
1128criteria may additionally contain addresses to match in CIDR
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001129address/masklen format,
1130such as 192.0.2.0/24 or 2001:db8::/32.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001131Note that the mask length provided must be consistent with the address -
1132it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +10001133or one with bits set in this host portion of the address.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001134For example, 192.0.2.0/33 and 192.0.2.0/8, respectively.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001135.Pp
Darren Tucker45150472006-07-12 22:34:17 +10001136Only a subset of keywords may be used on the lines following a
1137.Cm Match
1138keyword.
1139Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +10001140.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +11001141.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +10001142.Cm AllowGroups ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001143.Cm AllowStreamLocalForwarding ,
Damien Miller9b439df2006-07-24 14:04:00 +10001144.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +10001145.Cm AllowUsers ,
Damien Millera6e3f012012-11-04 23:21:40 +11001146.Cm AuthenticationMethods ,
Damien Miller09d3e122012-10-31 08:58:58 +11001147.Cm AuthorizedKeysCommand ,
1148.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +11001149.Cm AuthorizedKeysFile ,
djm@openbsd.orgb6b91082015-11-13 02:57:46 +00001150.Cm AuthorizedPrincipalsCommand ,
1151.Cm AuthorizedPrincipalsCommandUser ,
Damien Millerab6de352010-06-26 09:38:45 +10001152.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +11001153.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +10001154.Cm ChrootDirectory ,
markus@openbsd.orgf0ddede2016-11-23 23:14:15 +00001155.Cm ClientAliveCountMax ,
1156.Cm ClientAliveInterval ,
Damien Millerc24da772012-06-20 21:53:58 +10001157.Cm DenyGroups ,
1158.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +10001159.Cm ForceCommand ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001160.Cm GatewayPorts ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +00001161.Cm GSSAPIAuthentication ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001162.Cm HostbasedAcceptedKeyTypes ,
Damien Miller25434de2008-05-19 14:29:08 +10001163.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +10001164.Cm HostbasedUsesNameFromPacketOnly ,
naddy@openbsd.orga6ac5d32020-02-06 22:34:58 +00001165.Cm Include ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001166.Cm IPQoS ,
Darren Tucker1d75f222007-03-01 21:31:28 +11001167.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +11001168.Cm KerberosAuthentication ,
djm@openbsd.org54cd41a2017-05-17 01:24:17 +00001169.Cm LogLevel ,
Damien Miller307c1d12008-06-16 07:56:20 +10001170.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +10001171.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +11001172.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +11001173.Cm PermitEmptyPasswords ,
djm@openbsd.org04df4322018-06-06 18:24:00 +00001174.Cm PermitListen ,
Damien Millerd1de9952006-07-24 14:05:48 +10001175.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +11001176.Cm PermitRootLogin ,
Damien Miller5ff30c62013-10-30 22:21:50 +11001177.Cm PermitTTY ,
Damien Millerab6de352010-06-26 09:38:45 +10001178.Cm PermitTunnel ,
Damien Miller72e6b5c2014-07-04 09:00:04 +10001179.Cm PermitUserRC ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001180.Cm PubkeyAcceptedKeyTypes ,
Darren Tucker1477ea12009-10-07 08:36:05 +11001181.Cm PubkeyAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001182.Cm RekeyLimit ,
1183.Cm RevokedKeys ,
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001184.Cm RDomain ,
djm@openbsd.org28013752018-06-09 03:03:10 +00001185.Cm SetEnv ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001186.Cm StreamLocalBindMask ,
1187.Cm StreamLocalBindUnlink ,
1188.Cm TrustedUserCAKeys ,
Damien Millerd1de9952006-07-24 14:05:48 +10001189.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +11001190.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +10001191and
jmc@openbsd.org76af9c52019-06-12 05:53:21 +00001192.Cm X11UseLocalhost .
Darren Tucker89413db2004-05-24 10:36:23 +10001193.It Cm MaxAuthTries
1194Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +10001195connection.
1196Once the number of failures reaches half this value,
1197additional failures are logged.
1198The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +10001199.It Cm MaxSessions
djm@openbsd.orgcac3b662016-02-05 02:37:56 +00001200Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1201sessions permitted per network connection.
1202Multiple sessions may be established by clients that support connection
1203multiplexing.
1204Setting
1205.Cm MaxSessions
1206to 1 will effectively disable session multiplexing, whereas setting it to 0
1207will prevent all shell, login and subsystem sessions while still permitting
1208forwarding.
Damien Miller7207f642008-05-19 15:34:50 +10001209The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001210.It Cm MaxStartups
1211Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001212SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001213Additional connections will be dropped until authentication succeeds or the
1214.Cm LoginGraceTime
1215expires for a connection.
Damien Miller1f583df2013-02-12 11:02:08 +11001216The default is 10:30:100.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001217.Pp
1218Alternatively, random early drop can be enabled by specifying
1219the three colon separated values
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001220start:rate:full (e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +11001221.Xr sshd 8
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001222will refuse connection attempts with a probability of rate/100 (30%)
1223if there are currently start (10) unauthenticated connections.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001224The probability increases linearly and all connection attempts
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001225are refused if the number of unauthenticated connections reaches full (60).
Ben Lindstrom9f049032002-06-21 00:59:05 +00001226.It Cm PasswordAuthentication
1227Specifies whether password authentication is allowed.
1228The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001229.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001230.It Cm PermitEmptyPasswords
1231When password authentication is allowed, it specifies whether the
1232server allows login to accounts with empty password strings.
1233The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001234.Cm no .
djm@openbsd.org04df4322018-06-06 18:24:00 +00001235.It Cm PermitListen
1236Specifies the addresses/ports on which a remote TCP port forwarding may listen.
1237The listen specification must be one of the following forms:
1238.Pp
1239.Bl -item -offset indent -compact
1240.It
1241.Cm PermitListen
1242.Sm off
djm@openbsd.org87ddd672018-06-19 02:59:41 +00001243.Ar port
1244.Sm on
1245.It
1246.Cm PermitListen
1247.Sm off
djm@openbsd.org04df4322018-06-06 18:24:00 +00001248.Ar host : port
1249.Sm on
djm@openbsd.org04df4322018-06-06 18:24:00 +00001250.El
1251.Pp
1252Multiple permissions may be specified by separating them with whitespace.
1253An argument of
1254.Cm any
1255can be used to remove all restrictions and permit any listen requests.
1256An argument of
1257.Cm none
1258can be used to prohibit all listen requests.
1259The host name may contain wildcards as described in the PATTERNS section in
1260.Xr ssh_config 5 .
1261The wildcard
1262.Sq *
1263can also be used in place of a port number to allow all ports.
1264By default all port forwarding listen requests are permitted.
jmc@openbsd.org6ff6fda2018-06-07 11:26:14 +00001265Note that the
djm@openbsd.org04df4322018-06-06 18:24:00 +00001266.Cm GatewayPorts
1267option may further restrict which addresses may be listened on.
djm@openbsd.org87ddd672018-06-19 02:59:41 +00001268Note also that
1269.Xr ssh 1
1270will request a listen host of
1271.Dq localhost
dtucker@openbsd.org177d6c82019-01-23 20:48:52 +00001272if no listen host was specifically requested, and this name is
jmc@openbsd.orgf535ff92018-06-19 05:36:57 +00001273treated differently to explicit localhost addresses of
djm@openbsd.org87ddd672018-06-19 02:59:41 +00001274.Dq 127.0.0.1
1275and
1276.Dq ::1 .
Damien Miller9b439df2006-07-24 14:04:00 +10001277.It Cm PermitOpen
1278Specifies the destinations to which TCP port forwarding is permitted.
1279The forwarding specification must be one of the following forms:
1280.Pp
1281.Bl -item -offset indent -compact
1282.It
1283.Cm PermitOpen
1284.Sm off
1285.Ar host : port
1286.Sm on
1287.It
1288.Cm PermitOpen
1289.Sm off
1290.Ar IPv4_addr : port
1291.Sm on
1292.It
1293.Cm PermitOpen
1294.Sm off
1295.Ar \&[ IPv6_addr \&] : port
1296.Sm on
1297.El
1298.Pp
Damien Millera765cf42006-07-24 14:08:13 +10001299Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +10001300An argument of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001301.Cm any
Damien Miller9b439df2006-07-24 14:04:00 +10001302can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +10001303An argument of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001304.Cm none
Darren Tuckerba9ea322012-05-19 19:37:33 +10001305can be used to prohibit all forwarding requests.
jmc@openbsd.org32d921c2016-07-19 12:59:16 +00001306The wildcard
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001307.Sq *
djm@openbsd.org734f2f82020-01-25 06:03:10 +00001308can be used for host or port to allow all hosts or ports respectively.
1309Otherwise, no pattern matching or address lookups are performed on supplied
1310names.
Damien Miller65bc2c42006-07-24 14:04:16 +10001311By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001312.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +11001313Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +00001314.Xr ssh 1 .
1315The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001316.Cm yes ,
1317.Cm prohibit-password ,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001318.Cm forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001319or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001320.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001321The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001322.Cm prohibit-password .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001323.Pp
1324If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001325.Cm prohibit-password
jmc@openbsd.org071325f2017-10-13 16:50:45 +00001326(or its deprecated alias,
1327.Cm without-password ) ,
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001328password and keyboard-interactive authentication are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001329.Pp
1330If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001331.Cm forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001332root login with public key authentication will be allowed,
1333but only if the
1334.Ar command
1335option has been specified
1336(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +10001337normally not allowed).
1338All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001339.Pp
1340If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001341.Cm no ,
Darren Tuckerb3509012005-01-20 11:01:46 +11001342root is not allowed to log in.
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +00001343.It Cm PermitTTY
1344Specifies whether
1345.Xr pty 4
1346allocation is permitted.
1347The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001348.Cm yes .
Damien Millerd27b9472005-12-13 19:29:02 +11001349.It Cm PermitTunnel
1350Specifies whether
1351.Xr tun 4
1352device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +11001353The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001354.Cm yes ,
1355.Cm point-to-point
Damien Miller991dba42006-07-10 20:16:27 +10001356(layer 3),
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001357.Cm ethernet
Damien Miller991dba42006-07-10 20:16:27 +10001358(layer 2), or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001359.Cm no .
Damien Miller991dba42006-07-10 20:16:27 +10001360Specifying
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001361.Cm yes
Damien Miller991dba42006-07-10 20:16:27 +10001362permits both
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001363.Cm point-to-point
Damien Miller991dba42006-07-10 20:16:27 +10001364and
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001365.Cm ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +11001366The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001367.Cm no .
djm@openbsd.org48dffd52014-09-09 09:45:36 +00001368.Pp
1369Independent of this setting, the permissions of the selected
1370.Xr tun 4
1371device must allow access to the user.
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001372.It Cm PermitUserEnvironment
1373Specifies whether
1374.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001375and
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001376.Cm environment=
1377options in
1378.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001379are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +11001380.Xr sshd 8 .
djm@openbsd.org95344c22018-07-03 10:59:35 +00001381Valid options are
1382.Cm yes ,
1383.Cm no
1384or a pattern-list specifying which environment variable names to accept
1385(for example
1386.Qq LANG,LC_* ) .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001387The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001388.Cm no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001389Enabling environment processing may enable users to bypass access
1390restrictions in some configurations using mechanisms such as
1391.Ev LD_PRELOAD .
Damien Miller72e6b5c2014-07-04 09:00:04 +10001392.It Cm PermitUserRC
1393Specifies whether any
1394.Pa ~/.ssh/rc
1395file is executed.
1396The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001397.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001398.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +00001399Specifies the file that contains the process ID of the
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001400SSH daemon, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001401.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001402to not write one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001403The default is
1404.Pa /var/run/sshd.pid .
1405.It Cm Port
1406Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +11001407.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001408listens on.
1409The default is 22.
1410Multiple options of this type are permitted.
1411See also
1412.Cm ListenAddress .
1413.It Cm PrintLastLog
1414Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001415.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +11001416should print the date and time of the last user login when a user logs
1417in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001418The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001419.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001420.It Cm PrintMotd
1421Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001422.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001423should print
1424.Pa /etc/motd
1425when a user logs in interactively.
1426(On some systems it is also printed by the shell,
1427.Pa /etc/profile ,
1428or equivalent.)
1429The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001430.Cm yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001431.It Cm PubkeyAcceptedKeyTypes
1432Specifies the key types that will be accepted for public key authentication
djm@openbsd.org312d2f22018-07-04 13:49:31 +00001433as a list of comma-separated patterns.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +00001434Alternately if the specified list begins with a
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001435.Sq +
1436character, then the specified key types will be appended to the default set
1437instead of replacing them.
naddy@openbsd.org4f9d75f2019-09-04 20:31:15 +00001438If the specified list begins with a
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001439.Sq -
1440character, then the specified key types (including wildcards) will be removed
1441from the default set instead of replacing them.
naddy@openbsd.org91a21352019-09-06 14:45:34 +00001442If the specified list begins with a
1443.Sq ^
1444character, then the specified key types will be placed at the head of the
1445default set.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001446The default for this option is:
1447.Bd -literal -offset 3n
1448ecdsa-sha2-nistp256-cert-v01@openssh.com,
1449ecdsa-sha2-nistp384-cert-v01@openssh.com,
1450ecdsa-sha2-nistp521-cert-v01@openssh.com,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +00001451sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001452ssh-ed25519-cert-v01@openssh.com,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +00001453sk-ssh-ed25519-cert-v01@openssh.com,
naddy@openbsd.orgaa4c6402019-11-07 08:38:38 +00001454rsa-sha2-512-cert-v01@openssh.com,
1455rsa-sha2-256-cert-v01@openssh.com,
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001456ssh-rsa-cert-v01@openssh.com,
1457ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
naddy@openbsd.orgae024b22019-12-19 15:09:30 +00001458sk-ecdsa-sha2-nistp256@openssh.com,
1459ssh-ed25519,sk-ssh-ed25519@openssh.com,
1460rsa-sha2-512,rsa-sha2-256,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001461.Ed
1462.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001463The list of available key types may also be obtained using
dtucker@openbsd.orgd4d9e1d2020-02-07 03:54:44 +00001464.Qq ssh -Q PubkeyAcceptedKeyTypes .
djm@openbsd.org0fddf292019-11-25 00:52:46 +00001465.It Cm PubkeyAuthOptions
1466Sets one or more public key authentication options.
1467Two option keywords are currently supported:
jmc@openbsd.org8635afa2019-11-26 22:42:26 +00001468.Cm none
1469(the default; indicating no additional options are enabled)
djm@openbsd.org0fddf292019-11-25 00:52:46 +00001470and
1471.Cm touch-required .
1472.Pp
1473The
1474.Cm touch-required
naddy@openbsd.org141df482019-12-21 20:22:34 +00001475option causes public key authentication using a FIDO authenticator algorithm
jmc@openbsd.org8635afa2019-11-26 22:42:26 +00001476(i.e.\&
djm@openbsd.org0fddf292019-11-25 00:52:46 +00001477.Cm ecdsa-sk
1478or
1479.Cm ed25519-sk )
1480to always require the signature to attest that a physically present user
naddy@openbsd.org141df482019-12-21 20:22:34 +00001481explicitly confirmed the authentication (usually by touching the authenticator).
djm@openbsd.org0fddf292019-11-25 00:52:46 +00001482By default,
1483.Xr sshd 8
naddy@openbsd.org141df482019-12-21 20:22:34 +00001484requires user presence unless overridden with an authorized_keys option.
djm@openbsd.org0fddf292019-11-25 00:52:46 +00001485The
1486.Cm touch-required
1487flag disables this override.
naddy@openbsd.org141df482019-12-21 20:22:34 +00001488This option has no effect for other, non-authenticator public key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001489.It Cm PubkeyAuthentication
1490Specifies whether public key authentication is allowed.
1491The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001492.Cm yes .
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001493.It Cm RekeyLimit
1494Specifies the maximum amount of data that may be transmitted before the
1495session key is renegotiated, optionally followed a maximum amount of
1496time that may pass before the session key is renegotiated.
1497The first argument is specified in bytes and may have a suffix of
1498.Sq K ,
1499.Sq M ,
1500or
1501.Sq G
1502to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1503The default is between
1504.Sq 1G
1505and
1506.Sq 4G ,
1507depending on the cipher.
1508The optional second value is specified in seconds and may use any of the
1509units documented in the
1510.Sx TIME FORMATS
Darren Tucker64d22942013-05-16 20:31:29 +10001511section.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001512The default value for
1513.Cm RekeyLimit
1514is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001515.Cm default none ,
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001516which means that rekeying is performed after the cipher's default amount
1517of data has been sent or received and no time based rekeying is done.
Damien Miller1aed65e2010-03-04 21:53:35 +11001518.It Cm RevokedKeys
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001519Specifies revoked public keys file, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001520.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001521to not use one.
Damien Miller1aed65e2010-03-04 21:53:35 +11001522Keys listed in this file will be refused for public key authentication.
1523Note that if this file is not readable, then public key authentication will
1524be refused for all users.
Damien Millerf3747bf2013-01-18 11:44:04 +11001525Keys may be specified as a text file, listing one public key per line, or as
1526an OpenSSH Key Revocation List (KRL) as generated by
Damien Miller72abeb72013-01-20 22:33:44 +11001527.Xr ssh-keygen 1 .
Damien Millerfecfd112013-07-18 16:11:50 +10001528For more information on KRLs, see the KEY REVOCATION LISTS section in
Damien Millerf3747bf2013-01-18 11:44:04 +11001529.Xr ssh-keygen 1 .
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001530.It Cm RDomain
1531Specifies an explicit routing domain that is applied after authentication
1532has completed.
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +00001533The user session, as well and any forwarded or listening IP sockets,
1534will be bound to this
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001535.Xr rdomain 4 .
1536If the routing domain is set to
1537.Cm \&%D ,
jmc@openbsd.org@openbsd.org7530e772017-10-25 06:18:06 +00001538then the domain in which the incoming connection was received will be applied.
naddy@openbsd.orgae024b22019-12-19 15:09:30 +00001539.It Cm SecurityKeyProvider
naddy@openbsd.org141df482019-12-21 20:22:34 +00001540Specifies a path to a library that will be used when loading
1541FIDO authenticator-hosted keys, overriding the default of using
1542the built-in USB HID support.
djm@openbsd.org28013752018-06-09 03:03:10 +00001543.It Cm SetEnv
1544Specifies one or more environment variables to set in child sessions started
1545by
1546.Xr sshd 8
1547as
1548.Dq NAME=VALUE .
1549The environment value may be quoted (e.g. if it contains whitespace
1550characters).
1551Environment variables set by
1552.Cm SetEnv
1553override the default environment and any variables specified by the user
1554via
1555.Cm AcceptEnv
1556or
1557.Cm PermitUserEnvironment .
Damien Miller7acefbb2014-07-18 14:11:24 +10001558.It Cm StreamLocalBindMask
1559Sets the octal file creation mode mask
1560.Pq umask
1561used when creating a Unix-domain socket file for local or remote
1562port forwarding.
1563This option is only used for port forwarding to a Unix-domain socket file.
1564.Pp
1565The default value is 0177, which creates a Unix-domain socket file that is
1566readable and writable only by the owner.
1567Note that not all operating systems honor the file mode on Unix-domain
1568socket files.
1569.It Cm StreamLocalBindUnlink
1570Specifies whether to remove an existing Unix-domain socket file for local
1571or remote port forwarding before creating a new one.
1572If the socket file already exists and
1573.Cm StreamLocalBindUnlink
1574is not enabled,
1575.Nm sshd
1576will be unable to forward the port to the Unix-domain socket file.
1577This option is only used for port forwarding to a Unix-domain socket file.
1578.Pp
1579The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001580.Cm yes
Damien Miller7acefbb2014-07-18 14:11:24 +10001581or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001582.Cm no .
Damien Miller7acefbb2014-07-18 14:11:24 +10001583The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001584.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001585.It Cm StrictModes
1586Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001587.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001588should check file modes and ownership of the
1589user's files and home directory before accepting login.
1590This is normally desirable because novices sometimes accidentally leave their
1591directory or files world-writable.
1592The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001593.Cm yes .
Darren Tuckerf788a912010-01-08 17:06:47 +11001594Note that this does not apply to
1595.Cm ChrootDirectory ,
1596whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001597.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +11001598Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +10001599Arguments should be a subsystem name and a command (with optional arguments)
1600to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001601.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001602The command
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001603.Cm sftp-server
1604implements the SFTP file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001605.Pp
1606Alternately the name
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001607.Cm internal-sftp
1608implements an in-process SFTP server.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001609This may simplify configurations using
1610.Cm ChrootDirectory
1611to force a different filesystem root on clients.
1612.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001613By default no subsystems are defined.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001614.It Cm SyslogFacility
1615Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001616.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001617The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1618LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1619The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001620.It Cm TCPKeepAlive
1621Specifies whether the system should send TCP keepalive messages to the
1622other side.
1623If they are sent, death of the connection or crash of one
1624of the machines will be properly noticed.
1625However, this means that
1626connections will die if the route is down temporarily, and some people
1627find it annoying.
1628On the other hand, if TCP keepalives are not sent,
1629sessions may hang indefinitely on the server, leaving
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001630.Qq ghost
Damien Miller12c150e2003-12-17 16:31:10 +11001631users and consuming server resources.
1632.Pp
1633The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001634.Cm yes
Damien Miller12c150e2003-12-17 16:31:10 +11001635(to send TCP keepalive messages), and the server will notice
1636if the network goes down or the client host crashes.
1637This avoids infinitely hanging sessions.
1638.Pp
1639To disable TCP keepalive messages, the value should be set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001640.Cm no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001641.It Cm TrustedUserCAKeys
1642Specifies a file containing public keys of certificate authorities that are
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001643trusted to sign user certificates for authentication, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001644.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001645to not use one.
Damien Miller72b33822010-03-05 07:39:01 +11001646Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001647.Ql #
1648are allowed.
1649If a certificate is presented for authentication and has its signing CA key
1650listed in this file, then it may be used for authentication for any user
1651listed in the certificate's principals list.
1652Note that certificates that lack a list of principals will not be permitted
1653for authentication using
1654.Cm TrustedUserCAKeys .
Damien Millerfecfd112013-07-18 16:11:50 +10001655For more details on certificates, see the CERTIFICATES section in
Damien Miller1aed65e2010-03-04 21:53:35 +11001656.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001657.It Cm UseDNS
1658Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001659.Xr sshd 8
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001660should look up the remote host name, and to check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001661the resolved host name for the remote IP address maps back to the
1662very same IP address.
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001663.Pp
1664If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001665.Cm no
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001666(the default) then only addresses and not host names may be used in
djm@openbsd.org0235a5f2016-03-17 17:19:43 +00001667.Pa ~/.ssh/authorized_keys
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001668.Cm from
1669and
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +00001670.Nm
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001671.Cm Match
1672.Cm Host
1673directives.
Damien Miller2e193e22003-05-14 15:13:03 +10001674.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001675Enables the Pluggable Authentication Module interface.
1676If set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001677.Cm yes
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001678this will enable PAM authentication using
1679.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001680and
1681.Cm PasswordAuthentication
1682in addition to PAM account and session module processing for all
1683authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001684.Pp
1685Because PAM challenge-response authentication usually serves an equivalent
1686role to password authentication, you should disable either
1687.Cm PasswordAuthentication
1688or
1689.Cm ChallengeResponseAuthentication.
1690.Pp
1691If
1692.Cm UsePAM
1693is enabled, you will not be able to run
1694.Xr sshd 8
1695as a non-root user.
1696The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001697.Cm no .
Damien Miller23528812012-04-22 11:24:43 +10001698.It Cm VersionAddendum
1699Optionally specifies additional text to append to the SSH protocol banner
1700sent by the server upon connection.
1701The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001702.Cm none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001703.It Cm X11DisplayOffset
1704Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001705.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001706X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001707This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001708The default is 10.
1709.It Cm X11Forwarding
1710Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001711The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001712.Cm yes
Damien Miller101c4a72002-09-19 11:51:21 +10001713or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001714.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001715The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001716.Cm no .
Damien Miller101c4a72002-09-19 11:51:21 +10001717.Pp
1718When X11 forwarding is enabled, there may be additional exposure to
1719the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001720.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001721proxy display is configured to listen on the wildcard address (see
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001722.Cm X11UseLocalhost ) ,
1723though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001724Additionally, the authentication spoofing and authentication data
1725verification and substitution occur on the client side.
1726The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001727display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001728forwarding (see the warnings for
1729.Cm ForwardX11
1730in
Damien Millerf1ce5052003-06-11 22:04:39 +10001731.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001732A system administrator may have a stance in which they want to
1733protect clients that may expose themselves to attack by unwittingly
1734requesting X11 forwarding, which can warrant a
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001735.Cm no
Damien Miller101c4a72002-09-19 11:51:21 +10001736setting.
1737.Pp
1738Note that disabling X11 forwarding does not prevent users from
1739forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001740.It Cm X11UseLocalhost
1741Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001742.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001743should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001744the wildcard address.
1745By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001746sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001747hostname part of the
1748.Ev DISPLAY
1749environment variable to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001750.Cm localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001751This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001752However, some older X11 clients may not function with this
1753configuration.
1754.Cm X11UseLocalhost
1755may be set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001756.Cm no
Ben Lindstrom9f049032002-06-21 00:59:05 +00001757to specify that the forwarding server should be bound to the wildcard
1758address.
1759The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001760.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +00001761or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001762.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001763The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001764.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001765.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001766Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001767.Xr xauth 1
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001768program, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001769.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001770to not use one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001771The default is
1772.Pa /usr/X11R6/bin/xauth .
1773.El
Damien Millere3beba22006-03-15 11:59:25 +11001774.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001775.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001776command-line arguments and configuration file options that specify time
1777may be expressed using a sequence of the form:
1778.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001779.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001780.Sm on
1781where
1782.Ar time
1783is a positive integer value and
1784.Ar qualifier
1785is one of the following:
1786.Pp
1787.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001788.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001789seconds
1790.It Cm s | Cm S
1791seconds
1792.It Cm m | Cm M
1793minutes
1794.It Cm h | Cm H
1795hours
1796.It Cm d | Cm D
1797days
1798.It Cm w | Cm W
1799weeks
1800.El
1801.Pp
1802Each member of the sequence is added together to calculate
1803the total time value.
1804.Pp
1805Time format examples:
1806.Pp
1807.Bl -tag -width Ds -compact -offset indent
1808.It 600
1809600 seconds (10 minutes)
1810.It 10m
181110 minutes
1812.It 1h30m
18131 hour 30 minutes (90 minutes)
1814.El
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001815.Sh TOKENS
1816Arguments to some keywords can make use of tokens,
1817which are expanded at runtime:
1818.Pp
1819.Bl -tag -width XXXX -offset indent -compact
1820.It %%
1821A literal
1822.Sq % .
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001823.It \&%D
1824The routing domain in which the incoming connection was received.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001825.It %F
1826The fingerprint of the CA key.
1827.It %f
1828The fingerprint of the key or certificate.
1829.It %h
1830The home directory of the user.
1831.It %i
1832The key ID in the certificate.
1833.It %K
1834The base64-encoded CA key.
1835.It %k
1836The base64-encoded key or certificate for authentication.
1837.It %s
1838The serial number of the certificate.
1839.It \&%T
1840The type of the CA key.
1841.It %t
1842The key or certificate type.
jmc@openbsd.org29402842018-06-01 05:50:18 +00001843.It \&%U
1844The numeric user ID of the target user.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001845.It %u
1846The username.
1847.El
1848.Pp
1849.Cm AuthorizedKeysCommand
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001850accepts the tokens %%, %f, %h, %k, %t, %U, and %u.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001851.Pp
1852.Cm AuthorizedKeysFile
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001853accepts the tokens %%, %h, %U, and %u.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001854.Pp
1855.Cm AuthorizedPrincipalsCommand
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001856accepts the tokens %%, %F, %f, %h, %i, %K, %k, %s, %T, %t, %U, and %u.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001857.Pp
1858.Cm AuthorizedPrincipalsFile
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001859accepts the tokens %%, %h, %U, and %u.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001860.Pp
1861.Cm ChrootDirectory
jmc@openbsd.orge8d59fe2018-06-01 06:23:10 +00001862accepts the tokens %%, %h, %U, and %u.
djm@openbsd.org35eb33f2017-10-25 00:17:08 +00001863.Pp
1864.Cm RoutingDomain
1865accepts the token %D.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001866.Sh FILES
1867.Bl -tag -width Ds
1868.It Pa /etc/ssh/sshd_config
1869Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001870.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001871This file should be writable by root only, but it is recommended
1872(though not necessary) that it be world-readable.
1873.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001874.Sh SEE ALSO
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001875.Xr sftp-server 8 ,
Damien Millerf1ce5052003-06-11 22:04:39 +10001876.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001877.Sh AUTHORS
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001878.An -nosplit
Ben Lindstrom9f049032002-06-21 00:59:05 +00001879OpenSSH is a derivative of the original and free
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001880ssh 1.2.12 release by
1881.An Tatu Ylonen .
1882.An Aaron Campbell , Bob Beck , Markus Friedl , Niels Provos ,
1883.An Theo de Raadt
1884and
1885.An Dug Song
Ben Lindstrom9f049032002-06-21 00:59:05 +00001886removed many bugs, re-added newer features and
1887created OpenSSH.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001888.An Markus Friedl
1889contributed the support for SSH protocol versions 1.5 and 2.0.
1890.An Niels Provos
1891and
1892.An Markus Friedl
1893contributed support for privilege separation.