blob: 136601d6bfe06232ce4ef2771026de49c51dc764 [file] [log] [blame]
Ben Lindstrom9f049032002-06-21 00:59:05 +00001.\"
2.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
3.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4.\" All rights reserved
5.\"
6.\" As far as I am concerned, the code I have written for this software
7.\" can be used freely for any purpose. Any derived versions of this
8.\" software must be clearly marked as such, and if the derived work is
9.\" incompatible with the protocol description in the RFC file, it must be
10.\" called by a name other than "ssh" or "Secure Shell".
11.\"
12.\" Copyright (c) 1999,2000 Markus Friedl. All rights reserved.
13.\" Copyright (c) 1999 Aaron Campbell. All rights reserved.
14.\" Copyright (c) 1999 Theo de Raadt. All rights reserved.
15.\"
16.\" Redistribution and use in source and binary forms, with or without
17.\" modification, are permitted provided that the following conditions
18.\" are met:
19.\" 1. Redistributions of source code must retain the above copyright
20.\" notice, this list of conditions and the following disclaimer.
21.\" 2. Redistributions in binary form must reproduce the above copyright
22.\" notice, this list of conditions and the following disclaimer in the
23.\" documentation and/or other materials provided with the distribution.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
26.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
29.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35.\"
jmc@openbsd.orgff3c4232017-09-01 15:41:26 +000036.\" $OpenBSD: sshd_config.5,v 1.252 2017/09/01 15:41:26 jmc Exp $
djm@openbsd.org8042bad2017-09-01 05:50:48 +000037.Dd $Mdocdate: September 1 2017 $
Ben Lindstrom9f049032002-06-21 00:59:05 +000038.Dt SSHD_CONFIG 5
39.Os
40.Sh NAME
41.Nm sshd_config
42.Nd OpenSSH SSH daemon configuration file
Ben Lindstrom9f049032002-06-21 00:59:05 +000043.Sh DESCRIPTION
Damien Millerf4f22b52006-03-15 11:57:25 +110044.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +000045reads configuration data from
46.Pa /etc/ssh/sshd_config
47(or the file specified with
48.Fl f
49on the command line).
50The file contains keyword-argument pairs, one per line.
51Lines starting with
52.Ql #
53and empty lines are interpreted as comments.
Damien Miller306d1182006-03-15 12:05:59 +110054Arguments may optionally be enclosed in double quotes
55.Pq \&"
56in order to represent arguments containing spaces.
Ben Lindstrom9f049032002-06-21 00:59:05 +000057.Pp
58The possible
59keywords and their meanings are as follows (note that
60keywords are case-insensitive and arguments are case-sensitive):
61.Bl -tag -width Ds
Darren Tucker46bc0752004-05-02 22:11:30 +100062.It Cm AcceptEnv
63Specifies what environment variables sent by the client will be copied into
64the session's
65.Xr environ 7 .
66See
67.Cm SendEnv
68in
69.Xr ssh_config 5
70for how to configure the client.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +000071The
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +000072.Ev TERM
jmc@openbsd.orgc1d5bcf2015-04-28 13:47:38 +000073environment variable is always sent whenever the client
djm@openbsd.org732d61f2015-06-05 03:44:14 +000074requests a pseudo-terminal as it is required by the protocol.
Darren Tucker46bc0752004-05-02 22:11:30 +100075Variables are specified by name, which may contain the wildcard characters
Damien Miller208f1ed2006-03-15 11:56:03 +110076.Ql *
Darren Tucker46bc0752004-05-02 22:11:30 +100077and
78.Ql \&? .
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100079Multiple environment variables may be separated by whitespace or spread
Darren Tucker46bc0752004-05-02 22:11:30 +100080across multiple
81.Cm AcceptEnv
82directives.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100083Be warned that some environment variables could be used to bypass restricted
Darren Tucker46bc0752004-05-02 22:11:30 +100084user environments.
85For this reason, care should be taken in the use of this directive.
86The default is not to accept any environment variables.
Darren Tucker0f383232005-01-20 10:57:56 +110087.It Cm AddressFamily
88Specifies which address family should be used by
Damien Millerf4f22b52006-03-15 11:57:25 +110089.Xr sshd 8 .
Darren Tucker0f383232005-01-20 10:57:56 +110090Valid arguments are
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +000091.Cm any
92(the default),
93.Cm inet
Damien Miller5b0d63f2006-03-15 11:56:56 +110094(use IPv4 only), or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +000095.Cm inet6
Darren Tucker0f383232005-01-20 10:57:56 +110096(use IPv6 only).
Damien Millere9890192008-05-19 14:59:02 +100097.It Cm AllowAgentForwarding
98Specifies whether
99.Xr ssh-agent 1
100forwarding is permitted.
101The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000102.Cm yes .
Damien Millere9890192008-05-19 14:59:02 +1000103Note that disabling agent forwarding does not improve security
104unless users are also denied shell access, as they can always install
105their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000106.It Cm AllowGroups
107This keyword can be followed by a list of group name patterns, separated
108by spaces.
109If specified, login is allowed only for users whose primary
110group or supplementary group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000111Only group names are valid; a numerical group ID is not recognized.
112By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100113The allow/deny directives are processed in the following order:
114.Cm DenyUsers ,
115.Cm AllowUsers ,
116.Cm DenyGroups ,
117and finally
118.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.
Damien Millerac73e512006-03-15 11:58:49 +1100173The allow/deny directives are processed in the following order:
174.Cm DenyUsers ,
175.Cm AllowUsers ,
176.Cm DenyGroups ,
177and finally
178.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100179.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000180See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100181.Xr ssh_config 5
182for more information on patterns.
Damien Millera6e3f012012-11-04 23:21:40 +1100183.It Cm AuthenticationMethods
184Specifies the authentication methods that must be successfully completed
185for a user to be granted access.
186This option must be followed by one or more comma-separated lists of
djm@openbsd.orgb64faeb2016-06-17 05:03:40 +0000187authentication method names, or by the single string
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000188.Cm any
djm@openbsd.orgb64faeb2016-06-17 05:03:40 +0000189to indicate the default behaviour of accepting any single authentication
jmc@openbsd.orgad23a752016-06-17 06:33:30 +0000190method.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000191If the default is overridden, then successful authentication requires
djm@openbsd.orgb64faeb2016-06-17 05:03:40 +0000192completion of every method in at least one of these lists.
Damien Millera6e3f012012-11-04 23:21:40 +1100193.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000194For example,
195.Qq publickey,password publickey,keyboard-interactive
Damien Millera6e3f012012-11-04 23:21:40 +1100196would require the user to complete public key authentication, followed by
197either password or keyboard interactive authentication.
198Only methods that are next in one or more lists are offered at each stage,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000199so for this example it would not be possible to attempt password or
Damien Millera6e3f012012-11-04 23:21:40 +1100200keyboard-interactive authentication before public key.
201.Pp
Damien Miller91a55f22013-04-23 15:18:10 +1000202For keyboard interactive authentication it is also possible to
203restrict authentication to a specific device by appending a
204colon followed by the device identifier
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000205.Cm bsdauth ,
206.Cm pam ,
Damien Miller91a55f22013-04-23 15:18:10 +1000207or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000208.Cm skey ,
Damien Miller91a55f22013-04-23 15:18:10 +1000209depending on the server configuration.
210For example,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000211.Qq keyboard-interactive:bsdauth
Damien Miller91a55f22013-04-23 15:18:10 +1000212would restrict keyboard interactive authentication to the
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000213.Cm bsdauth
Damien Miller91a55f22013-04-23 15:18:10 +1000214device.
215.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000216If the publickey method is listed more than once,
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000217.Xr sshd 8
218verifies that keys that have been used successfully are not reused for
219subsequent authentications.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000220For example,
221.Qq publickey,publickey
222requires successful authentication using two different public keys.
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000223.Pp
Damien Millera6e3f012012-11-04 23:21:40 +1100224Note that each authentication method listed should also be explicitly enabled
225in the configuration.
djm@openbsd.org8042bad2017-09-01 05:50:48 +0000226.Pp
227The available authentication methods are:
228.Qq gssapi-with-mic ,
229.Qq hostbased ,
230.Qq keyboard-interactive ,
231.Qq none
232(used for access to password-less accounts when
233.Cm PermitEmptyPassword
234is enabled),
235.Qq password
236and
237.Qq publickey .
Damien Miller09d3e122012-10-31 08:58:58 +1100238.It Cm AuthorizedKeysCommand
Damien Millerf33580e2012-11-04 22:22:52 +1100239Specifies a program to be used to look up the user's public keys.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000240The program must be owned by root, not writable by group or others and
241specified by an absolute path.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000242Arguments to
243.Cm AuthorizedKeysCommand
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000244accept the tokens described in the
245.Sx TOKENS
246section.
247If no arguments are specified then the username of the target user is used.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000248.Pp
249The program should produce on standard output zero or
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000250more lines of authorized_keys output (see
251.Sx AUTHORIZED_KEYS
252in
Damien Millerf33580e2012-11-04 22:22:52 +1100253.Xr sshd 8 ) .
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000254If a key supplied by
255.Cm AuthorizedKeysCommand
256does not successfully authenticate
Damien Miller09d3e122012-10-31 08:58:58 +1100257and authorize the user then public key authentication continues using the usual
258.Cm AuthorizedKeysFile
259files.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000260By default, no
261.Cm AuthorizedKeysCommand
262is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100263.It Cm AuthorizedKeysCommandUser
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000264Specifies the user under whose account the
265.Cm AuthorizedKeysCommand
266is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100267It is recommended to use a dedicated user that has no other role on the host
268than running authorized keys commands.
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000269If
djm@openbsd.orgd663bea2014-12-11 05:25:06 +0000270.Cm AuthorizedKeysCommand
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000271is specified but
272.Cm AuthorizedKeysCommandUser
273is not, then
274.Xr sshd 8
275will refuse to start.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000276.It Cm AuthorizedKeysFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000277Specifies the file that contains the public keys used for user authentication.
Damien Miller6018a362010-07-02 13:35:19 +1000278The format is described in the
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000279.Sx AUTHORIZED_KEYS FILE FORMAT
Damien Miller6018a362010-07-02 13:35:19 +1000280section of
281.Xr sshd 8 .
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000282Arguments to
Ben Lindstrom9f049032002-06-21 00:59:05 +0000283.Cm AuthorizedKeysFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000284accept the tokens described in the
285.Sx TOKENS
286section.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000287After expansion,
288.Cm AuthorizedKeysFile
289is taken to be an absolute path or one relative to the user's home
290directory.
Damien Millerb9132fc2011-05-29 21:41:40 +1000291Multiple files may be listed, separated by whitespace.
djm@openbsd.org2bca8a42015-09-11 03:13:36 +0000292Alternately this option may be set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000293.Cm none
djm@openbsd.org2bca8a42015-09-11 03:13:36 +0000294to skip checking for user keys in files.
Damien Millerb9132fc2011-05-29 21:41:40 +1000295The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000296.Qq .ssh/authorized_keys .ssh/authorized_keys2 .
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000297.It Cm AuthorizedPrincipalsCommand
298Specifies a program to be used to generate the list of allowed
299certificate principals as per
300.Cm AuthorizedPrincipalsFile .
301The program must be owned by root, not writable by group or others and
302specified by an absolute path.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000303Arguments to
304.Cm AuthorizedPrincipalsCommand
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000305accept the tokens described in the
306.Sx TOKENS
307section.
308If no arguments are specified then the username of the target user is used.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000309.Pp
310The program should produce on standard output zero or
311more lines of
312.Cm AuthorizedPrincipalsFile
313output.
314If either
315.Cm AuthorizedPrincipalsCommand
316or
317.Cm AuthorizedPrincipalsFile
318is specified, then certificates offered by the client for authentication
319must contain a principal that is listed.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000320By default, no
321.Cm AuthorizedPrincipalsCommand
322is run.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000323.It Cm AuthorizedPrincipalsCommandUser
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000324Specifies the user under whose account the
325.Cm AuthorizedPrincipalsCommand
326is run.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000327It is recommended to use a dedicated user that has no other role on the host
328than running authorized principals commands.
329If
330.Cm AuthorizedPrincipalsCommand
331is specified but
332.Cm AuthorizedPrincipalsCommandUser
333is not, then
334.Xr sshd 8
335will refuse to start.
Damien Miller30da3442010-05-10 11:58:03 +1000336.It Cm AuthorizedPrincipalsFile
337Specifies a file that lists principal names that are accepted for
338certificate authentication.
339When using certificates signed by a key listed in
340.Cm TrustedUserCAKeys ,
341this file lists names, one of which must appear in the certificate for it
342to be accepted for authentication.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000343Names are listed one per line preceded by key options (as described in
344.Sx AUTHORIZED_KEYS FILE FORMAT
345in
Damien Millerd59dab82010-07-02 13:37:17 +1000346.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000347Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000348.Ql #
349are ignored.
350.Pp
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000351Arguments to
Damien Miller30da3442010-05-10 11:58:03 +1000352.Cm AuthorizedPrincipalsFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000353accept the tokens described in the
354.Sx TOKENS
355section.
Damien Miller30da3442010-05-10 11:58:03 +1000356After expansion,
357.Cm AuthorizedPrincipalsFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000358is taken to be an absolute path or one relative to the user's home directory.
Damien Miller8fef9eb2012-04-22 11:25:10 +1000359The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000360.Cm none ,
Damien Miller8fef9eb2012-04-22 11:25:10 +1000361i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000362of the user must appear in a certificate's principals list for it to be
363accepted.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000364.Pp
Damien Miller30da3442010-05-10 11:58:03 +1000365Note that
366.Cm AuthorizedPrincipalsFile
367is only used when authentication proceeds using a CA listed in
368.Cm TrustedUserCAKeys
369and is not consulted for certification authorities trusted via
370.Pa ~/.ssh/authorized_keys ,
371though the
372.Cm principals=
373key option offers a similar facility (see
374.Xr sshd 8
375for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000376.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000377The contents of the specified file are sent to the remote user before
378authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000379If the argument is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000380.Cm none
Damien Miller4890e532007-09-17 11:57:38 +1000381then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000382By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000383.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000384Specifies whether challenge-response authentication is allowed (e.g. via
Damien Millere8c9f262014-10-03 09:24:56 +1000385PAM or through authentication styles supported in
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000386.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000387The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000388.Cm yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100389.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100390Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100391.Xr chroot 2
392to after authentication.
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000393At session startup
394.Xr sshd 8
395checks that all components of the pathname are root-owned directories
396which are not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000397After the chroot,
398.Xr sshd 8
399changes the working directory to the user's home directory.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000400Arguments to
401.Cm ChrootDirectory
402accept the tokens described in the
403.Sx TOKENS
404section.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100405.Pp
406The
407.Cm ChrootDirectory
408must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000409user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100410For an interactive session this requires at least a shell, typically
411.Xr sh 1 ,
412and basic
413.Pa /dev
414nodes such as
415.Xr null 4 ,
416.Xr zero 4 ,
417.Xr stdin 4 ,
418.Xr stdout 4 ,
419.Xr stderr 4 ,
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000420and
Damien Millerd8cb1f12008-02-10 22:40:12 +1100421.Xr tty 4
422devices.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000423For file transfer sessions using SFTP
424no additional configuration of the environment is necessary if the in-process
425sftp-server is used,
Damien Miller426117b2014-07-30 12:33:20 +1000426though sessions which use logging may require
Darren Tucker00fcd712009-06-21 17:56:00 +1000427.Pa /dev/log
Damien Miller426117b2014-07-30 12:33:20 +1000428inside the chroot directory on some operating systems (see
Darren Tucker00fcd712009-06-21 17:56:00 +1000429.Xr sftp-server 8
430for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100431.Pp
jmc@openbsd.orga5a3e332015-01-22 21:00:42 +0000432For safety, it is very important that the directory hierarchy be
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000433prevented from modification by other processes on the system (especially
434those outside the jail).
435Misconfiguration can lead to unsafe environments which
436.Xr sshd 8
437cannot detect.
438.Pp
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000439The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000440.Cm none ,
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000441indicating not to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100442.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000443.It Cm Ciphers
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000444Specifies the ciphers allowed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000445Multiple ciphers must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000446If the specified value begins with a
447.Sq +
448character, then the specified ciphers will be appended to the default set
449instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000450If the specified value begins with a
451.Sq -
452character, then the specified ciphers (including wildcards) will be removed
453from the default set instead of replacing them.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000454.Pp
Damien Miller0fde8ac2013-11-21 14:12:23 +1100455The supported ciphers are:
456.Pp
Damien Millerc1621c82014-04-20 13:22:46 +1000457.Bl -item -compact -offset indent
458.It
4593des-cbc
460.It
461aes128-cbc
462.It
463aes192-cbc
464.It
465aes256-cbc
466.It
467aes128-ctr
468.It
469aes192-ctr
470.It
471aes256-ctr
472.It
473aes128-gcm@openssh.com
474.It
475aes256-gcm@openssh.com
476.It
Damien Millerc1621c82014-04-20 13:22:46 +1000477chacha20-poly1305@openssh.com
478.El
Damien Miller0fde8ac2013-11-21 14:12:23 +1100479.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100480The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000481.Bd -literal -offset indent
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000482chacha20-poly1305@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000483aes128-ctr,aes192-ctr,aes256-ctr,
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000484aes128-gcm@openssh.com,aes256-gcm@openssh.com
Ben Lindstrom9f049032002-06-21 00:59:05 +0000485.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100486.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000487The list of available ciphers may also be obtained using
488.Qq ssh -Q cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000489.It Cm ClientAliveCountMax
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000490Sets the number of client alive messages which may be sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100491.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000492receiving any messages back from the client.
493If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100494sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000495It is important to note that the use of client alive messages is very
496different from
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000497.Cm TCPKeepAlive .
Damien Millerfbf486b2003-05-23 18:44:23 +1000498The client alive messages are sent through the encrypted channel
499and therefore will not be spoofable.
500The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100501.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000502is spoofable.
503The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000504server depend on knowing when a connection has become inactive.
505.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000506The default value is 3.
507If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000508.Cm ClientAliveInterval
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000509is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000510.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100511is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000512will be disconnected after approximately 45 seconds.
Damien Miller1594ad52005-05-26 12:12:19 +1000513.It Cm ClientAliveInterval
514Sets a timeout interval in seconds after which if no data has been received
515from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100516.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000517will send a message through the encrypted
518channel to request a response from the client.
519The default
520is 0, indicating that these messages will not be sent to the client.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000521.It Cm Compression
djm@openbsd.org4577ade2016-09-28 20:32:42 +0000522Specifies whether compression is enabled after
Damien Miller9786e6e2005-07-26 21:54:56 +1000523the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000524The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000525.Cm yes ,
526.Cm delayed
djm@openbsd.org4577ade2016-09-28 20:32:42 +0000527(a legacy synonym for
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000528.Cm yes )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000529or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000530.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000531The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000532.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000533.It Cm DenyGroups
534This keyword can be followed by a list of group name patterns, separated
535by spaces.
536Login is disallowed for users whose primary group or supplementary
537group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000538Only group names are valid; a numerical group ID is not recognized.
539By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100540The allow/deny directives are processed in the following order:
541.Cm DenyUsers ,
542.Cm AllowUsers ,
543.Cm DenyGroups ,
544and finally
545.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100546.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000547See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100548.Xr ssh_config 5
549for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000550.It Cm DenyUsers
551This keyword can be followed by a list of user name patterns, separated
552by spaces.
553Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000554Only user names are valid; a numerical user ID is not recognized.
555By default, login is allowed for all users.
556If the pattern takes the form USER@HOST then USER and HOST
557are separately checked, restricting logins to particular
558users from particular hosts.
jmc@openbsd.orgee1e0a12016-04-27 13:53:48 +0000559HOST criteria may additionally contain addresses to match in CIDR
560address/masklen format.
Damien Millerac73e512006-03-15 11:58:49 +1100561The allow/deny directives are processed in the following order:
562.Cm DenyUsers ,
563.Cm AllowUsers ,
564.Cm DenyGroups ,
565and finally
566.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100567.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000568See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100569.Xr ssh_config 5
570for more information on patterns.
djm@openbsd.org7844f352016-11-30 03:00:05 +0000571.It Cm DisableForwarding
572Disables all forwarding features, including X11,
573.Xr ssh-agent 1 ,
574TCP and StreamLocal.
575This option overrides all other forwarding-related options and may
576simplify restricted configurations.
djm@openbsd.org8f574952017-06-24 06:34:38 +0000577.It Cm ExposeAuthInfo
578Enables writing a file containing a list of authentication methods and
579public credentials (e.g. keys) used to authenticate the user.
jmc@openbsd.org40962192017-06-24 06:57:04 +0000580The location of the file is exposed to the user session through the
djm@openbsd.orgf17ee612017-06-24 07:08:57 +0000581.Ev SSH_USER_AUTH
jmc@openbsd.org40962192017-06-24 06:57:04 +0000582environment variable.
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000583.It Cm FingerprintHash
584Specifies the hash algorithm used when logging key fingerprints.
585Valid options are:
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000586.Cm md5
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000587and
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000588.Cm sha256 .
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000589The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000590.Cm sha256 .
Damien Millere2754432006-07-24 14:06:47 +1000591.It Cm ForceCommand
592Forces the execution of the command specified by
593.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100594ignoring any command supplied by the client and
595.Pa ~/.ssh/rc
596if present.
Damien Millere2754432006-07-24 14:06:47 +1000597The command is invoked by using the user's login shell with the -c option.
598This applies to shell, command, or subsystem execution.
599It is most useful inside a
600.Cm Match
601block.
602The command originally supplied by the client is available in the
603.Ev SSH_ORIGINAL_COMMAND
604environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100605Specifying a command of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000606.Cm internal-sftp
607will force the use of an in-process SFTP server that requires no support
Damien Millercdb6e652008-02-10 22:47:24 +1100608files when used with
609.Cm ChrootDirectory .
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000610The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000611.Cm none .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000612.It Cm GatewayPorts
613Specifies whether remote hosts are allowed to connect to ports
614forwarded for the client.
615By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100616.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000617binds remote port forwardings to the loopback address.
618This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000619.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100620can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100621should allow remote port forwardings to bind to non-loopback addresses, thus
622allowing other hosts to connect.
623The argument may be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000624.Cm no
Damien Millerf91ee4c2005-03-01 21:24:33 +1100625to force remote port forwardings to be available to the local host only,
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000626.Cm yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100627to force remote port forwardings to bind to the wildcard address, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000628.Cm clientspecified
Damien Millerf91ee4c2005-03-01 21:24:33 +1100629to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000630The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000631.Cm no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000632.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000633Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100634The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000635.Cm no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000636.It Cm GSSAPICleanupCredentials
637Specifies whether to automatically destroy the user's credentials cache
638on logout.
639The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000640.Cm yes .
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000641.It Cm GSSAPIStrictAcceptorCheck
642Determines whether to be strict about the identity of the GSSAPI acceptor
643a client authenticates against.
644If set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000645.Cm yes
646then the client must authenticate against the host
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000647service on the current hostname.
648If set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000649.Cm no
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000650then the client may authenticate against any service key stored in the
651machine's default store.
652This facility is provided to assist with operation on multi homed machines.
653The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000654.Cm yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000655.It Cm HostbasedAcceptedKeyTypes
656Specifies the key types that will be accepted for hostbased authentication
657as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000658Alternately if the specified value begins with a
659.Sq +
660character, then the specified key types will be appended to the default set
661instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000662If the specified value begins with a
663.Sq -
664character, then the specified key types (including wildcards) will be removed
665from the default set instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000666The default for this option is:
667.Bd -literal -offset 3n
668ecdsa-sha2-nistp256-cert-v01@openssh.com,
669ecdsa-sha2-nistp384-cert-v01@openssh.com,
670ecdsa-sha2-nistp521-cert-v01@openssh.com,
671ssh-ed25519-cert-v01@openssh.com,
672ssh-rsa-cert-v01@openssh.com,
673ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +0000674ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000675.Ed
676.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000677The list of available key types may also be obtained using
678.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000679.It Cm HostbasedAuthentication
680Specifies whether rhosts or /etc/hosts.equiv authentication together
681with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100682(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000683The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000684.Cm no .
Damien Millerb594f382006-08-30 11:06:34 +1000685.It Cm HostbasedUsesNameFromPacketOnly
686Specifies whether or not the server will attempt to perform a reverse
687name lookup when matching the name in the
688.Pa ~/.shosts ,
689.Pa ~/.rhosts ,
690and
691.Pa /etc/hosts.equiv
692files during
693.Cm HostbasedAuthentication .
694A setting of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000695.Cm yes
Damien Millerb594f382006-08-30 11:06:34 +1000696means that
697.Xr sshd 8
698uses the name supplied by the client rather than
699attempting to resolve the name from the TCP connection itself.
700The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000701.Cm no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100702.It Cm HostCertificate
703Specifies a file containing a public host certificate.
704The certificate's public key must match a private host key already specified
705by
706.Cm HostKey .
707The default behaviour of
708.Xr sshd 8
709is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000710.It Cm HostKey
711Specifies a file containing a private host key
712used by SSH.
naddy@openbsd.orgffe65492016-08-15 12:32:04 +0000713The defaults are
Damien Millereb8b60e2010-08-31 22:41:14 +1000714.Pa /etc/ssh/ssh_host_dsa_key ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100715.Pa /etc/ssh/ssh_host_ecdsa_key ,
716.Pa /etc/ssh/ssh_host_ed25519_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000717and
naddy@openbsd.orgffe65492016-08-15 12:32:04 +0000718.Pa /etc/ssh/ssh_host_rsa_key .
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000719.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000720Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100721.Xr sshd 8
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000722will refuse to use a file if it is group/world-accessible
723and that the
724.Cm HostKeyAlgorithms
725option restricts which of the keys are actually used by
726.Xr sshd 8 .
727.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000728It is possible to have multiple host key files.
Damien Miller85b45e02013-07-20 13:21:52 +1000729It is also possible to specify public host key files instead.
730In this case operations on the private key will be delegated
731to an
732.Xr ssh-agent 1 .
733.It Cm HostKeyAgent
734Identifies the UNIX-domain socket used to communicate
735with an agent that has access to the private host keys.
markus@openbsd.org1a75d142016-05-04 14:29:58 +0000736If the string
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000737.Qq SSH_AUTH_SOCK
Damien Miller85b45e02013-07-20 13:21:52 +1000738is specified, the location of the socket will be read from the
739.Ev SSH_AUTH_SOCK
740environment variable.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000741.It Cm HostKeyAlgorithms
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000742Specifies the host key algorithms
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000743that the server offers.
744The default for this option is:
745.Bd -literal -offset 3n
746ecdsa-sha2-nistp256-cert-v01@openssh.com,
747ecdsa-sha2-nistp384-cert-v01@openssh.com,
748ecdsa-sha2-nistp521-cert-v01@openssh.com,
749ssh-ed25519-cert-v01@openssh.com,
750ssh-rsa-cert-v01@openssh.com,
751ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +0000752ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000753.Ed
754.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000755The list of available key types may also be obtained using
756.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000757.It Cm IgnoreRhosts
758Specifies that
759.Pa .rhosts
760and
761.Pa .shosts
762files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000763.Cm HostbasedAuthentication .
764.Pp
765.Pa /etc/hosts.equiv
766and
767.Pa /etc/shosts.equiv
768are still used.
769The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000770.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000771.It Cm IgnoreUserKnownHosts
772Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100773.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000774should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000775.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000776during
Ben Lindstrom9f049032002-06-21 00:59:05 +0000777.Cm HostbasedAuthentication .
778The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000779.Cm no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100780.It Cm IPQoS
781Specifies the IPv4 type-of-service or DSCP class for the connection.
782Accepted values are
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000783.Cm af11 ,
784.Cm af12 ,
785.Cm af13 ,
786.Cm af21 ,
787.Cm af22 ,
788.Cm af23 ,
789.Cm af31 ,
790.Cm af32 ,
791.Cm af33 ,
792.Cm af41 ,
793.Cm af42 ,
794.Cm af43 ,
795.Cm cs0 ,
796.Cm cs1 ,
797.Cm cs2 ,
798.Cm cs3 ,
799.Cm cs4 ,
800.Cm cs5 ,
801.Cm cs6 ,
802.Cm cs7 ,
803.Cm ef ,
804.Cm lowdelay ,
805.Cm throughput ,
806.Cm reliability ,
djm@openbsd.org51676ec2017-07-23 23:37:02 +0000807a numeric value, or
808.Cm none
809to use the operating system default.
Damien Miller928362d2010-12-26 14:26:45 +1100810This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100811If one argument is specified, it is used as the packet class unconditionally.
812If two values are specified, the first is automatically selected for
813interactive sessions and the second for non-interactive sessions.
814The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000815.Cm lowdelay
Damien Miller0dac6fb2010-11-20 15:19:38 +1100816for interactive sessions and
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000817.Cm throughput
Damien Miller0dac6fb2010-11-20 15:19:38 +1100818for non-interactive sessions.
Damien Millere1e480a2014-02-04 11:13:17 +1100819.It Cm KbdInteractiveAuthentication
820Specifies whether to allow keyboard-interactive authentication.
821The argument to this keyword must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000822.Cm yes
Damien Millere1e480a2014-02-04 11:13:17 +1100823or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000824.Cm no .
Damien Millere1e480a2014-02-04 11:13:17 +1100825The default is to use whatever value
826.Cm ChallengeResponseAuthentication
827is set to
828(by default
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000829.Cm yes ) .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000830.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000831Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000832.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000833will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000834To use this option, the server needs a
835Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100836The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000837.Cm no .
Damien Miller8448e662004-03-08 23:13:15 +1100838.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000839If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100840an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100841The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000842.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000843.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100844If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000845the password will be validated via any additional local mechanism
846such as
847.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100848The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000849.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000850.It Cm KerberosTicketCleanup
851Specifies whether to automatically destroy the user's ticket cache
852file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100853The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000854.Cm yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000855.It Cm KexAlgorithms
856Specifies the available KEX (Key Exchange) algorithms.
857Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000858Alternately if the specified value begins with a
859.Sq +
860character, then the specified methods will be appended to the default set
861instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000862If the specified value begins with a
863.Sq -
864character, then the specified methods (including wildcards) will be removed
865from the default set instead of replacing them.
Damien Millerc1621c82014-04-20 13:22:46 +1000866The supported algorithms are:
867.Pp
868.Bl -item -compact -offset indent
869.It
djm@openbsd.org16277fc2016-09-22 17:55:13 +0000870curve25519-sha256
871.It
Damien Millerc1621c82014-04-20 13:22:46 +1000872curve25519-sha256@libssh.org
873.It
874diffie-hellman-group1-sha1
875.It
876diffie-hellman-group14-sha1
877.It
878diffie-hellman-group-exchange-sha1
879.It
880diffie-hellman-group-exchange-sha256
881.It
882ecdh-sha2-nistp256
883.It
884ecdh-sha2-nistp384
885.It
886ecdh-sha2-nistp521
887.El
888.Pp
889The default is:
Damien Miller6575c3a2013-12-18 17:47:02 +1100890.Bd -literal -offset indent
djm@openbsd.org16277fc2016-09-22 17:55:13 +0000891curve25519-sha256,curve25519-sha256@libssh.org,
Damien Miller6575c3a2013-12-18 17:47:02 +1100892ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
893diffie-hellman-group-exchange-sha256,
Damien Millerc1621c82014-04-20 13:22:46 +1000894diffie-hellman-group14-sha1
Damien Miller6575c3a2013-12-18 17:47:02 +1100895.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000896.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000897The list of available key exchange algorithms may also be obtained using
898.Qq ssh -Q kex .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000899.It Cm ListenAddress
900Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100901.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000902should listen on.
903The following forms may be used:
904.Pp
905.Bl -item -offset indent -compact
906.It
907.Cm ListenAddress
908.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000909.Ar host | Ar IPv4_addr | Ar IPv6_addr
Ben Lindstrom9f049032002-06-21 00:59:05 +0000910.Sm on
911.It
912.Cm ListenAddress
913.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000914.Ar host | Ar IPv4_addr : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000915.Sm on
916.It
917.Cm ListenAddress
918.Sm off
919.Oo
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000920.Ar host | Ar IPv6_addr Oc : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000921.Sm on
922.El
923.Pp
924If
925.Ar port
926is not specified,
dtucker@openbsd.org531a57a2015-04-29 03:48:56 +0000927sshd will listen on the address and all
Ben Lindstrom9f049032002-06-21 00:59:05 +0000928.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000929options specified.
930The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000931Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000932.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000933options are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000934.It Cm LoginGraceTime
935The server disconnects after this time if the user has not
936successfully logged in.
937If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000938The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000939.It Cm LogLevel
940Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100941.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000942The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100943QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000944The default is INFO.
945DEBUG and DEBUG1 are equivalent.
946DEBUG2 and DEBUG3 each specify higher levels of debugging output.
947Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000948.It Cm MACs
949Specifies the available MAC (message authentication code) algorithms.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000950The MAC algorithm is used for data integrity protection.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000951Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000952If the specified value begins with a
953.Sq +
954character, then the specified algorithms will be appended to the default set
955instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +0000956If the specified value begins with a
957.Sq -
958character, then the specified algorithms (including wildcards) will be removed
959from the default set instead of replacing them.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000960.Pp
Damien Milleraf43a7a2012-12-12 10:46:31 +1100961The algorithms that contain
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +0000962.Qq -etm
Damien Milleraf43a7a2012-12-12 10:46:31 +1100963calculate the MAC after encryption (encrypt-then-mac).
964These are considered safer and their use recommended.
Damien Millerc1621c82014-04-20 13:22:46 +1000965The supported MACs are:
966.Pp
967.Bl -item -compact -offset indent
968.It
969hmac-md5
970.It
971hmac-md5-96
972.It
Damien Millerc1621c82014-04-20 13:22:46 +1000973hmac-sha1
974.It
975hmac-sha1-96
976.It
977hmac-sha2-256
978.It
979hmac-sha2-512
980.It
981umac-64@openssh.com
982.It
983umac-128@openssh.com
984.It
985hmac-md5-etm@openssh.com
986.It
987hmac-md5-96-etm@openssh.com
988.It
Damien Millerc1621c82014-04-20 13:22:46 +1000989hmac-sha1-etm@openssh.com
990.It
991hmac-sha1-96-etm@openssh.com
992.It
993hmac-sha2-256-etm@openssh.com
994.It
995hmac-sha2-512-etm@openssh.com
996.It
997umac-64-etm@openssh.com
998.It
999umac-128-etm@openssh.com
1000.El
1001.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +11001002The default is:
Damien Miller22b7b492007-06-11 14:07:12 +10001003.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +11001004umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1005hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001006hmac-sha1-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +10001007umac-64@openssh.com,umac-128@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001008hmac-sha2-256,hmac-sha2-512,hmac-sha1
Damien Miller22b7b492007-06-11 14:07:12 +10001009.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001010.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001011The list of available MAC algorithms may also be obtained using
1012.Qq ssh -Q mac .
Darren Tucker45150472006-07-12 22:34:17 +10001013.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +10001014Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +10001015If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +10001016.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001017line are satisfied, the keywords on the following lines override those
1018set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +10001019.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001020line or the end of the file.
Damien Millerfc5d6752014-02-28 10:01:28 +11001021If a keyword appears in multiple
1022.Cm Match
sobrado@openbsd.org180bcb42014-08-30 16:32:25 +00001023blocks that are satisfied, only the first instance of the keyword is
Damien Millerfc5d6752014-02-28 10:01:28 +11001024applied.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001025.Pp
Damien Millerd04f3572006-07-24 13:46:50 +10001026The arguments to
Darren Tucker45150472006-07-12 22:34:17 +10001027.Cm Match
Damien Millercf31f382013-10-24 21:02:56 +11001028are one or more criteria-pattern pairs or the single token
1029.Cm All
1030which matches all criteria.
Darren Tucker45150472006-07-12 22:34:17 +10001031The available criteria are
1032.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +10001033.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +10001034.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +10001035.Cm LocalAddress ,
1036.Cm LocalPort ,
Darren Tucker45150472006-07-12 22:34:17 +10001037and
1038.Cm Address .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001039The match patterns may consist of single entries or comma-separated
1040lists and may use the wildcard and negation operators described in the
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001041.Sx PATTERNS
1042section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +10001043.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001044.Pp
1045The patterns in an
1046.Cm Address
1047criteria may additionally contain addresses to match in CIDR
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001048address/masklen format,
1049such as 192.0.2.0/24 or 2001:db8::/32.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001050Note that the mask length provided must be consistent with the address -
1051it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +10001052or one with bits set in this host portion of the address.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001053For example, 192.0.2.0/33 and 192.0.2.0/8, respectively.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001054.Pp
Darren Tucker45150472006-07-12 22:34:17 +10001055Only a subset of keywords may be used on the lines following a
1056.Cm Match
1057keyword.
1058Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +10001059.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +11001060.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +10001061.Cm AllowGroups ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001062.Cm AllowStreamLocalForwarding ,
Damien Miller9b439df2006-07-24 14:04:00 +10001063.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +10001064.Cm AllowUsers ,
Damien Millera6e3f012012-11-04 23:21:40 +11001065.Cm AuthenticationMethods ,
Damien Miller09d3e122012-10-31 08:58:58 +11001066.Cm AuthorizedKeysCommand ,
1067.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +11001068.Cm AuthorizedKeysFile ,
djm@openbsd.orgb6b91082015-11-13 02:57:46 +00001069.Cm AuthorizedPrincipalsCommand ,
1070.Cm AuthorizedPrincipalsCommandUser ,
Damien Millerab6de352010-06-26 09:38:45 +10001071.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +11001072.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +10001073.Cm ChrootDirectory ,
markus@openbsd.orgf0ddede2016-11-23 23:14:15 +00001074.Cm ClientAliveCountMax ,
1075.Cm ClientAliveInterval ,
Damien Millerc24da772012-06-20 21:53:58 +10001076.Cm DenyGroups ,
1077.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +10001078.Cm ForceCommand ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001079.Cm GatewayPorts ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +00001080.Cm GSSAPIAuthentication ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001081.Cm HostbasedAcceptedKeyTypes ,
Damien Miller25434de2008-05-19 14:29:08 +10001082.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +10001083.Cm HostbasedUsesNameFromPacketOnly ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001084.Cm IPQoS ,
Darren Tucker1d75f222007-03-01 21:31:28 +11001085.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +11001086.Cm KerberosAuthentication ,
djm@openbsd.org54cd41a2017-05-17 01:24:17 +00001087.Cm LogLevel ,
Damien Miller307c1d12008-06-16 07:56:20 +10001088.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +10001089.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +11001090.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +11001091.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +10001092.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +11001093.Cm PermitRootLogin ,
Damien Miller5ff30c62013-10-30 22:21:50 +11001094.Cm PermitTTY ,
Damien Millerab6de352010-06-26 09:38:45 +10001095.Cm PermitTunnel ,
Damien Miller72e6b5c2014-07-04 09:00:04 +10001096.Cm PermitUserRC ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001097.Cm PubkeyAcceptedKeyTypes ,
Darren Tucker1477ea12009-10-07 08:36:05 +11001098.Cm PubkeyAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001099.Cm RekeyLimit ,
1100.Cm RevokedKeys ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001101.Cm StreamLocalBindMask ,
1102.Cm StreamLocalBindUnlink ,
1103.Cm TrustedUserCAKeys ,
Damien Millerd1de9952006-07-24 14:05:48 +10001104.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +11001105.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +10001106and
Damien Miller0296ae82009-02-23 11:00:24 +11001107.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +10001108.It Cm MaxAuthTries
1109Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +10001110connection.
1111Once the number of failures reaches half this value,
1112additional failures are logged.
1113The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +10001114.It Cm MaxSessions
djm@openbsd.orgcac3b662016-02-05 02:37:56 +00001115Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1116sessions permitted per network connection.
1117Multiple sessions may be established by clients that support connection
1118multiplexing.
1119Setting
1120.Cm MaxSessions
1121to 1 will effectively disable session multiplexing, whereas setting it to 0
1122will prevent all shell, login and subsystem sessions while still permitting
1123forwarding.
Damien Miller7207f642008-05-19 15:34:50 +10001124The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001125.It Cm MaxStartups
1126Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001127SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001128Additional connections will be dropped until authentication succeeds or the
1129.Cm LoginGraceTime
1130expires for a connection.
Damien Miller1f583df2013-02-12 11:02:08 +11001131The default is 10:30:100.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001132.Pp
1133Alternatively, random early drop can be enabled by specifying
1134the three colon separated values
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001135start:rate:full (e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +11001136.Xr sshd 8
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001137will refuse connection attempts with a probability of rate/100 (30%)
1138if there are currently start (10) unauthenticated connections.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001139The probability increases linearly and all connection attempts
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001140are refused if the number of unauthenticated connections reaches full (60).
Ben Lindstrom9f049032002-06-21 00:59:05 +00001141.It Cm PasswordAuthentication
1142Specifies whether password authentication is allowed.
1143The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001144.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001145.It Cm PermitEmptyPasswords
1146When password authentication is allowed, it specifies whether the
1147server allows login to accounts with empty password strings.
1148The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001149.Cm no .
Damien Miller9b439df2006-07-24 14:04:00 +10001150.It Cm PermitOpen
1151Specifies the destinations to which TCP port forwarding is permitted.
1152The forwarding specification must be one of the following forms:
1153.Pp
1154.Bl -item -offset indent -compact
1155.It
1156.Cm PermitOpen
1157.Sm off
1158.Ar host : port
1159.Sm on
1160.It
1161.Cm PermitOpen
1162.Sm off
1163.Ar IPv4_addr : port
1164.Sm on
1165.It
1166.Cm PermitOpen
1167.Sm off
1168.Ar \&[ IPv6_addr \&] : port
1169.Sm on
1170.El
1171.Pp
Damien Millera765cf42006-07-24 14:08:13 +10001172Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +10001173An argument of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001174.Cm any
Damien Miller9b439df2006-07-24 14:04:00 +10001175can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +10001176An argument of
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001177.Cm none
Darren Tuckerba9ea322012-05-19 19:37:33 +10001178can be used to prohibit all forwarding requests.
jmc@openbsd.org32d921c2016-07-19 12:59:16 +00001179The wildcard
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001180.Sq *
jmc@openbsd.org32d921c2016-07-19 12:59:16 +00001181can be used for host or port to allow all hosts or ports, respectively.
Damien Miller65bc2c42006-07-24 14:04:16 +10001182By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001183.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +11001184Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +00001185.Xr ssh 1 .
1186The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001187.Cm yes ,
1188.Cm prohibit-password ,
1189.Cm without-password ,
1190.Cm forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001191or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001192.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001193The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001194.Cm prohibit-password .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001195.Pp
1196If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001197.Cm prohibit-password
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001198or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001199.Cm without-password ,
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001200password and keyboard-interactive authentication are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001201.Pp
1202If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001203.Cm forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001204root login with public key authentication will be allowed,
1205but only if the
1206.Ar command
1207option has been specified
1208(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +10001209normally not allowed).
1210All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001211.Pp
1212If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001213.Cm no ,
Darren Tuckerb3509012005-01-20 11:01:46 +11001214root is not allowed to log in.
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +00001215.It Cm PermitTTY
1216Specifies whether
1217.Xr pty 4
1218allocation is permitted.
1219The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001220.Cm yes .
Damien Millerd27b9472005-12-13 19:29:02 +11001221.It Cm PermitTunnel
1222Specifies whether
1223.Xr tun 4
1224device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +11001225The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001226.Cm yes ,
1227.Cm point-to-point
Damien Miller991dba42006-07-10 20:16:27 +10001228(layer 3),
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001229.Cm ethernet
Damien Miller991dba42006-07-10 20:16:27 +10001230(layer 2), or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001231.Cm no .
Damien Miller991dba42006-07-10 20:16:27 +10001232Specifying
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001233.Cm yes
Damien Miller991dba42006-07-10 20:16:27 +10001234permits both
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001235.Cm point-to-point
Damien Miller991dba42006-07-10 20:16:27 +10001236and
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001237.Cm ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +11001238The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001239.Cm no .
djm@openbsd.org48dffd52014-09-09 09:45:36 +00001240.Pp
1241Independent of this setting, the permissions of the selected
1242.Xr tun 4
1243device must allow access to the user.
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001244.It Cm PermitUserEnvironment
1245Specifies whether
1246.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001247and
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001248.Cm environment=
1249options in
1250.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001251are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +11001252.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001253The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001254.Cm no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001255Enabling environment processing may enable users to bypass access
1256restrictions in some configurations using mechanisms such as
1257.Ev LD_PRELOAD .
Damien Miller72e6b5c2014-07-04 09:00:04 +10001258.It Cm PermitUserRC
1259Specifies whether any
1260.Pa ~/.ssh/rc
1261file is executed.
1262The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001263.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001264.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +00001265Specifies the file that contains the process ID of the
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001266SSH daemon, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001267.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001268to not write one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001269The default is
1270.Pa /var/run/sshd.pid .
1271.It Cm Port
1272Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +11001273.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001274listens on.
1275The default is 22.
1276Multiple options of this type are permitted.
1277See also
1278.Cm ListenAddress .
1279.It Cm PrintLastLog
1280Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001281.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +11001282should print the date and time of the last user login when a user logs
1283in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001284The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001285.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001286.It Cm PrintMotd
1287Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001288.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001289should print
1290.Pa /etc/motd
1291when a user logs in interactively.
1292(On some systems it is also printed by the shell,
1293.Pa /etc/profile ,
1294or equivalent.)
1295The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001296.Cm yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001297.It Cm PubkeyAcceptedKeyTypes
1298Specifies the key types that will be accepted for public key authentication
1299as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001300Alternately if the specified value begins with a
1301.Sq +
1302character, then the specified key types will be appended to the default set
1303instead of replacing them.
djm@openbsd.org68bc8cf2017-02-03 23:01:19 +00001304If the specified value begins with a
1305.Sq -
1306character, then the specified key types (including wildcards) will be removed
1307from the default set instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001308The default for this option is:
1309.Bd -literal -offset 3n
1310ecdsa-sha2-nistp256-cert-v01@openssh.com,
1311ecdsa-sha2-nistp384-cert-v01@openssh.com,
1312ecdsa-sha2-nistp521-cert-v01@openssh.com,
1313ssh-ed25519-cert-v01@openssh.com,
1314ssh-rsa-cert-v01@openssh.com,
1315ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +00001316ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001317.Ed
1318.Pp
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001319The list of available key types may also be obtained using
1320.Qq ssh -Q key .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001321.It Cm PubkeyAuthentication
1322Specifies whether public key authentication is allowed.
1323The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001324.Cm yes .
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001325.It Cm RekeyLimit
1326Specifies the maximum amount of data that may be transmitted before the
1327session key is renegotiated, optionally followed a maximum amount of
1328time that may pass before the session key is renegotiated.
1329The first argument is specified in bytes and may have a suffix of
1330.Sq K ,
1331.Sq M ,
1332or
1333.Sq G
1334to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1335The default is between
1336.Sq 1G
1337and
1338.Sq 4G ,
1339depending on the cipher.
1340The optional second value is specified in seconds and may use any of the
1341units documented in the
1342.Sx TIME FORMATS
Darren Tucker64d22942013-05-16 20:31:29 +10001343section.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001344The default value for
1345.Cm RekeyLimit
1346is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001347.Cm default none ,
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001348which means that rekeying is performed after the cipher's default amount
1349of data has been sent or received and no time based rekeying is done.
Damien Miller1aed65e2010-03-04 21:53:35 +11001350.It Cm RevokedKeys
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001351Specifies revoked public keys file, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001352.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001353to not use one.
Damien Miller1aed65e2010-03-04 21:53:35 +11001354Keys listed in this file will be refused for public key authentication.
1355Note that if this file is not readable, then public key authentication will
1356be refused for all users.
Damien Millerf3747bf2013-01-18 11:44:04 +11001357Keys may be specified as a text file, listing one public key per line, or as
1358an OpenSSH Key Revocation List (KRL) as generated by
Damien Miller72abeb72013-01-20 22:33:44 +11001359.Xr ssh-keygen 1 .
Damien Millerfecfd112013-07-18 16:11:50 +10001360For more information on KRLs, see the KEY REVOCATION LISTS section in
Damien Millerf3747bf2013-01-18 11:44:04 +11001361.Xr ssh-keygen 1 .
Damien Miller7acefbb2014-07-18 14:11:24 +10001362.It Cm StreamLocalBindMask
1363Sets the octal file creation mode mask
1364.Pq umask
1365used when creating a Unix-domain socket file for local or remote
1366port forwarding.
1367This option is only used for port forwarding to a Unix-domain socket file.
1368.Pp
1369The default value is 0177, which creates a Unix-domain socket file that is
1370readable and writable only by the owner.
1371Note that not all operating systems honor the file mode on Unix-domain
1372socket files.
1373.It Cm StreamLocalBindUnlink
1374Specifies whether to remove an existing Unix-domain socket file for local
1375or remote port forwarding before creating a new one.
1376If the socket file already exists and
1377.Cm StreamLocalBindUnlink
1378is not enabled,
1379.Nm sshd
1380will be unable to forward the port to the Unix-domain socket file.
1381This option is only used for port forwarding to a Unix-domain socket file.
1382.Pp
1383The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001384.Cm yes
Damien Miller7acefbb2014-07-18 14:11:24 +10001385or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001386.Cm no .
Damien Miller7acefbb2014-07-18 14:11:24 +10001387The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001388.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001389.It Cm StrictModes
1390Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001391.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001392should check file modes and ownership of the
1393user's files and home directory before accepting login.
1394This is normally desirable because novices sometimes accidentally leave their
1395directory or files world-writable.
1396The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001397.Cm yes .
Darren Tuckerf788a912010-01-08 17:06:47 +11001398Note that this does not apply to
1399.Cm ChrootDirectory ,
1400whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001401.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +11001402Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +10001403Arguments should be a subsystem name and a command (with optional arguments)
1404to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001405.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001406The command
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001407.Cm sftp-server
1408implements the SFTP file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001409.Pp
1410Alternately the name
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001411.Cm internal-sftp
1412implements an in-process SFTP server.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001413This may simplify configurations using
1414.Cm ChrootDirectory
1415to force a different filesystem root on clients.
1416.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001417By default no subsystems are defined.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001418.It Cm SyslogFacility
1419Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001420.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001421The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1422LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1423The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001424.It Cm TCPKeepAlive
1425Specifies whether the system should send TCP keepalive messages to the
1426other side.
1427If they are sent, death of the connection or crash of one
1428of the machines will be properly noticed.
1429However, this means that
1430connections will die if the route is down temporarily, and some people
1431find it annoying.
1432On the other hand, if TCP keepalives are not sent,
1433sessions may hang indefinitely on the server, leaving
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001434.Qq ghost
Damien Miller12c150e2003-12-17 16:31:10 +11001435users and consuming server resources.
1436.Pp
1437The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001438.Cm yes
Damien Miller12c150e2003-12-17 16:31:10 +11001439(to send TCP keepalive messages), and the server will notice
1440if the network goes down or the client host crashes.
1441This avoids infinitely hanging sessions.
1442.Pp
1443To disable TCP keepalive messages, the value should be set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001444.Cm no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001445.It Cm TrustedUserCAKeys
1446Specifies a file containing public keys of certificate authorities that are
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001447trusted to sign user certificates for authentication, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001448.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001449to not use one.
Damien Miller72b33822010-03-05 07:39:01 +11001450Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001451.Ql #
1452are allowed.
1453If a certificate is presented for authentication and has its signing CA key
1454listed in this file, then it may be used for authentication for any user
1455listed in the certificate's principals list.
1456Note that certificates that lack a list of principals will not be permitted
1457for authentication using
1458.Cm TrustedUserCAKeys .
Damien Millerfecfd112013-07-18 16:11:50 +10001459For more details on certificates, see the CERTIFICATES section in
Damien Miller1aed65e2010-03-04 21:53:35 +11001460.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001461.It Cm UseDNS
1462Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001463.Xr sshd 8
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001464should look up the remote host name, and to check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001465the resolved host name for the remote IP address maps back to the
1466very same IP address.
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001467.Pp
1468If this option is set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001469.Cm no
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001470(the default) then only addresses and not host names may be used in
djm@openbsd.org0235a5f2016-03-17 17:19:43 +00001471.Pa ~/.ssh/authorized_keys
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001472.Cm from
1473and
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +00001474.Nm
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001475.Cm Match
1476.Cm Host
1477directives.
Damien Miller2e193e22003-05-14 15:13:03 +10001478.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001479Enables the Pluggable Authentication Module interface.
1480If set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001481.Cm yes
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001482this will enable PAM authentication using
1483.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001484and
1485.Cm PasswordAuthentication
1486in addition to PAM account and session module processing for all
1487authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001488.Pp
1489Because PAM challenge-response authentication usually serves an equivalent
1490role to password authentication, you should disable either
1491.Cm PasswordAuthentication
1492or
1493.Cm ChallengeResponseAuthentication.
1494.Pp
1495If
1496.Cm UsePAM
1497is enabled, you will not be able to run
1498.Xr sshd 8
1499as a non-root user.
1500The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001501.Cm no .
Damien Miller23528812012-04-22 11:24:43 +10001502.It Cm VersionAddendum
1503Optionally specifies additional text to append to the SSH protocol banner
1504sent by the server upon connection.
1505The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001506.Cm none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001507.It Cm X11DisplayOffset
1508Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001509.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001510X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001511This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001512The default is 10.
1513.It Cm X11Forwarding
1514Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001515The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001516.Cm yes
Damien Miller101c4a72002-09-19 11:51:21 +10001517or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001518.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001519The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001520.Cm no .
Damien Miller101c4a72002-09-19 11:51:21 +10001521.Pp
1522When X11 forwarding is enabled, there may be additional exposure to
1523the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001524.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001525proxy display is configured to listen on the wildcard address (see
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001526.Cm X11UseLocalhost ) ,
1527though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001528Additionally, the authentication spoofing and authentication data
1529verification and substitution occur on the client side.
1530The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001531display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001532forwarding (see the warnings for
1533.Cm ForwardX11
1534in
Damien Millerf1ce5052003-06-11 22:04:39 +10001535.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001536A system administrator may have a stance in which they want to
1537protect clients that may expose themselves to attack by unwittingly
1538requesting X11 forwarding, which can warrant a
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001539.Cm no
Damien Miller101c4a72002-09-19 11:51:21 +10001540setting.
1541.Pp
1542Note that disabling X11 forwarding does not prevent users from
1543forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001544.It Cm X11UseLocalhost
1545Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001546.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001547should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001548the wildcard address.
1549By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001550sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001551hostname part of the
1552.Ev DISPLAY
1553environment variable to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001554.Cm localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001555This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001556However, some older X11 clients may not function with this
1557configuration.
1558.Cm X11UseLocalhost
1559may be set to
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001560.Cm no
Ben Lindstrom9f049032002-06-21 00:59:05 +00001561to specify that the forwarding server should be bound to the wildcard
1562address.
1563The argument must be
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001564.Cm yes
Ben Lindstrom9f049032002-06-21 00:59:05 +00001565or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001566.Cm no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001567The default is
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001568.Cm yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001569.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001570Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001571.Xr xauth 1
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001572program, or
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001573.Cm none
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001574to not use one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001575The default is
1576.Pa /usr/X11R6/bin/xauth .
1577.El
Damien Millere3beba22006-03-15 11:59:25 +11001578.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001579.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001580command-line arguments and configuration file options that specify time
1581may be expressed using a sequence of the form:
1582.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001583.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001584.Sm on
1585where
1586.Ar time
1587is a positive integer value and
1588.Ar qualifier
1589is one of the following:
1590.Pp
1591.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001592.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001593seconds
1594.It Cm s | Cm S
1595seconds
1596.It Cm m | Cm M
1597minutes
1598.It Cm h | Cm H
1599hours
1600.It Cm d | Cm D
1601days
1602.It Cm w | Cm W
1603weeks
1604.El
1605.Pp
1606Each member of the sequence is added together to calculate
1607the total time value.
1608.Pp
1609Time format examples:
1610.Pp
1611.Bl -tag -width Ds -compact -offset indent
1612.It 600
1613600 seconds (10 minutes)
1614.It 10m
161510 minutes
1616.It 1h30m
16171 hour 30 minutes (90 minutes)
1618.El
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001619.Sh TOKENS
1620Arguments to some keywords can make use of tokens,
1621which are expanded at runtime:
1622.Pp
1623.Bl -tag -width XXXX -offset indent -compact
1624.It %%
1625A literal
1626.Sq % .
1627.It %F
1628The fingerprint of the CA key.
1629.It %f
1630The fingerprint of the key or certificate.
1631.It %h
1632The home directory of the user.
1633.It %i
1634The key ID in the certificate.
1635.It %K
1636The base64-encoded CA key.
1637.It %k
1638The base64-encoded key or certificate for authentication.
1639.It %s
1640The serial number of the certificate.
1641.It \&%T
1642The type of the CA key.
1643.It %t
1644The key or certificate type.
1645.It %u
1646The username.
1647.El
1648.Pp
1649.Cm AuthorizedKeysCommand
jmc@openbsd.orga1187bd2017-01-06 16:28:12 +00001650accepts the tokens %%, %f, %h, %k, %t, and %u.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001651.Pp
1652.Cm AuthorizedKeysFile
1653accepts the tokens %%, %h, and %u.
1654.Pp
1655.Cm AuthorizedPrincipalsCommand
jmc@openbsd.orga1187bd2017-01-06 16:28:12 +00001656accepts the tokens %%, %F, %f, %h, %i, %K, %k, %s, %T, %t, and %u.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001657.Pp
1658.Cm AuthorizedPrincipalsFile
1659accepts the tokens %%, %h, and %u.
1660.Pp
1661.Cm ChrootDirectory
1662accepts the tokens %%, %h, and %u.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001663.Sh FILES
1664.Bl -tag -width Ds
1665.It Pa /etc/ssh/sshd_config
1666Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001667.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001668This file should be writable by root only, but it is recommended
1669(though not necessary) that it be world-readable.
1670.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001671.Sh SEE ALSO
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001672.Xr sftp-server 8 ,
Damien Millerf1ce5052003-06-11 22:04:39 +10001673.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001674.Sh AUTHORS
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001675.An -nosplit
Ben Lindstrom9f049032002-06-21 00:59:05 +00001676OpenSSH is a derivative of the original and free
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001677ssh 1.2.12 release by
1678.An Tatu Ylonen .
1679.An Aaron Campbell , Bob Beck , Markus Friedl , Niels Provos ,
1680.An Theo de Raadt
1681and
1682.An Dug Song
Ben Lindstrom9f049032002-06-21 00:59:05 +00001683removed many bugs, re-added newer features and
1684created OpenSSH.
jmc@openbsd.orgaae4dbd2016-10-07 14:41:52 +00001685.An Markus Friedl
1686contributed the support for SSH protocol versions 1.5 and 2.0.
1687.An Niels Provos
1688and
1689.An Markus Friedl
1690contributed support for privilege separation.