blob: d1a5d1d33cb27a58fac92d49828358b1a16339a9 [file] [log] [blame]
Ben Lindstrom9f049032002-06-21 00:59:05 +00001.\"
2.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
3.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4.\" All rights reserved
5.\"
6.\" As far as I am concerned, the code I have written for this software
7.\" can be used freely for any purpose. Any derived versions of this
8.\" software must be clearly marked as such, and if the derived work is
9.\" incompatible with the protocol description in the RFC file, it must be
10.\" called by a name other than "ssh" or "Secure Shell".
11.\"
12.\" Copyright (c) 1999,2000 Markus Friedl. All rights reserved.
13.\" Copyright (c) 1999 Aaron Campbell. All rights reserved.
14.\" Copyright (c) 1999 Theo de Raadt. All rights reserved.
15.\"
16.\" Redistribution and use in source and binary forms, with or without
17.\" modification, are permitted provided that the following conditions
18.\" are met:
19.\" 1. Redistributions of source code must retain the above copyright
20.\" notice, this list of conditions and the following disclaimer.
21.\" 2. Redistributions in binary form must reproduce the above copyright
22.\" notice, this list of conditions and the following disclaimer in the
23.\" documentation and/or other materials provided with the distribution.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
26.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
29.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35.\"
naddy@openbsd.orgffe65492016-08-15 12:32:04 +000036.\" $OpenBSD: sshd_config.5,v 1.229 2016/08/15 12:32:04 naddy Exp $
37.Dd $Mdocdate: August 15 2016 $
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
43.Sh SYNOPSIS
Damien Millerd94fc722007-01-05 16:29:30 +110044.Nm /etc/ssh/sshd_config
Ben Lindstrom9f049032002-06-21 00:59:05 +000045.Sh DESCRIPTION
Damien Millerf4f22b52006-03-15 11:57:25 +110046.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +000047reads configuration data from
48.Pa /etc/ssh/sshd_config
49(or the file specified with
50.Fl f
51on the command line).
52The file contains keyword-argument pairs, one per line.
53Lines starting with
54.Ql #
55and empty lines are interpreted as comments.
Damien Miller306d1182006-03-15 12:05:59 +110056Arguments may optionally be enclosed in double quotes
57.Pq \&"
58in order to represent arguments containing spaces.
Ben Lindstrom9f049032002-06-21 00:59:05 +000059.Pp
60The possible
61keywords and their meanings are as follows (note that
62keywords are case-insensitive and arguments are case-sensitive):
63.Bl -tag -width Ds
Darren Tucker46bc0752004-05-02 22:11:30 +100064.It Cm AcceptEnv
65Specifies what environment variables sent by the client will be copied into
66the session's
67.Xr environ 7 .
68See
69.Cm SendEnv
70in
71.Xr ssh_config 5
72for how to configure the client.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +000073The
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +000074.Ev TERM
jmc@openbsd.orgc1d5bcf2015-04-28 13:47:38 +000075environment variable is always sent whenever the client
djm@openbsd.org732d61f2015-06-05 03:44:14 +000076requests a pseudo-terminal as it is required by the protocol.
Darren Tucker46bc0752004-05-02 22:11:30 +100077Variables are specified by name, which may contain the wildcard characters
Damien Miller208f1ed2006-03-15 11:56:03 +110078.Ql *
Darren Tucker46bc0752004-05-02 22:11:30 +100079and
80.Ql \&? .
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100081Multiple environment variables may be separated by whitespace or spread
Darren Tucker46bc0752004-05-02 22:11:30 +100082across multiple
83.Cm AcceptEnv
84directives.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100085Be warned that some environment variables could be used to bypass restricted
Darren Tucker46bc0752004-05-02 22:11:30 +100086user environments.
87For this reason, care should be taken in the use of this directive.
88The default is not to accept any environment variables.
Darren Tucker0f383232005-01-20 10:57:56 +110089.It Cm AddressFamily
90Specifies which address family should be used by
Damien Millerf4f22b52006-03-15 11:57:25 +110091.Xr sshd 8 .
Darren Tucker0f383232005-01-20 10:57:56 +110092Valid arguments are
93.Dq any ,
94.Dq inet
Damien Miller5b0d63f2006-03-15 11:56:56 +110095(use IPv4 only), or
Darren Tucker0f383232005-01-20 10:57:56 +110096.Dq inet6
97(use IPv6 only).
98The default is
99.Dq any .
Damien Millere9890192008-05-19 14:59:02 +1000100.It Cm AllowAgentForwarding
101Specifies whether
102.Xr ssh-agent 1
103forwarding is permitted.
104The default is
105.Dq yes .
106Note that disabling agent forwarding does not improve security
107unless users are also denied shell access, as they can always install
108their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000109.It Cm AllowGroups
110This keyword can be followed by a list of group name patterns, separated
111by spaces.
112If specified, login is allowed only for users whose primary
113group or supplementary group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000114Only group names are valid; a numerical group ID is not recognized.
115By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100116The allow/deny directives are processed in the following order:
117.Cm DenyUsers ,
118.Cm AllowUsers ,
119.Cm DenyGroups ,
120and finally
121.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100122.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000123See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100124.Xr ssh_config 5
125for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000126.It Cm AllowTcpForwarding
127Specifies whether TCP forwarding is permitted.
Damien Milleraa5b3f82012-12-03 09:50:54 +1100128The available options are
129.Dq yes
130or
131.Dq all
132to allow TCP forwarding,
133.Dq no
134to prevent all TCP forwarding,
135.Dq local
136to allow local (from the perspective of
Darren Tuckerf9333d52012-12-07 13:06:13 +1100137.Xr ssh 1 )
138forwarding only or
Damien Milleraa5b3f82012-12-03 09:50:54 +1100139.Dq remote
140to allow remote forwarding only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000141The default is
142.Dq yes .
143Note that disabling TCP forwarding does not improve security unless
144users are also denied shell access, as they can always install their
145own forwarders.
Damien Miller7acefbb2014-07-18 14:11:24 +1000146.It Cm AllowStreamLocalForwarding
147Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
148The available options are
149.Dq yes
150or
151.Dq all
152to allow StreamLocal forwarding,
153.Dq no
154to prevent all StreamLocal forwarding,
155.Dq local
156to allow local (from the perspective of
157.Xr ssh 1 )
158forwarding only or
159.Dq remote
160to allow remote forwarding only.
161The default is
162.Dq yes .
163Note that disabling StreamLocal forwarding does not improve security unless
164users are also denied shell access, as they can always install their
165own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000166.It Cm AllowUsers
167This keyword can be followed by a list of user name patterns, separated
168by spaces.
Damien Miller5a93add2003-01-24 11:34:52 +1100169If specified, login is allowed only for user names that
Ben Lindstrom9f049032002-06-21 00:59:05 +0000170match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000171Only user names are valid; a numerical user ID is not recognized.
172By default, login is allowed for all users.
173If the pattern takes the form USER@HOST then USER and HOST
174are separately checked, restricting logins to particular
175users from particular hosts.
jmc@openbsd.orgee1e0a12016-04-27 13:53:48 +0000176HOST criteria may additionally contain addresses to match in CIDR
177address/masklen format.
Damien Millerac73e512006-03-15 11:58:49 +1100178The allow/deny directives are processed in the following order:
179.Cm DenyUsers ,
180.Cm AllowUsers ,
181.Cm DenyGroups ,
182and finally
183.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100184.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000185See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100186.Xr ssh_config 5
187for more information on patterns.
Damien Millera6e3f012012-11-04 23:21:40 +1100188.It Cm AuthenticationMethods
189Specifies the authentication methods that must be successfully completed
190for a user to be granted access.
191This option must be followed by one or more comma-separated lists of
djm@openbsd.orgb64faeb2016-06-17 05:03:40 +0000192authentication method names, or by the single string
193.Dq any
194to indicate the default behaviour of accepting any single authentication
jmc@openbsd.orgad23a752016-06-17 06:33:30 +0000195method.
djm@openbsd.orgb64faeb2016-06-17 05:03:40 +0000196if the default is overridden, then successful authentication requires
197completion of every method in at least one of these lists.
Damien Millera6e3f012012-11-04 23:21:40 +1100198.Pp
199For example, an argument of
200.Dq publickey,password publickey,keyboard-interactive
201would require the user to complete public key authentication, followed by
202either password or keyboard interactive authentication.
203Only methods that are next in one or more lists are offered at each stage,
204so for this example, it would not be possible to attempt password or
205keyboard-interactive authentication before public key.
206.Pp
Damien Miller91a55f22013-04-23 15:18:10 +1000207For keyboard interactive authentication it is also possible to
208restrict authentication to a specific device by appending a
209colon followed by the device identifier
210.Dq bsdauth ,
211.Dq pam ,
212or
213.Dq skey ,
214depending on the server configuration.
215For example,
216.Dq keyboard-interactive:bsdauth
217would restrict keyboard interactive authentication to the
218.Dq bsdauth
219device.
220.Pp
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000221If the
222.Dq publickey
jmc@openbsd.org449e11b2014-12-22 08:24:17 +0000223method is listed more than once,
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000224.Xr sshd 8
225verifies that keys that have been used successfully are not reused for
226subsequent authentications.
227For example, an
228.Cm AuthenticationMethods
229of
230.Dq publickey,publickey
231will require successful authentication using two different public keys.
232.Pp
Damien Millera6e3f012012-11-04 23:21:40 +1100233Note that each authentication method listed should also be explicitly enabled
234in the configuration.
djm@openbsd.orgb64faeb2016-06-17 05:03:40 +0000235The default
236.Dq any
237is not to require multiple authentication; successful completion
Damien Millera6e3f012012-11-04 23:21:40 +1100238of a single authentication method is sufficient.
Damien Miller09d3e122012-10-31 08:58:58 +1100239.It Cm AuthorizedKeysCommand
Damien Millerf33580e2012-11-04 22:22:52 +1100240Specifies a program to be used to look up the user's public keys.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000241The program must be owned by root, not writable by group or others and
242specified by an absolute path.
243.Pp
244Arguments to
245.Cm AuthorizedKeysCommand
246may be provided using the following tokens, which will be expanded
247at runtime: %% is replaced by a literal '%', %u is replaced by the
248username being authenticated, %h is replaced by the home directory
249of the user being authenticated, %t is replaced with the key type
250offered for authentication, %f is replaced with the fingerprint of
251the key, and %k is replaced with the key being offered for authentication.
252If no arguments are specified then the username of the target user
253will be supplied.
254.Pp
255The program should produce on standard output zero or
Damien Millerfecfd112013-07-18 16:11:50 +1000256more lines of authorized_keys output (see AUTHORIZED_KEYS in
Damien Millerf33580e2012-11-04 22:22:52 +1100257.Xr sshd 8 ) .
Damien Miller09d3e122012-10-31 08:58:58 +1100258If a key supplied by AuthorizedKeysCommand does not successfully authenticate
259and authorize the user then public key authentication continues using the usual
260.Cm AuthorizedKeysFile
261files.
262By default, no AuthorizedKeysCommand is run.
263.It Cm AuthorizedKeysCommandUser
264Specifies the user under whose account the AuthorizedKeysCommand is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100265It is recommended to use a dedicated user that has no other role on the host
266than running authorized keys commands.
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000267If
djm@openbsd.orgd663bea2014-12-11 05:25:06 +0000268.Cm AuthorizedKeysCommand
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000269is specified but
270.Cm AuthorizedKeysCommandUser
271is not, then
272.Xr sshd 8
273will refuse to start.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000274.It Cm AuthorizedKeysFile
275Specifies the file that contains the public keys that can be used
276for user authentication.
Damien Miller6018a362010-07-02 13:35:19 +1000277The format is described in the
Damien Millerfecfd112013-07-18 16:11:50 +1000278AUTHORIZED_KEYS FILE FORMAT
Damien Miller6018a362010-07-02 13:35:19 +1000279section of
280.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000281.Cm AuthorizedKeysFile
282may contain tokens of the form %T which are substituted during connection
Damien Miller5b0d63f2006-03-15 11:56:56 +1100283setup.
Damien Millerfbf486b2003-05-23 18:44:23 +1000284The following tokens are defined: %% is replaced by a literal '%',
Damien Miller5b0d63f2006-03-15 11:56:56 +1100285%h is replaced by the home directory of the user being authenticated, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000286%u is replaced by the username of that user.
287After 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
293.Dq none
294to skip checking for user keys in files.
Damien Millerb9132fc2011-05-29 21:41:40 +1000295The default is
296.Dq .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.
303.Pp
304Arguments to
305.Cm AuthorizedPrincipalsCommand
306may be provided using the following tokens, which will be expanded
307at runtime: %% is replaced by a literal '%', %u is replaced by the
308username being authenticated and %h is replaced by the home directory
309of the user being authenticated.
310.Pp
311The program should produce on standard output zero or
312more lines of
313.Cm AuthorizedPrincipalsFile
314output.
315If either
316.Cm AuthorizedPrincipalsCommand
317or
318.Cm AuthorizedPrincipalsFile
319is specified, then certificates offered by the client for authentication
320must contain a principal that is listed.
321By default, no AuthorizedPrincipalsCommand is run.
322.It Cm AuthorizedPrincipalsCommandUser
323Specifies the user under whose account the AuthorizedPrincipalsCommand is run.
324It is recommended to use a dedicated user that has no other role on the host
325than running authorized principals commands.
326If
327.Cm AuthorizedPrincipalsCommand
328is specified but
329.Cm AuthorizedPrincipalsCommandUser
330is not, then
331.Xr sshd 8
332will refuse to start.
Damien Miller30da3442010-05-10 11:58:03 +1000333.It Cm AuthorizedPrincipalsFile
334Specifies a file that lists principal names that are accepted for
335certificate authentication.
336When using certificates signed by a key listed in
337.Cm TrustedUserCAKeys ,
338this file lists names, one of which must appear in the certificate for it
339to be accepted for authentication.
Damien Millerd59dab82010-07-02 13:37:17 +1000340Names are listed one per line preceded by key options (as described
Damien Millerfecfd112013-07-18 16:11:50 +1000341in AUTHORIZED_KEYS FILE FORMAT in
Damien Millerd59dab82010-07-02 13:37:17 +1000342.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000343Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000344.Ql #
345are ignored.
346.Pp
347.Cm AuthorizedPrincipalsFile
348may contain tokens of the form %T which are substituted during connection
349setup.
350The following tokens are defined: %% is replaced by a literal '%',
351%h is replaced by the home directory of the user being authenticated, and
352%u is replaced by the username of that user.
353After expansion,
354.Cm AuthorizedPrincipalsFile
355is taken to be an absolute path or one relative to the user's home
356directory.
357.Pp
Damien Miller8fef9eb2012-04-22 11:25:10 +1000358The default is
359.Dq none ,
360i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000361of the user must appear in a certificate's principals list for it to be
362accepted.
363Note that
364.Cm AuthorizedPrincipalsFile
365is only used when authentication proceeds using a CA listed in
366.Cm TrustedUserCAKeys
367and is not consulted for certification authorities trusted via
368.Pa ~/.ssh/authorized_keys ,
369though the
370.Cm principals=
371key option offers a similar facility (see
372.Xr sshd 8
373for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000374.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000375The contents of the specified file are sent to the remote user before
376authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000377If the argument is
378.Dq none
379then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000380By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000381.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000382Specifies whether challenge-response authentication is allowed (e.g. via
Damien Millere8c9f262014-10-03 09:24:56 +1000383PAM or through authentication styles supported in
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000384.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000385The default is
386.Dq yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100387.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100388Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100389.Xr chroot 2
390to after authentication.
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000391At session startup
392.Xr sshd 8
393checks that all components of the pathname are root-owned directories
394which are not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000395After the chroot,
396.Xr sshd 8
397changes the working directory to the user's home directory.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100398.Pp
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100399The pathname may contain the following tokens that are expanded at runtime once
Damien Millerd8cb1f12008-02-10 22:40:12 +1100400the connecting user has been authenticated: %% is replaced by a literal '%',
401%h is replaced by the home directory of the user being authenticated, and
402%u is replaced by the username of that user.
403.Pp
404The
405.Cm ChrootDirectory
406must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000407user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100408For an interactive session this requires at least a shell, typically
409.Xr sh 1 ,
410and basic
411.Pa /dev
412nodes such as
413.Xr null 4 ,
414.Xr zero 4 ,
415.Xr stdin 4 ,
416.Xr stdout 4 ,
417.Xr stderr 4 ,
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000418and
Damien Millerd8cb1f12008-02-10 22:40:12 +1100419.Xr tty 4
420devices.
421For file transfer sessions using
Darren Tuckerf92077f2009-06-21 17:56:25 +1000422.Dq sftp ,
Damien Millerd8cb1f12008-02-10 22:40:12 +1100423no additional configuration of the environment is necessary if the
Darren Tuckerf92077f2009-06-21 17:56:25 +1000424in-process sftp server is used,
Damien Miller426117b2014-07-30 12:33:20 +1000425though sessions which use logging may require
Darren Tucker00fcd712009-06-21 17:56:00 +1000426.Pa /dev/log
Damien Miller426117b2014-07-30 12:33:20 +1000427inside the chroot directory on some operating systems (see
Darren Tucker00fcd712009-06-21 17:56:00 +1000428.Xr sftp-server 8
429for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100430.Pp
jmc@openbsd.orga5a3e332015-01-22 21:00:42 +0000431For safety, it is very important that the directory hierarchy be
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000432prevented from modification by other processes on the system (especially
433those outside the jail).
434Misconfiguration can lead to unsafe environments which
435.Xr sshd 8
436cannot detect.
437.Pp
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000438The default is
439.Dq none ,
440indicating not to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100441.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000442.It Cm Ciphers
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000443Specifies the ciphers allowed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000444Multiple ciphers must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000445If the specified value begins with a
446.Sq +
447character, then the specified ciphers will be appended to the default set
448instead of replacing them.
449.Pp
Damien Miller0fde8ac2013-11-21 14:12:23 +1100450The supported ciphers are:
451.Pp
Damien Millerc1621c82014-04-20 13:22:46 +1000452.Bl -item -compact -offset indent
453.It
4543des-cbc
455.It
456aes128-cbc
457.It
458aes192-cbc
459.It
460aes256-cbc
461.It
462aes128-ctr
463.It
464aes192-ctr
465.It
466aes256-ctr
467.It
468aes128-gcm@openssh.com
469.It
470aes256-gcm@openssh.com
471.It
472arcfour
473.It
474arcfour128
475.It
476arcfour256
477.It
478blowfish-cbc
479.It
480cast128-cbc
481.It
482chacha20-poly1305@openssh.com
483.El
Damien Miller0fde8ac2013-11-21 14:12:23 +1100484.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100485The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000486.Bd -literal -offset indent
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000487chacha20-poly1305@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000488aes128-ctr,aes192-ctr,aes256-ctr,
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000489aes128-gcm@openssh.com,aes256-gcm@openssh.com
Ben Lindstrom9f049032002-06-21 00:59:05 +0000490.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100491.Pp
492The list of available ciphers may also be obtained using the
493.Fl Q
494option of
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000495.Xr ssh 1
496with an argument of
497.Dq cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000498.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100499Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000500sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100501.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000502receiving any messages back from the client.
503If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100504sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000505It is important to note that the use of client alive messages is very
506different from
Damien Miller12c150e2003-12-17 16:31:10 +1100507.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000508(below).
509The client alive messages are sent through the encrypted channel
510and therefore will not be spoofable.
511The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100512.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000513is spoofable.
514The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000515server depend on knowing when a connection has become inactive.
516.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000517The default value is 3.
518If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000519.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100520(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000521.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100522is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000523will be disconnected after approximately 45 seconds.
Damien Miller1594ad52005-05-26 12:12:19 +1000524.It Cm ClientAliveInterval
525Sets a timeout interval in seconds after which if no data has been received
526from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100527.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000528will send a message through the encrypted
529channel to request a response from the client.
530The default
531is 0, indicating that these messages will not be sent to the client.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000532.It Cm Compression
Damien Miller9786e6e2005-07-26 21:54:56 +1000533Specifies whether compression is allowed, or delayed until
534the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000535The argument must be
Damien Miller9786e6e2005-07-26 21:54:56 +1000536.Dq yes ,
537.Dq delayed ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000538or
539.Dq no .
540The default is
Damien Miller9786e6e2005-07-26 21:54:56 +1000541.Dq delayed .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000542.It Cm DenyGroups
543This keyword can be followed by a list of group name patterns, separated
544by spaces.
545Login is disallowed for users whose primary group or supplementary
546group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000547Only group names are valid; a numerical group ID is not recognized.
548By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100549The allow/deny directives are processed in the following order:
550.Cm DenyUsers ,
551.Cm AllowUsers ,
552.Cm DenyGroups ,
553and finally
554.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.
Damien Millerac73e512006-03-15 11:58:49 +1100570The allow/deny directives are processed in the following order:
571.Cm DenyUsers ,
572.Cm AllowUsers ,
573.Cm DenyGroups ,
574and finally
575.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100576.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000577See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100578.Xr ssh_config 5
579for more information on patterns.
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000580.It Cm FingerprintHash
581Specifies the hash algorithm used when logging key fingerprints.
582Valid options are:
583.Dq md5
584and
585.Dq sha256 .
586The default is
587.Dq sha256 .
Damien Millere2754432006-07-24 14:06:47 +1000588.It Cm ForceCommand
589Forces the execution of the command specified by
590.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100591ignoring any command supplied by the client and
592.Pa ~/.ssh/rc
593if present.
Damien Millere2754432006-07-24 14:06:47 +1000594The command is invoked by using the user's login shell with the -c option.
595This applies to shell, command, or subsystem execution.
596It is most useful inside a
597.Cm Match
598block.
599The command originally supplied by the client is available in the
600.Ev SSH_ORIGINAL_COMMAND
601environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100602Specifying a command of
603.Dq internal-sftp
604will force the use of an in-process sftp server that requires no support
605files when used with
606.Cm ChrootDirectory .
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000607The default is
608.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000609.It Cm GatewayPorts
610Specifies whether remote hosts are allowed to connect to ports
611forwarded for the client.
612By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100613.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000614binds remote port forwardings to the loopback address.
615This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000616.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100617can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100618should allow remote port forwardings to bind to non-loopback addresses, thus
619allowing other hosts to connect.
620The argument may be
621.Dq no
622to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000623.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100624to force remote port forwardings to bind to the wildcard address, or
625.Dq clientspecified
626to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000627The default is
628.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000629.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000630Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100631The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000632.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000633.It Cm GSSAPICleanupCredentials
634Specifies whether to automatically destroy the user's credentials cache
635on logout.
636The default is
637.Dq yes .
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000638.It Cm GSSAPIStrictAcceptorCheck
639Determines whether to be strict about the identity of the GSSAPI acceptor
640a client authenticates against.
641If set to
642.Dq yes
643then the client must authenticate against the
644.Pa host
645service on the current hostname.
646If set to
647.Dq no
648then the client may authenticate against any service key stored in the
649machine's default store.
650This facility is provided to assist with operation on multi homed machines.
651The default is
652.Dq yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000653.It Cm HostbasedAcceptedKeyTypes
654Specifies the key types that will be accepted for hostbased authentication
655as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000656Alternately if the specified value begins with a
657.Sq +
658character, then the specified key types will be appended to the default set
659instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000660The default for this option is:
661.Bd -literal -offset 3n
662ecdsa-sha2-nistp256-cert-v01@openssh.com,
663ecdsa-sha2-nistp384-cert-v01@openssh.com,
664ecdsa-sha2-nistp521-cert-v01@openssh.com,
665ssh-ed25519-cert-v01@openssh.com,
666ssh-rsa-cert-v01@openssh.com,
667ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +0000668ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000669.Ed
670.Pp
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000671The
672.Fl Q
673option of
674.Xr ssh 1
675may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000676.It Cm HostbasedAuthentication
677Specifies whether rhosts or /etc/hosts.equiv authentication together
678with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100679(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000680The default is
681.Dq no .
Damien Millerb594f382006-08-30 11:06:34 +1000682.It Cm HostbasedUsesNameFromPacketOnly
683Specifies whether or not the server will attempt to perform a reverse
684name lookup when matching the name in the
685.Pa ~/.shosts ,
686.Pa ~/.rhosts ,
687and
688.Pa /etc/hosts.equiv
689files during
690.Cm HostbasedAuthentication .
691A setting of
692.Dq yes
693means that
694.Xr sshd 8
695uses the name supplied by the client rather than
696attempting to resolve the name from the TCP connection itself.
697The default is
698.Dq no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100699.It Cm HostCertificate
700Specifies a file containing a public host certificate.
701The certificate's public key must match a private host key already specified
702by
703.Cm HostKey .
704The default behaviour of
705.Xr sshd 8
706is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000707.It Cm HostKey
708Specifies a file containing a private host key
709used by SSH.
naddy@openbsd.orgffe65492016-08-15 12:32:04 +0000710The defaults are
Damien Millereb8b60e2010-08-31 22:41:14 +1000711.Pa /etc/ssh/ssh_host_dsa_key ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100712.Pa /etc/ssh/ssh_host_ecdsa_key ,
713.Pa /etc/ssh/ssh_host_ed25519_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000714and
naddy@openbsd.orgffe65492016-08-15 12:32:04 +0000715.Pa /etc/ssh/ssh_host_rsa_key .
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000716.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000717Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100718.Xr sshd 8
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000719will refuse to use a file if it is group/world-accessible
720and that the
721.Cm HostKeyAlgorithms
722option restricts which of the keys are actually used by
723.Xr sshd 8 .
724.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000725It is possible to have multiple host key files.
Damien Miller85b45e02013-07-20 13:21:52 +1000726It is also possible to specify public host key files instead.
727In this case operations on the private key will be delegated
728to an
729.Xr ssh-agent 1 .
730.It Cm HostKeyAgent
731Identifies the UNIX-domain socket used to communicate
732with an agent that has access to the private host keys.
markus@openbsd.org1a75d142016-05-04 14:29:58 +0000733If the string
Damien Miller85b45e02013-07-20 13:21:52 +1000734.Dq SSH_AUTH_SOCK
735is specified, the location of the socket will be read from the
736.Ev SSH_AUTH_SOCK
737environment variable.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000738.It Cm HostKeyAlgorithms
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000739Specifies the host key algorithms
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000740that the server offers.
741The default for this option is:
742.Bd -literal -offset 3n
743ecdsa-sha2-nistp256-cert-v01@openssh.com,
744ecdsa-sha2-nistp384-cert-v01@openssh.com,
745ecdsa-sha2-nistp521-cert-v01@openssh.com,
746ssh-ed25519-cert-v01@openssh.com,
747ssh-rsa-cert-v01@openssh.com,
748ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +0000749ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000750.Ed
751.Pp
752The list of available key types may also be obtained using the
753.Fl Q
754option of
755.Xr ssh 1
756with an argument of
757.Dq key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000758.It Cm IgnoreRhosts
759Specifies that
760.Pa .rhosts
761and
762.Pa .shosts
763files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000764.Cm HostbasedAuthentication .
765.Pp
766.Pa /etc/hosts.equiv
767and
768.Pa /etc/shosts.equiv
769are still used.
770The default is
771.Dq yes .
772.It Cm IgnoreUserKnownHosts
773Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100774.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000775should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000776.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000777during
Ben Lindstrom9f049032002-06-21 00:59:05 +0000778.Cm HostbasedAuthentication .
779The default is
780.Dq no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100781.It Cm IPQoS
782Specifies the IPv4 type-of-service or DSCP class for the connection.
783Accepted values are
784.Dq af11 ,
785.Dq af12 ,
786.Dq af13 ,
Damien Millerf6e758c2011-09-22 21:37:13 +1000787.Dq af21 ,
Damien Miller0dac6fb2010-11-20 15:19:38 +1100788.Dq af22 ,
789.Dq af23 ,
790.Dq af31 ,
791.Dq af32 ,
792.Dq af33 ,
793.Dq af41 ,
794.Dq af42 ,
795.Dq af43 ,
796.Dq cs0 ,
797.Dq cs1 ,
798.Dq cs2 ,
799.Dq cs3 ,
800.Dq cs4 ,
801.Dq cs5 ,
802.Dq cs6 ,
803.Dq cs7 ,
804.Dq ef ,
805.Dq lowdelay ,
806.Dq throughput ,
807.Dq reliability ,
808or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +1100809This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100810If one argument is specified, it is used as the packet class unconditionally.
811If two values are specified, the first is automatically selected for
812interactive sessions and the second for non-interactive sessions.
813The default is
814.Dq lowdelay
815for interactive sessions and
816.Dq throughput
817for non-interactive sessions.
Damien Millere1e480a2014-02-04 11:13:17 +1100818.It Cm KbdInteractiveAuthentication
819Specifies whether to allow keyboard-interactive authentication.
820The argument to this keyword must be
821.Dq yes
822or
823.Dq no .
824The default is to use whatever value
825.Cm ChallengeResponseAuthentication
826is set to
827(by default
828.Dq yes ) .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000829.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000830Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000831.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000832will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000833To use this option, the server needs a
834Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100835The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000836.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100837.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000838If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100839an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100840The default is
Damien Miller8448e662004-03-08 23:13:15 +1100841.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000842.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100843If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000844the password will be validated via any additional local mechanism
845such as
846.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100847The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000848.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000849.It Cm KerberosTicketCleanup
850Specifies whether to automatically destroy the user's ticket cache
851file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100852The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000853.Dq yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000854.It Cm KexAlgorithms
855Specifies the available KEX (Key Exchange) algorithms.
856Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000857Alternately if the specified value begins with a
858.Sq +
859character, then the specified methods will be appended to the default set
860instead of replacing them.
Damien Millerc1621c82014-04-20 13:22:46 +1000861The supported algorithms are:
862.Pp
863.Bl -item -compact -offset indent
864.It
865curve25519-sha256@libssh.org
866.It
867diffie-hellman-group1-sha1
868.It
869diffie-hellman-group14-sha1
870.It
871diffie-hellman-group-exchange-sha1
872.It
873diffie-hellman-group-exchange-sha256
874.It
875ecdh-sha2-nistp256
876.It
877ecdh-sha2-nistp384
878.It
879ecdh-sha2-nistp521
880.El
881.Pp
882The default is:
Damien Miller6575c3a2013-12-18 17:47:02 +1100883.Bd -literal -offset indent
884curve25519-sha256@libssh.org,
885ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
886diffie-hellman-group-exchange-sha256,
Damien Millerc1621c82014-04-20 13:22:46 +1000887diffie-hellman-group14-sha1
Damien Miller6575c3a2013-12-18 17:47:02 +1100888.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000889.Pp
890The list of available key exchange algorithms may also be obtained using the
891.Fl Q
892option of
893.Xr ssh 1
894with an argument of
895.Dq kex .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000896.It Cm ListenAddress
897Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100898.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000899should listen on.
900The following forms may be used:
901.Pp
902.Bl -item -offset indent -compact
903.It
904.Cm ListenAddress
905.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000906.Ar host | Ar IPv4_addr | Ar IPv6_addr
Ben Lindstrom9f049032002-06-21 00:59:05 +0000907.Sm on
908.It
909.Cm ListenAddress
910.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000911.Ar host | Ar IPv4_addr : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000912.Sm on
913.It
914.Cm ListenAddress
915.Sm off
916.Oo
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000917.Ar host | Ar IPv6_addr Oc : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000918.Sm on
919.El
920.Pp
921If
922.Ar port
923is not specified,
dtucker@openbsd.org531a57a2015-04-29 03:48:56 +0000924sshd will listen on the address and all
Ben Lindstrom9f049032002-06-21 00:59:05 +0000925.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000926options specified.
927The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000928Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000929.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000930options are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000931.It Cm LoginGraceTime
932The server disconnects after this time if the user has not
933successfully logged in.
934If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000935The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000936.It Cm LogLevel
937Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100938.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000939The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100940QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000941The default is INFO.
942DEBUG and DEBUG1 are equivalent.
943DEBUG2 and DEBUG3 each specify higher levels of debugging output.
944Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000945.It Cm MACs
946Specifies the available MAC (message authentication code) algorithms.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000947The MAC algorithm is used for data integrity protection.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000948Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000949If the specified value begins with a
950.Sq +
951character, then the specified algorithms will be appended to the default set
952instead of replacing them.
953.Pp
Damien Milleraf43a7a2012-12-12 10:46:31 +1100954The algorithms that contain
955.Dq -etm
956calculate the MAC after encryption (encrypt-then-mac).
957These are considered safer and their use recommended.
Damien Millerc1621c82014-04-20 13:22:46 +1000958The supported MACs are:
959.Pp
960.Bl -item -compact -offset indent
961.It
962hmac-md5
963.It
964hmac-md5-96
965.It
966hmac-ripemd160
967.It
968hmac-sha1
969.It
970hmac-sha1-96
971.It
972hmac-sha2-256
973.It
974hmac-sha2-512
975.It
976umac-64@openssh.com
977.It
978umac-128@openssh.com
979.It
980hmac-md5-etm@openssh.com
981.It
982hmac-md5-96-etm@openssh.com
983.It
984hmac-ripemd160-etm@openssh.com
985.It
986hmac-sha1-etm@openssh.com
987.It
988hmac-sha1-96-etm@openssh.com
989.It
990hmac-sha2-256-etm@openssh.com
991.It
992hmac-sha2-512-etm@openssh.com
993.It
994umac-64-etm@openssh.com
995.It
996umac-128-etm@openssh.com
997.El
998.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100999The default is:
Damien Miller22b7b492007-06-11 14:07:12 +10001000.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +11001001umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1002hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001003hmac-sha1-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +10001004umac-64@openssh.com,umac-128@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001005hmac-sha2-256,hmac-sha2-512,hmac-sha1
Damien Miller22b7b492007-06-11 14:07:12 +10001006.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001007.Pp
1008The list of available MAC algorithms may also be obtained using the
1009.Fl Q
1010option of
1011.Xr ssh 1
1012with an argument of
1013.Dq mac .
Darren Tucker45150472006-07-12 22:34:17 +10001014.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +10001015Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +10001016If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +10001017.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001018line are satisfied, the keywords on the following lines override those
1019set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +10001020.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001021line or the end of the file.
Damien Millerfc5d6752014-02-28 10:01:28 +11001022If a keyword appears in multiple
1023.Cm Match
sobrado@openbsd.org180bcb42014-08-30 16:32:25 +00001024blocks that are satisfied, only the first instance of the keyword is
Damien Millerfc5d6752014-02-28 10:01:28 +11001025applied.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001026.Pp
Damien Millerd04f3572006-07-24 13:46:50 +10001027The arguments to
Darren Tucker45150472006-07-12 22:34:17 +10001028.Cm Match
Damien Millercf31f382013-10-24 21:02:56 +11001029are one or more criteria-pattern pairs or the single token
1030.Cm All
1031which matches all criteria.
Darren Tucker45150472006-07-12 22:34:17 +10001032The available criteria are
1033.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +10001034.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +10001035.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +10001036.Cm LocalAddress ,
1037.Cm LocalPort ,
Darren Tucker45150472006-07-12 22:34:17 +10001038and
1039.Cm Address .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001040The match patterns may consist of single entries or comma-separated
1041lists and may use the wildcard and negation operators described in the
Damien Millerfecfd112013-07-18 16:11:50 +10001042PATTERNS section 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
Darren Tucker6a2a4002008-06-10 23:03:04 +10001048address/masklen format, e.g.\&
Darren Tucker7a3935d2008-06-10 22:59:10 +10001049.Dq 192.0.2.0/24
1050or
jca@openbsd.org42d47ad2016-08-12 19:19:04 +00001051.Dq 2001:db8::/32 .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001052Note that the mask length provided must be consistent with the address -
1053it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +10001054or one with bits set in this host portion of the address.
1055For example,
Darren Tucker7a3935d2008-06-10 22:59:10 +10001056.Dq 192.0.2.0/33
1057and
Darren Tucker6a2a4002008-06-10 23:03:04 +10001058.Dq 192.0.2.0/8
Darren Tucker7a3935d2008-06-10 22:59:10 +10001059respectively.
1060.Pp
Darren Tucker45150472006-07-12 22:34:17 +10001061Only a subset of keywords may be used on the lines following a
1062.Cm Match
1063keyword.
1064Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +10001065.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +11001066.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +10001067.Cm AllowGroups ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001068.Cm AllowStreamLocalForwarding ,
Damien Miller9b439df2006-07-24 14:04:00 +10001069.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +10001070.Cm AllowUsers ,
Damien Millera6e3f012012-11-04 23:21:40 +11001071.Cm AuthenticationMethods ,
Damien Miller09d3e122012-10-31 08:58:58 +11001072.Cm AuthorizedKeysCommand ,
1073.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +11001074.Cm AuthorizedKeysFile ,
djm@openbsd.orgb6b91082015-11-13 02:57:46 +00001075.Cm AuthorizedPrincipalsCommand ,
1076.Cm AuthorizedPrincipalsCommandUser ,
Damien Millerab6de352010-06-26 09:38:45 +10001077.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +11001078.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +10001079.Cm ChrootDirectory ,
Damien Millerc24da772012-06-20 21:53:58 +10001080.Cm DenyGroups ,
1081.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +10001082.Cm ForceCommand ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001083.Cm GatewayPorts ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +00001084.Cm GSSAPIAuthentication ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001085.Cm HostbasedAcceptedKeyTypes ,
Damien Miller25434de2008-05-19 14:29:08 +10001086.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +10001087.Cm HostbasedUsesNameFromPacketOnly ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001088.Cm IPQoS ,
Darren Tucker1d75f222007-03-01 21:31:28 +11001089.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +11001090.Cm KerberosAuthentication ,
Damien Miller307c1d12008-06-16 07:56:20 +10001091.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +10001092.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +11001093.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +11001094.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +10001095.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +11001096.Cm PermitRootLogin ,
Damien Miller5ff30c62013-10-30 22:21:50 +11001097.Cm PermitTTY ,
Damien Millerab6de352010-06-26 09:38:45 +10001098.Cm PermitTunnel ,
Damien Miller72e6b5c2014-07-04 09:00:04 +10001099.Cm PermitUserRC ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001100.Cm PubkeyAcceptedKeyTypes ,
Darren Tucker1477ea12009-10-07 08:36:05 +11001101.Cm PubkeyAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001102.Cm RekeyLimit ,
1103.Cm RevokedKeys ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001104.Cm StreamLocalBindMask ,
1105.Cm StreamLocalBindUnlink ,
1106.Cm TrustedUserCAKeys ,
Damien Millerd1de9952006-07-24 14:05:48 +10001107.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +11001108.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +10001109and
Damien Miller0296ae82009-02-23 11:00:24 +11001110.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +10001111.It Cm MaxAuthTries
1112Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +10001113connection.
1114Once the number of failures reaches half this value,
1115additional failures are logged.
1116The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +10001117.It Cm MaxSessions
djm@openbsd.orgcac3b662016-02-05 02:37:56 +00001118Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1119sessions permitted per network connection.
1120Multiple sessions may be established by clients that support connection
1121multiplexing.
1122Setting
1123.Cm MaxSessions
1124to 1 will effectively disable session multiplexing, whereas setting it to 0
1125will prevent all shell, login and subsystem sessions while still permitting
1126forwarding.
Damien Miller7207f642008-05-19 15:34:50 +10001127The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001128.It Cm MaxStartups
1129Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001130SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001131Additional connections will be dropped until authentication succeeds or the
1132.Cm LoginGraceTime
1133expires for a connection.
Damien Miller1f583df2013-02-12 11:02:08 +11001134The default is 10:30:100.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001135.Pp
1136Alternatively, random early drop can be enabled by specifying
1137the three colon separated values
1138.Dq start:rate:full
Damien Miller208f1ed2006-03-15 11:56:03 +11001139(e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +11001140.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001141will refuse connection attempts with a probability of
1142.Dq rate/100
1143(30%)
1144if there are currently
1145.Dq start
1146(10)
1147unauthenticated connections.
1148The probability increases linearly and all connection attempts
1149are refused if the number of unauthenticated connections reaches
1150.Dq full
1151(60).
1152.It Cm PasswordAuthentication
1153Specifies whether password authentication is allowed.
1154The default is
1155.Dq yes .
1156.It Cm PermitEmptyPasswords
1157When password authentication is allowed, it specifies whether the
1158server allows login to accounts with empty password strings.
1159The default is
1160.Dq no .
Damien Miller9b439df2006-07-24 14:04:00 +10001161.It Cm PermitOpen
1162Specifies the destinations to which TCP port forwarding is permitted.
1163The forwarding specification must be one of the following forms:
1164.Pp
1165.Bl -item -offset indent -compact
1166.It
1167.Cm PermitOpen
1168.Sm off
1169.Ar host : port
1170.Sm on
1171.It
1172.Cm PermitOpen
1173.Sm off
1174.Ar IPv4_addr : port
1175.Sm on
1176.It
1177.Cm PermitOpen
1178.Sm off
1179.Ar \&[ IPv6_addr \&] : port
1180.Sm on
1181.El
1182.Pp
Damien Millera765cf42006-07-24 14:08:13 +10001183Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +10001184An argument of
1185.Dq any
1186can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +10001187An argument of
1188.Dq none
1189can be used to prohibit all forwarding requests.
jmc@openbsd.org32d921c2016-07-19 12:59:16 +00001190The wildcard
dtucker@openbsd.orgd7eabc82016-07-19 11:38:53 +00001191.Dq *
jmc@openbsd.org32d921c2016-07-19 12:59:16 +00001192can be used for host or port to allow all hosts or ports, respectively.
Damien Miller65bc2c42006-07-24 14:04:16 +10001193By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001194.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +11001195Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +00001196.Xr ssh 1 .
1197The argument must be
1198.Dq yes ,
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001199.Dq prohibit-password ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001200.Dq without-password ,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001201.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001202or
1203.Dq no .
1204The default is
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001205.Dq prohibit-password .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001206.Pp
1207If this option is set to
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001208.Dq prohibit-password
1209or
Damien Miller5b0d63f2006-03-15 11:56:56 +11001210.Dq without-password ,
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001211password and keyboard-interactive authentication are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001212.Pp
1213If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001214.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001215root login with public key authentication will be allowed,
1216but only if the
1217.Ar command
1218option has been specified
1219(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +10001220normally not allowed).
1221All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001222.Pp
1223If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001224.Dq no ,
Darren Tuckerb3509012005-01-20 11:01:46 +11001225root is not allowed to log in.
Damien Millerd27b9472005-12-13 19:29:02 +11001226.It Cm PermitTunnel
1227Specifies whether
1228.Xr tun 4
1229device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +11001230The argument must be
1231.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +10001232.Dq point-to-point
1233(layer 3),
1234.Dq ethernet
1235(layer 2), or
Damien Miller7b58e802005-12-13 19:33:19 +11001236.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +10001237Specifying
1238.Dq yes
1239permits both
1240.Dq point-to-point
1241and
1242.Dq ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +11001243The default is
1244.Dq no .
djm@openbsd.org48dffd52014-09-09 09:45:36 +00001245.Pp
1246Independent of this setting, the permissions of the selected
1247.Xr tun 4
1248device must allow access to the user.
Damien Miller5ff30c62013-10-30 22:21:50 +11001249.It Cm PermitTTY
1250Specifies whether
Damien Miller63857c92013-10-30 22:31:06 +11001251.Xr pty 4
Damien Miller5ff30c62013-10-30 22:21:50 +11001252allocation is permitted.
1253The default is
1254.Dq yes .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001255.It Cm PermitUserEnvironment
1256Specifies whether
1257.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001258and
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001259.Cm environment=
1260options in
1261.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001262are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +11001263.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001264The default is
1265.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001266Enabling environment processing may enable users to bypass access
1267restrictions in some configurations using mechanisms such as
1268.Ev LD_PRELOAD .
Damien Miller72e6b5c2014-07-04 09:00:04 +10001269.It Cm PermitUserRC
1270Specifies whether any
1271.Pa ~/.ssh/rc
1272file is executed.
1273The default is
1274.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001275.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +00001276Specifies the file that contains the process ID of the
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001277SSH daemon, or
1278.Dq none
1279to not write one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001280The default is
1281.Pa /var/run/sshd.pid .
1282.It Cm Port
1283Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +11001284.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001285listens on.
1286The default is 22.
1287Multiple options of this type are permitted.
1288See also
1289.Cm ListenAddress .
1290.It Cm PrintLastLog
1291Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001292.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +11001293should print the date and time of the last user login when a user logs
1294in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001295The default is
1296.Dq yes .
1297.It Cm PrintMotd
1298Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001299.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001300should print
1301.Pa /etc/motd
1302when a user logs in interactively.
1303(On some systems it is also printed by the shell,
1304.Pa /etc/profile ,
1305or equivalent.)
1306The default is
1307.Dq yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001308.It Cm PubkeyAcceptedKeyTypes
1309Specifies the key types that will be accepted for public key authentication
1310as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001311Alternately if the specified value begins with a
1312.Sq +
1313character, then the specified key types will be appended to the default set
1314instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001315The default for this option is:
1316.Bd -literal -offset 3n
1317ecdsa-sha2-nistp256-cert-v01@openssh.com,
1318ecdsa-sha2-nistp384-cert-v01@openssh.com,
1319ecdsa-sha2-nistp521-cert-v01@openssh.com,
1320ssh-ed25519-cert-v01@openssh.com,
1321ssh-rsa-cert-v01@openssh.com,
1322ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +00001323ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001324.Ed
1325.Pp
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001326The
1327.Fl Q
1328option of
1329.Xr ssh 1
1330may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001331.It Cm PubkeyAuthentication
1332Specifies whether public key authentication is allowed.
1333The default is
1334.Dq yes .
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001335.It Cm RekeyLimit
1336Specifies the maximum amount of data that may be transmitted before the
1337session key is renegotiated, optionally followed a maximum amount of
1338time that may pass before the session key is renegotiated.
1339The first argument is specified in bytes and may have a suffix of
1340.Sq K ,
1341.Sq M ,
1342or
1343.Sq G
1344to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1345The default is between
1346.Sq 1G
1347and
1348.Sq 4G ,
1349depending on the cipher.
1350The optional second value is specified in seconds and may use any of the
1351units documented in the
1352.Sx TIME FORMATS
Darren Tucker64d22942013-05-16 20:31:29 +10001353section.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001354The default value for
1355.Cm RekeyLimit
1356is
1357.Dq default none ,
1358which means that rekeying is performed after the cipher's default amount
1359of data has been sent or received and no time based rekeying is done.
Damien Miller1aed65e2010-03-04 21:53:35 +11001360.It Cm RevokedKeys
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001361Specifies revoked public keys file, or
1362.Dq none
1363to not use one.
Damien Miller1aed65e2010-03-04 21:53:35 +11001364Keys listed in this file will be refused for public key authentication.
1365Note that if this file is not readable, then public key authentication will
1366be refused for all users.
Damien Millerf3747bf2013-01-18 11:44:04 +11001367Keys may be specified as a text file, listing one public key per line, or as
1368an OpenSSH Key Revocation List (KRL) as generated by
Damien Miller72abeb72013-01-20 22:33:44 +11001369.Xr ssh-keygen 1 .
Damien Millerfecfd112013-07-18 16:11:50 +10001370For more information on KRLs, see the KEY REVOCATION LISTS section in
Damien Millerf3747bf2013-01-18 11:44:04 +11001371.Xr ssh-keygen 1 .
Damien Miller7acefbb2014-07-18 14:11:24 +10001372.It Cm StreamLocalBindMask
1373Sets the octal file creation mode mask
1374.Pq umask
1375used when creating a Unix-domain socket file for local or remote
1376port forwarding.
1377This option is only used for port forwarding to a Unix-domain socket file.
1378.Pp
1379The default value is 0177, which creates a Unix-domain socket file that is
1380readable and writable only by the owner.
1381Note that not all operating systems honor the file mode on Unix-domain
1382socket files.
1383.It Cm StreamLocalBindUnlink
1384Specifies whether to remove an existing Unix-domain socket file for local
1385or remote port forwarding before creating a new one.
1386If the socket file already exists and
1387.Cm StreamLocalBindUnlink
1388is not enabled,
1389.Nm sshd
1390will be unable to forward the port to the Unix-domain socket file.
1391This option is only used for port forwarding to a Unix-domain socket file.
1392.Pp
1393The argument must be
1394.Dq yes
1395or
1396.Dq no .
1397The default is
1398.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001399.It Cm StrictModes
1400Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001401.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001402should check file modes and ownership of the
1403user's files and home directory before accepting login.
1404This is normally desirable because novices sometimes accidentally leave their
1405directory or files world-writable.
1406The default is
1407.Dq yes .
Darren Tuckerf788a912010-01-08 17:06:47 +11001408Note that this does not apply to
1409.Cm ChrootDirectory ,
1410whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001411.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +11001412Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +10001413Arguments should be a subsystem name and a command (with optional arguments)
1414to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001415.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001416The command
1417.Xr sftp-server 8
1418implements the
1419.Dq sftp
1420file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001421.Pp
1422Alternately the name
1423.Dq internal-sftp
1424implements an in-process
1425.Dq sftp
1426server.
1427This may simplify configurations using
1428.Cm ChrootDirectory
1429to force a different filesystem root on clients.
1430.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001431By default no subsystems are defined.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001432.It Cm SyslogFacility
1433Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001434.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001435The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1436LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1437The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001438.It Cm TCPKeepAlive
1439Specifies whether the system should send TCP keepalive messages to the
1440other side.
1441If they are sent, death of the connection or crash of one
1442of the machines will be properly noticed.
1443However, this means that
1444connections will die if the route is down temporarily, and some people
1445find it annoying.
1446On the other hand, if TCP keepalives are not sent,
1447sessions may hang indefinitely on the server, leaving
1448.Dq ghost
1449users and consuming server resources.
1450.Pp
1451The default is
1452.Dq yes
1453(to send TCP keepalive messages), and the server will notice
1454if the network goes down or the client host crashes.
1455This avoids infinitely hanging sessions.
1456.Pp
1457To disable TCP keepalive messages, the value should be set to
1458.Dq no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001459.It Cm TrustedUserCAKeys
1460Specifies a file containing public keys of certificate authorities that are
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001461trusted to sign user certificates for authentication, or
1462.Dq none
1463to not use one.
Damien Miller72b33822010-03-05 07:39:01 +11001464Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001465.Ql #
1466are allowed.
1467If a certificate is presented for authentication and has its signing CA key
1468listed in this file, then it may be used for authentication for any user
1469listed in the certificate's principals list.
1470Note that certificates that lack a list of principals will not be permitted
1471for authentication using
1472.Cm TrustedUserCAKeys .
Damien Millerfecfd112013-07-18 16:11:50 +10001473For more details on certificates, see the CERTIFICATES section in
Damien Miller1aed65e2010-03-04 21:53:35 +11001474.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001475.It Cm UseDNS
1476Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001477.Xr sshd 8
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001478should look up the remote host name, and to check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001479the resolved host name for the remote IP address maps back to the
1480very same IP address.
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001481.Pp
1482If this option is set to
1483.Dq no
1484(the default) then only addresses and not host names may be used in
djm@openbsd.org0235a5f2016-03-17 17:19:43 +00001485.Pa ~/.ssh/authorized_keys
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001486.Cm from
1487and
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +00001488.Nm
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001489.Cm Match
1490.Cm Host
1491directives.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001492.It Cm UseLogin
1493Specifies whether
1494.Xr login 1
1495is used for interactive login sessions.
1496The default is
1497.Dq no .
1498Note that
1499.Xr login 1
1500is never used for remote command execution.
1501Note also, that if this is enabled,
1502.Cm X11Forwarding
1503will be disabled because
1504.Xr login 1
1505does not know how to handle
1506.Xr xauth 1
Damien Miller495dca32003-04-01 21:42:14 +10001507cookies.
1508If
Ben Lindstrom9f049032002-06-21 00:59:05 +00001509.Cm UsePrivilegeSeparation
1510is specified, it will be disabled after authentication.
Damien Miller2e193e22003-05-14 15:13:03 +10001511.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001512Enables the Pluggable Authentication Module interface.
1513If set to
1514.Dq yes
1515this will enable PAM authentication using
1516.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001517and
1518.Cm PasswordAuthentication
1519in addition to PAM account and session module processing for all
1520authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001521.Pp
1522Because PAM challenge-response authentication usually serves an equivalent
1523role to password authentication, you should disable either
1524.Cm PasswordAuthentication
1525or
1526.Cm ChallengeResponseAuthentication.
1527.Pp
1528If
1529.Cm UsePAM
1530is enabled, you will not be able to run
1531.Xr sshd 8
1532as a non-root user.
1533The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +10001534.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001535.It Cm UsePrivilegeSeparation
1536Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001537.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001538separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +10001539to deal with incoming network traffic.
1540After successful authentication, another process will be created that has
1541the privilege of the authenticated user.
1542The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +00001543escalation by containing any corruption within the unprivileged processes.
sobrado@openbsd.orgbdcb73f2015-10-07 14:45:30 +00001544The argument must be
1545.Dq yes ,
1546.Dq no ,
1547or
1548.Dq sandbox .
Damien Miller69ff1df2011-06-23 08:30:03 +10001549If
1550.Cm UsePrivilegeSeparation
1551is set to
1552.Dq sandbox
1553then the pre-authentication unprivileged process is subject to additional
1554restrictions.
sobrado@openbsd.orgbdcb73f2015-10-07 14:45:30 +00001555The default is
1556.Dq sandbox .
Damien Miller23528812012-04-22 11:24:43 +10001557.It Cm VersionAddendum
1558Optionally specifies additional text to append to the SSH protocol banner
1559sent by the server upon connection.
1560The default is
1561.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001562.It Cm X11DisplayOffset
1563Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001564.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001565X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001566This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001567The default is 10.
1568.It Cm X11Forwarding
1569Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001570The argument must be
1571.Dq yes
1572or
1573.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001574The default is
1575.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +10001576.Pp
1577When X11 forwarding is enabled, there may be additional exposure to
1578the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001579.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001580proxy display is configured to listen on the wildcard address (see
1581.Cm X11UseLocalhost
Damien Miller5b0d63f2006-03-15 11:56:56 +11001582below), though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001583Additionally, the authentication spoofing and authentication data
1584verification and substitution occur on the client side.
1585The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001586display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001587forwarding (see the warnings for
1588.Cm ForwardX11
1589in
Damien Millerf1ce5052003-06-11 22:04:39 +10001590.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001591A system administrator may have a stance in which they want to
1592protect clients that may expose themselves to attack by unwittingly
1593requesting X11 forwarding, which can warrant a
1594.Dq no
1595setting.
1596.Pp
1597Note that disabling X11 forwarding does not prevent users from
1598forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001599X11 forwarding is automatically disabled if
1600.Cm UseLogin
1601is enabled.
1602.It Cm X11UseLocalhost
1603Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001604.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001605should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001606the wildcard address.
1607By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001608sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001609hostname part of the
1610.Ev DISPLAY
1611environment variable to
1612.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001613This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001614However, some older X11 clients may not function with this
1615configuration.
1616.Cm X11UseLocalhost
1617may be set to
1618.Dq no
1619to specify that the forwarding server should be bound to the wildcard
1620address.
1621The argument must be
1622.Dq yes
1623or
1624.Dq no .
1625The default is
1626.Dq yes .
1627.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001628Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001629.Xr xauth 1
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001630program, or
1631.Dq none
1632to not use one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001633The default is
1634.Pa /usr/X11R6/bin/xauth .
1635.El
Damien Millere3beba22006-03-15 11:59:25 +11001636.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001637.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001638command-line arguments and configuration file options that specify time
1639may be expressed using a sequence of the form:
1640.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001641.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001642.Sm on
1643where
1644.Ar time
1645is a positive integer value and
1646.Ar qualifier
1647is one of the following:
1648.Pp
1649.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001650.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001651seconds
1652.It Cm s | Cm S
1653seconds
1654.It Cm m | Cm M
1655minutes
1656.It Cm h | Cm H
1657hours
1658.It Cm d | Cm D
1659days
1660.It Cm w | Cm W
1661weeks
1662.El
1663.Pp
1664Each member of the sequence is added together to calculate
1665the total time value.
1666.Pp
1667Time format examples:
1668.Pp
1669.Bl -tag -width Ds -compact -offset indent
1670.It 600
1671600 seconds (10 minutes)
1672.It 10m
167310 minutes
1674.It 1h30m
16751 hour 30 minutes (90 minutes)
1676.El
1677.Sh FILES
1678.Bl -tag -width Ds
1679.It Pa /etc/ssh/sshd_config
1680Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001681.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001682This file should be writable by root only, but it is recommended
1683(though not necessary) that it be world-readable.
1684.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001685.Sh SEE ALSO
1686.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001687.Sh AUTHORS
1688OpenSSH is a derivative of the original and free
1689ssh 1.2.12 release by Tatu Ylonen.
1690Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1691Theo de Raadt and Dug Song
1692removed many bugs, re-added newer features and
1693created OpenSSH.
1694Markus Friedl contributed the support for SSH
1695protocol versions 1.5 and 2.0.
1696Niels Provos and Markus Friedl contributed support
1697for privilege separation.