blob: ef919056883bace81a6d323ef33632cec96a6df8 [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.orga685ae82016-02-17 07:38:19 +000036.\" $OpenBSD: sshd_config.5,v 1.219 2016/02/17 07:38:19 jmc Exp $
37.Dd $Mdocdate: February 17 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.
Damien Millerac73e512006-03-15 11:58:49 +1100176The allow/deny directives are processed in the following order:
177.Cm DenyUsers ,
178.Cm AllowUsers ,
179.Cm DenyGroups ,
180and finally
181.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100182.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000183See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100184.Xr ssh_config 5
185for more information on patterns.
Damien Millera6e3f012012-11-04 23:21:40 +1100186.It Cm AuthenticationMethods
187Specifies the authentication methods that must be successfully completed
188for a user to be granted access.
189This option must be followed by one or more comma-separated lists of
190authentication method names.
191Successful authentication requires completion of every method in at least
192one of these lists.
193.Pp
194For example, an argument of
195.Dq publickey,password publickey,keyboard-interactive
196would 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,
199so for this example, it would not be possible to attempt password or
200keyboard-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
205.Dq bsdauth ,
206.Dq pam ,
207or
208.Dq skey ,
209depending on the server configuration.
210For example,
211.Dq keyboard-interactive:bsdauth
212would restrict keyboard interactive authentication to the
213.Dq bsdauth
214device.
215.Pp
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000216If the
217.Dq publickey
jmc@openbsd.org449e11b2014-12-22 08:24:17 +0000218method is listed more than once,
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000219.Xr sshd 8
220verifies that keys that have been used successfully are not reused for
221subsequent authentications.
222For example, an
223.Cm AuthenticationMethods
224of
225.Dq publickey,publickey
226will require successful authentication using two different public keys.
227.Pp
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000228This option will yield a fatal
Damien Millera6e3f012012-11-04 23:21:40 +1100229error if enabled if protocol 1 is also enabled.
230Note that each authentication method listed should also be explicitly enabled
231in the configuration.
232The default is not to require multiple authentication; successful completion
233of a single authentication method is sufficient.
Damien Miller09d3e122012-10-31 08:58:58 +1100234.It Cm AuthorizedKeysCommand
Damien Millerf33580e2012-11-04 22:22:52 +1100235Specifies a program to be used to look up the user's public keys.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000236The program must be owned by root, not writable by group or others and
237specified by an absolute path.
238.Pp
239Arguments to
240.Cm AuthorizedKeysCommand
241may be provided using the following tokens, which will be expanded
242at runtime: %% is replaced by a literal '%', %u is replaced by the
243username being authenticated, %h is replaced by the home directory
244of the user being authenticated, %t is replaced with the key type
245offered for authentication, %f is replaced with the fingerprint of
246the key, and %k is replaced with the key being offered for authentication.
247If no arguments are specified then the username of the target user
248will be supplied.
249.Pp
250The program should produce on standard output zero or
Damien Millerfecfd112013-07-18 16:11:50 +1000251more lines of authorized_keys output (see AUTHORIZED_KEYS in
Damien Millerf33580e2012-11-04 22:22:52 +1100252.Xr sshd 8 ) .
Damien Miller09d3e122012-10-31 08:58:58 +1100253If a key supplied by AuthorizedKeysCommand does not successfully authenticate
254and authorize the user then public key authentication continues using the usual
255.Cm AuthorizedKeysFile
256files.
257By default, no AuthorizedKeysCommand is run.
258.It Cm AuthorizedKeysCommandUser
259Specifies the user under whose account the AuthorizedKeysCommand is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100260It is recommended to use a dedicated user that has no other role on the host
261than running authorized keys commands.
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000262If
djm@openbsd.orgd663bea2014-12-11 05:25:06 +0000263.Cm AuthorizedKeysCommand
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000264is specified but
265.Cm AuthorizedKeysCommandUser
266is not, then
267.Xr sshd 8
268will refuse to start.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000269.It Cm AuthorizedKeysFile
270Specifies the file that contains the public keys that can be used
271for user authentication.
Damien Miller6018a362010-07-02 13:35:19 +1000272The format is described in the
Damien Millerfecfd112013-07-18 16:11:50 +1000273AUTHORIZED_KEYS FILE FORMAT
Damien Miller6018a362010-07-02 13:35:19 +1000274section of
275.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000276.Cm AuthorizedKeysFile
277may contain tokens of the form %T which are substituted during connection
Damien Miller5b0d63f2006-03-15 11:56:56 +1100278setup.
Damien Millerfbf486b2003-05-23 18:44:23 +1000279The following tokens are defined: %% is replaced by a literal '%',
Damien Miller5b0d63f2006-03-15 11:56:56 +1100280%h is replaced by the home directory of the user being authenticated, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000281%u is replaced by the username of that user.
282After expansion,
283.Cm AuthorizedKeysFile
284is taken to be an absolute path or one relative to the user's home
285directory.
Damien Millerb9132fc2011-05-29 21:41:40 +1000286Multiple files may be listed, separated by whitespace.
djm@openbsd.org2bca8a42015-09-11 03:13:36 +0000287Alternately this option may be set to
288.Dq none
289to skip checking for user keys in files.
Damien Millerb9132fc2011-05-29 21:41:40 +1000290The default is
291.Dq .ssh/authorized_keys .ssh/authorized_keys2 .
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000292.It Cm AuthorizedPrincipalsCommand
293Specifies a program to be used to generate the list of allowed
294certificate principals as per
295.Cm AuthorizedPrincipalsFile .
296The program must be owned by root, not writable by group or others and
297specified by an absolute path.
298.Pp
299Arguments to
300.Cm AuthorizedPrincipalsCommand
301may be provided using the following tokens, which will be expanded
302at runtime: %% is replaced by a literal '%', %u is replaced by the
303username being authenticated and %h is replaced by the home directory
304of the user being authenticated.
305.Pp
306The program should produce on standard output zero or
307more lines of
308.Cm AuthorizedPrincipalsFile
309output.
310If either
311.Cm AuthorizedPrincipalsCommand
312or
313.Cm AuthorizedPrincipalsFile
314is specified, then certificates offered by the client for authentication
315must contain a principal that is listed.
316By default, no AuthorizedPrincipalsCommand is run.
317.It Cm AuthorizedPrincipalsCommandUser
318Specifies the user under whose account the AuthorizedPrincipalsCommand is run.
319It is recommended to use a dedicated user that has no other role on the host
320than running authorized principals commands.
321If
322.Cm AuthorizedPrincipalsCommand
323is specified but
324.Cm AuthorizedPrincipalsCommandUser
325is not, then
326.Xr sshd 8
327will refuse to start.
Damien Miller30da3442010-05-10 11:58:03 +1000328.It Cm AuthorizedPrincipalsFile
329Specifies a file that lists principal names that are accepted for
330certificate authentication.
331When using certificates signed by a key listed in
332.Cm TrustedUserCAKeys ,
333this file lists names, one of which must appear in the certificate for it
334to be accepted for authentication.
Damien Millerd59dab82010-07-02 13:37:17 +1000335Names are listed one per line preceded by key options (as described
Damien Millerfecfd112013-07-18 16:11:50 +1000336in AUTHORIZED_KEYS FILE FORMAT in
Damien Millerd59dab82010-07-02 13:37:17 +1000337.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000338Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000339.Ql #
340are ignored.
341.Pp
342.Cm AuthorizedPrincipalsFile
343may contain tokens of the form %T which are substituted during connection
344setup.
345The following tokens are defined: %% is replaced by a literal '%',
346%h is replaced by the home directory of the user being authenticated, and
347%u is replaced by the username of that user.
348After expansion,
349.Cm AuthorizedPrincipalsFile
350is taken to be an absolute path or one relative to the user's home
351directory.
352.Pp
Damien Miller8fef9eb2012-04-22 11:25:10 +1000353The default is
354.Dq none ,
355i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000356of the user must appear in a certificate's principals list for it to be
357accepted.
358Note that
359.Cm AuthorizedPrincipalsFile
360is only used when authentication proceeds using a CA listed in
361.Cm TrustedUserCAKeys
362and is not consulted for certification authorities trusted via
363.Pa ~/.ssh/authorized_keys ,
364though the
365.Cm principals=
366key option offers a similar facility (see
367.Xr sshd 8
368for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000369.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000370The contents of the specified file are sent to the remote user before
371authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000372If the argument is
373.Dq none
374then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000375By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000376.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000377Specifies whether challenge-response authentication is allowed (e.g. via
Damien Millere8c9f262014-10-03 09:24:56 +1000378PAM or through authentication styles supported in
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000379.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000380The default is
381.Dq yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100382.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100383Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100384.Xr chroot 2
385to after authentication.
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000386At session startup
387.Xr sshd 8
388checks that all components of the pathname are root-owned directories
389which are not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000390After the chroot,
391.Xr sshd 8
392changes the working directory to the user's home directory.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100393.Pp
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100394The pathname may contain the following tokens that are expanded at runtime once
Damien Millerd8cb1f12008-02-10 22:40:12 +1100395the connecting user has been authenticated: %% is replaced by a literal '%',
396%h is replaced by the home directory of the user being authenticated, and
397%u is replaced by the username of that user.
398.Pp
399The
400.Cm ChrootDirectory
401must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000402user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100403For an interactive session this requires at least a shell, typically
404.Xr sh 1 ,
405and basic
406.Pa /dev
407nodes such as
408.Xr null 4 ,
409.Xr zero 4 ,
410.Xr stdin 4 ,
411.Xr stdout 4 ,
412.Xr stderr 4 ,
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000413and
Damien Millerd8cb1f12008-02-10 22:40:12 +1100414.Xr tty 4
415devices.
416For file transfer sessions using
Darren Tuckerf92077f2009-06-21 17:56:25 +1000417.Dq sftp ,
Damien Millerd8cb1f12008-02-10 22:40:12 +1100418no additional configuration of the environment is necessary if the
Darren Tuckerf92077f2009-06-21 17:56:25 +1000419in-process sftp server is used,
Damien Miller426117b2014-07-30 12:33:20 +1000420though sessions which use logging may require
Darren Tucker00fcd712009-06-21 17:56:00 +1000421.Pa /dev/log
Damien Miller426117b2014-07-30 12:33:20 +1000422inside the chroot directory on some operating systems (see
Darren Tucker00fcd712009-06-21 17:56:00 +1000423.Xr sftp-server 8
424for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100425.Pp
jmc@openbsd.orga5a3e332015-01-22 21:00:42 +0000426For safety, it is very important that the directory hierarchy be
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000427prevented from modification by other processes on the system (especially
428those outside the jail).
429Misconfiguration can lead to unsafe environments which
430.Xr sshd 8
431cannot detect.
432.Pp
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000433The default is
434.Dq none ,
435indicating not to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100436.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000437.It Cm Ciphers
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000438Specifies the ciphers allowed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000439Multiple ciphers must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000440If the specified value begins with a
441.Sq +
442character, then the specified ciphers will be appended to the default set
443instead of replacing them.
444.Pp
Damien Miller0fde8ac2013-11-21 14:12:23 +1100445The supported ciphers are:
446.Pp
Damien Millerc1621c82014-04-20 13:22:46 +1000447.Bl -item -compact -offset indent
448.It
4493des-cbc
450.It
451aes128-cbc
452.It
453aes192-cbc
454.It
455aes256-cbc
456.It
457aes128-ctr
458.It
459aes192-ctr
460.It
461aes256-ctr
462.It
463aes128-gcm@openssh.com
464.It
465aes256-gcm@openssh.com
466.It
467arcfour
468.It
469arcfour128
470.It
471arcfour256
472.It
473blowfish-cbc
474.It
475cast128-cbc
476.It
477chacha20-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
487The list of available ciphers may also be obtained using the
488.Fl Q
489option of
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000490.Xr ssh 1
491with an argument of
492.Dq cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000493.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100494Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000495sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100496.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000497receiving any messages back from the client.
498If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100499sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000500It is important to note that the use of client alive messages is very
501different from
Damien Miller12c150e2003-12-17 16:31:10 +1100502.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000503(below).
504The client alive messages are sent through the encrypted channel
505and therefore will not be spoofable.
506The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100507.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000508is spoofable.
509The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000510server depend on knowing when a connection has become inactive.
511.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000512The default value is 3.
513If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000514.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100515(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000516.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100517is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000518will be disconnected after approximately 45 seconds.
Damien Miller1594ad52005-05-26 12:12:19 +1000519.It Cm ClientAliveInterval
520Sets a timeout interval in seconds after which if no data has been received
521from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100522.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000523will send a message through the encrypted
524channel to request a response from the client.
525The default
526is 0, indicating that these messages will not be sent to the client.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000527.It Cm Compression
Damien Miller9786e6e2005-07-26 21:54:56 +1000528Specifies whether compression is allowed, or delayed until
529the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000530The argument must be
Damien Miller9786e6e2005-07-26 21:54:56 +1000531.Dq yes ,
532.Dq delayed ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000533or
534.Dq no .
535The default is
Damien Miller9786e6e2005-07-26 21:54:56 +1000536.Dq delayed .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000537.It Cm DenyGroups
538This keyword can be followed by a list of group name patterns, separated
539by spaces.
540Login is disallowed for users whose primary group or supplementary
541group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000542Only group names are valid; a numerical group ID is not recognized.
543By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100544The allow/deny directives are processed in the following order:
545.Cm DenyUsers ,
546.Cm AllowUsers ,
547.Cm DenyGroups ,
548and finally
549.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100550.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000551See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100552.Xr ssh_config 5
553for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000554.It Cm DenyUsers
555This keyword can be followed by a list of user name patterns, separated
556by spaces.
557Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000558Only user names are valid; a numerical user ID is not recognized.
559By default, login is allowed for all users.
560If the pattern takes the form USER@HOST then USER and HOST
561are separately checked, restricting logins to particular
562users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100563The allow/deny directives are processed in the following order:
564.Cm DenyUsers ,
565.Cm AllowUsers ,
566.Cm DenyGroups ,
567and finally
568.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100569.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000570See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100571.Xr ssh_config 5
572for more information on patterns.
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000573.It Cm FingerprintHash
574Specifies the hash algorithm used when logging key fingerprints.
575Valid options are:
576.Dq md5
577and
578.Dq sha256 .
579The default is
580.Dq sha256 .
Damien Millere2754432006-07-24 14:06:47 +1000581.It Cm ForceCommand
582Forces the execution of the command specified by
583.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100584ignoring any command supplied by the client and
585.Pa ~/.ssh/rc
586if present.
Damien Millere2754432006-07-24 14:06:47 +1000587The command is invoked by using the user's login shell with the -c option.
588This applies to shell, command, or subsystem execution.
589It is most useful inside a
590.Cm Match
591block.
592The command originally supplied by the client is available in the
593.Ev SSH_ORIGINAL_COMMAND
594environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100595Specifying a command of
596.Dq internal-sftp
597will force the use of an in-process sftp server that requires no support
598files when used with
599.Cm ChrootDirectory .
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000600The default is
601.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000602.It Cm GatewayPorts
603Specifies whether remote hosts are allowed to connect to ports
604forwarded for the client.
605By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100606.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000607binds remote port forwardings to the loopback address.
608This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000609.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100610can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100611should allow remote port forwardings to bind to non-loopback addresses, thus
612allowing other hosts to connect.
613The argument may be
614.Dq no
615to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000616.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100617to force remote port forwardings to bind to the wildcard address, or
618.Dq clientspecified
619to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000620The default is
621.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000622.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000623Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100624The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000625.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000626.It Cm GSSAPICleanupCredentials
627Specifies whether to automatically destroy the user's credentials cache
628on logout.
629The default is
630.Dq yes .
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000631.It Cm GSSAPIStrictAcceptorCheck
632Determines whether to be strict about the identity of the GSSAPI acceptor
633a client authenticates against.
634If set to
635.Dq yes
636then the client must authenticate against the
637.Pa host
638service on the current hostname.
639If set to
640.Dq no
641then the client may authenticate against any service key stored in the
642machine's default store.
643This facility is provided to assist with operation on multi homed machines.
644The default is
645.Dq yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000646.It Cm HostbasedAcceptedKeyTypes
647Specifies the key types that will be accepted for hostbased authentication
648as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000649Alternately if the specified value begins with a
650.Sq +
651character, then the specified key types will be appended to the default set
652instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000653The default for this option is:
654.Bd -literal -offset 3n
655ecdsa-sha2-nistp256-cert-v01@openssh.com,
656ecdsa-sha2-nistp384-cert-v01@openssh.com,
657ecdsa-sha2-nistp521-cert-v01@openssh.com,
658ssh-ed25519-cert-v01@openssh.com,
659ssh-rsa-cert-v01@openssh.com,
660ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +0000661ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000662.Ed
663.Pp
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000664The
665.Fl Q
666option of
667.Xr ssh 1
668may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000669.It Cm HostbasedAuthentication
670Specifies whether rhosts or /etc/hosts.equiv authentication together
671with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100672(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000673The default is
674.Dq no .
Damien Millerb594f382006-08-30 11:06:34 +1000675.It Cm HostbasedUsesNameFromPacketOnly
676Specifies whether or not the server will attempt to perform a reverse
677name lookup when matching the name in the
678.Pa ~/.shosts ,
679.Pa ~/.rhosts ,
680and
681.Pa /etc/hosts.equiv
682files during
683.Cm HostbasedAuthentication .
684A setting of
685.Dq yes
686means that
687.Xr sshd 8
688uses the name supplied by the client rather than
689attempting to resolve the name from the TCP connection itself.
690The default is
691.Dq no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100692.It Cm HostCertificate
693Specifies a file containing a public host certificate.
694The certificate's public key must match a private host key already specified
695by
696.Cm HostKey .
697The default behaviour of
698.Xr sshd 8
699is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000700.It Cm HostKey
701Specifies a file containing a private host key
702used by SSH.
703The default is
704.Pa /etc/ssh/ssh_host_key
705for protocol version 1, and
Damien Millereb8b60e2010-08-31 22:41:14 +1000706.Pa /etc/ssh/ssh_host_dsa_key ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100707.Pa /etc/ssh/ssh_host_ecdsa_key ,
708.Pa /etc/ssh/ssh_host_ed25519_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000709and
Damien Millereb8b60e2010-08-31 22:41:14 +1000710.Pa /etc/ssh/ssh_host_rsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000711for protocol version 2.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000712.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000713Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100714.Xr sshd 8
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000715will refuse to use a file if it is group/world-accessible
716and that the
717.Cm HostKeyAlgorithms
718option restricts which of the keys are actually used by
719.Xr sshd 8 .
720.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000721It is possible to have multiple host key files.
722.Dq rsa1
723keys are used for version 1 and
Damien Millereb8b60e2010-08-31 22:41:14 +1000724.Dq dsa ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100725.Dq ecdsa ,
726.Dq ed25519
Ben Lindstrom9f049032002-06-21 00:59:05 +0000727or
728.Dq rsa
729are used for version 2 of the SSH protocol.
Damien Miller85b45e02013-07-20 13:21:52 +1000730It is also possible to specify public host key files instead.
731In this case operations on the private key will be delegated
732to an
733.Xr ssh-agent 1 .
734.It Cm HostKeyAgent
735Identifies the UNIX-domain socket used to communicate
736with an agent that has access to the private host keys.
737If
738.Dq SSH_AUTH_SOCK
739is specified, the location of the socket will be read from the
740.Ev SSH_AUTH_SOCK
741environment variable.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000742.It Cm HostKeyAlgorithms
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000743Specifies the host key algorithms
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000744that the server offers.
745The default for this option is:
746.Bd -literal -offset 3n
747ecdsa-sha2-nistp256-cert-v01@openssh.com,
748ecdsa-sha2-nistp384-cert-v01@openssh.com,
749ecdsa-sha2-nistp521-cert-v01@openssh.com,
750ssh-ed25519-cert-v01@openssh.com,
751ssh-rsa-cert-v01@openssh.com,
752ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +0000753ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000754.Ed
755.Pp
756The list of available key types may also be obtained using the
757.Fl Q
758option of
759.Xr ssh 1
760with an argument of
761.Dq key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000762.It Cm IgnoreRhosts
763Specifies that
764.Pa .rhosts
765and
766.Pa .shosts
767files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000768.Cm RhostsRSAAuthentication
769or
770.Cm HostbasedAuthentication .
771.Pp
772.Pa /etc/hosts.equiv
773and
774.Pa /etc/shosts.equiv
775are still used.
776The default is
777.Dq yes .
778.It Cm IgnoreUserKnownHosts
779Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100780.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000781should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000782.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000783during
784.Cm RhostsRSAAuthentication
785or
786.Cm HostbasedAuthentication .
787The default is
788.Dq no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100789.It Cm IPQoS
790Specifies the IPv4 type-of-service or DSCP class for the connection.
791Accepted values are
792.Dq af11 ,
793.Dq af12 ,
794.Dq af13 ,
Damien Millerf6e758c2011-09-22 21:37:13 +1000795.Dq af21 ,
Damien Miller0dac6fb2010-11-20 15:19:38 +1100796.Dq af22 ,
797.Dq af23 ,
798.Dq af31 ,
799.Dq af32 ,
800.Dq af33 ,
801.Dq af41 ,
802.Dq af42 ,
803.Dq af43 ,
804.Dq cs0 ,
805.Dq cs1 ,
806.Dq cs2 ,
807.Dq cs3 ,
808.Dq cs4 ,
809.Dq cs5 ,
810.Dq cs6 ,
811.Dq cs7 ,
812.Dq ef ,
813.Dq lowdelay ,
814.Dq throughput ,
815.Dq reliability ,
816or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +1100817This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100818If one argument is specified, it is used as the packet class unconditionally.
819If two values are specified, the first is automatically selected for
820interactive sessions and the second for non-interactive sessions.
821The default is
822.Dq lowdelay
823for interactive sessions and
824.Dq throughput
825for non-interactive sessions.
Damien Millere1e480a2014-02-04 11:13:17 +1100826.It Cm KbdInteractiveAuthentication
827Specifies whether to allow keyboard-interactive authentication.
828The argument to this keyword must be
829.Dq yes
830or
831.Dq no .
832The default is to use whatever value
833.Cm ChallengeResponseAuthentication
834is set to
835(by default
836.Dq yes ) .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000837.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000838Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000839.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000840will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000841To use this option, the server needs a
842Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100843The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000844.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100845.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000846If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100847an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100848The default is
Damien Miller8448e662004-03-08 23:13:15 +1100849.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000850.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100851If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000852the password will be validated via any additional local mechanism
853such as
854.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100855The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000856.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000857.It Cm KerberosTicketCleanup
858Specifies whether to automatically destroy the user's ticket cache
859file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100860The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000861.Dq yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000862.It Cm KexAlgorithms
863Specifies the available KEX (Key Exchange) algorithms.
864Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000865Alternately if the specified value begins with a
866.Sq +
867character, then the specified methods will be appended to the default set
868instead of replacing them.
Damien Millerc1621c82014-04-20 13:22:46 +1000869The supported algorithms are:
870.Pp
871.Bl -item -compact -offset indent
872.It
873curve25519-sha256@libssh.org
874.It
875diffie-hellman-group1-sha1
876.It
877diffie-hellman-group14-sha1
878.It
879diffie-hellman-group-exchange-sha1
880.It
881diffie-hellman-group-exchange-sha256
882.It
883ecdh-sha2-nistp256
884.It
885ecdh-sha2-nistp384
886.It
887ecdh-sha2-nistp521
888.El
889.Pp
890The default is:
Damien Miller6575c3a2013-12-18 17:47:02 +1100891.Bd -literal -offset indent
892curve25519-sha256@libssh.org,
893ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
894diffie-hellman-group-exchange-sha256,
Damien Millerc1621c82014-04-20 13:22:46 +1000895diffie-hellman-group14-sha1
Damien Miller6575c3a2013-12-18 17:47:02 +1100896.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000897.Pp
898The list of available key exchange algorithms may also be obtained using the
899.Fl Q
900option of
901.Xr ssh 1
902with an argument of
903.Dq kex .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000904.It Cm KeyRegenerationInterval
905In protocol version 1, the ephemeral server key is automatically regenerated
906after this many seconds (if it has been used).
907The purpose of regeneration is to prevent
908decrypting captured sessions by later breaking into the machine and
909stealing the keys.
910The key is never stored anywhere.
911If the value is 0, the key is never regenerated.
912The default is 3600 (seconds).
913.It Cm ListenAddress
914Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100915.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000916should listen on.
917The following forms may be used:
918.Pp
919.Bl -item -offset indent -compact
920.It
921.Cm ListenAddress
922.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000923.Ar host | Ar IPv4_addr | Ar IPv6_addr
Ben Lindstrom9f049032002-06-21 00:59:05 +0000924.Sm on
925.It
926.Cm ListenAddress
927.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000928.Ar host | Ar IPv4_addr : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000929.Sm on
930.It
931.Cm ListenAddress
932.Sm off
933.Oo
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000934.Ar host | Ar IPv6_addr Oc : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000935.Sm on
936.El
937.Pp
938If
939.Ar port
940is not specified,
dtucker@openbsd.org531a57a2015-04-29 03:48:56 +0000941sshd will listen on the address and all
Ben Lindstrom9f049032002-06-21 00:59:05 +0000942.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000943options specified.
944The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000945Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000946.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000947options are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000948.It Cm LoginGraceTime
949The server disconnects after this time if the user has not
950successfully logged in.
951If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000952The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000953.It Cm LogLevel
954Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100955.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000956The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100957QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000958The default is INFO.
959DEBUG and DEBUG1 are equivalent.
960DEBUG2 and DEBUG3 each specify higher levels of debugging output.
961Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000962.It Cm MACs
963Specifies the available MAC (message authentication code) algorithms.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000964The MAC algorithm is used for data integrity protection.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000965Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000966If the specified value begins with a
967.Sq +
968character, then the specified algorithms will be appended to the default set
969instead of replacing them.
970.Pp
Damien Milleraf43a7a2012-12-12 10:46:31 +1100971The algorithms that contain
972.Dq -etm
973calculate the MAC after encryption (encrypt-then-mac).
974These are considered safer and their use recommended.
Damien Millerc1621c82014-04-20 13:22:46 +1000975The supported MACs are:
976.Pp
977.Bl -item -compact -offset indent
978.It
979hmac-md5
980.It
981hmac-md5-96
982.It
983hmac-ripemd160
984.It
985hmac-sha1
986.It
987hmac-sha1-96
988.It
989hmac-sha2-256
990.It
991hmac-sha2-512
992.It
993umac-64@openssh.com
994.It
995umac-128@openssh.com
996.It
997hmac-md5-etm@openssh.com
998.It
999hmac-md5-96-etm@openssh.com
1000.It
1001hmac-ripemd160-etm@openssh.com
1002.It
1003hmac-sha1-etm@openssh.com
1004.It
1005hmac-sha1-96-etm@openssh.com
1006.It
1007hmac-sha2-256-etm@openssh.com
1008.It
1009hmac-sha2-512-etm@openssh.com
1010.It
1011umac-64-etm@openssh.com
1012.It
1013umac-128-etm@openssh.com
1014.El
1015.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +11001016The default is:
Damien Miller22b7b492007-06-11 14:07:12 +10001017.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +11001018umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1019hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001020hmac-sha1-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +10001021umac-64@openssh.com,umac-128@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001022hmac-sha2-256,hmac-sha2-512,hmac-sha1
Damien Miller22b7b492007-06-11 14:07:12 +10001023.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001024.Pp
1025The list of available MAC algorithms may also be obtained using the
1026.Fl Q
1027option of
1028.Xr ssh 1
1029with an argument of
1030.Dq mac .
Darren Tucker45150472006-07-12 22:34:17 +10001031.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +10001032Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +10001033If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +10001034.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001035line are satisfied, the keywords on the following lines override those
1036set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +10001037.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001038line or the end of the file.
Damien Millerfc5d6752014-02-28 10:01:28 +11001039If a keyword appears in multiple
1040.Cm Match
sobrado@openbsd.org180bcb42014-08-30 16:32:25 +00001041blocks that are satisfied, only the first instance of the keyword is
Damien Millerfc5d6752014-02-28 10:01:28 +11001042applied.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001043.Pp
Damien Millerd04f3572006-07-24 13:46:50 +10001044The arguments to
Darren Tucker45150472006-07-12 22:34:17 +10001045.Cm Match
Damien Millercf31f382013-10-24 21:02:56 +11001046are one or more criteria-pattern pairs or the single token
1047.Cm All
1048which matches all criteria.
Darren Tucker45150472006-07-12 22:34:17 +10001049The available criteria are
1050.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +10001051.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +10001052.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +10001053.Cm LocalAddress ,
1054.Cm LocalPort ,
Darren Tucker45150472006-07-12 22:34:17 +10001055and
1056.Cm Address .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001057The match patterns may consist of single entries or comma-separated
1058lists and may use the wildcard and negation operators described in the
Damien Millerfecfd112013-07-18 16:11:50 +10001059PATTERNS section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +10001060.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001061.Pp
1062The patterns in an
1063.Cm Address
1064criteria may additionally contain addresses to match in CIDR
Darren Tucker6a2a4002008-06-10 23:03:04 +10001065address/masklen format, e.g.\&
Darren Tucker7a3935d2008-06-10 22:59:10 +10001066.Dq 192.0.2.0/24
1067or
1068.Dq 3ffe:ffff::/32 .
1069Note that the mask length provided must be consistent with the address -
1070it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +10001071or one with bits set in this host portion of the address.
1072For example,
Darren Tucker7a3935d2008-06-10 22:59:10 +10001073.Dq 192.0.2.0/33
1074and
Darren Tucker6a2a4002008-06-10 23:03:04 +10001075.Dq 192.0.2.0/8
Darren Tucker7a3935d2008-06-10 22:59:10 +10001076respectively.
1077.Pp
Darren Tucker45150472006-07-12 22:34:17 +10001078Only a subset of keywords may be used on the lines following a
1079.Cm Match
1080keyword.
1081Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +10001082.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +11001083.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +10001084.Cm AllowGroups ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001085.Cm AllowStreamLocalForwarding ,
Damien Miller9b439df2006-07-24 14:04:00 +10001086.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +10001087.Cm AllowUsers ,
Damien Millera6e3f012012-11-04 23:21:40 +11001088.Cm AuthenticationMethods ,
Damien Miller09d3e122012-10-31 08:58:58 +11001089.Cm AuthorizedKeysCommand ,
1090.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +11001091.Cm AuthorizedKeysFile ,
djm@openbsd.orgb6b91082015-11-13 02:57:46 +00001092.Cm AuthorizedPrincipalsCommand ,
1093.Cm AuthorizedPrincipalsCommandUser ,
Damien Millerab6de352010-06-26 09:38:45 +10001094.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +11001095.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +10001096.Cm ChrootDirectory ,
Damien Millerc24da772012-06-20 21:53:58 +10001097.Cm DenyGroups ,
1098.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +10001099.Cm ForceCommand ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001100.Cm GatewayPorts ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +00001101.Cm GSSAPIAuthentication ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001102.Cm HostbasedAcceptedKeyTypes ,
Damien Miller25434de2008-05-19 14:29:08 +10001103.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +10001104.Cm HostbasedUsesNameFromPacketOnly ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001105.Cm IPQoS ,
Darren Tucker1d75f222007-03-01 21:31:28 +11001106.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +11001107.Cm KerberosAuthentication ,
Damien Miller307c1d12008-06-16 07:56:20 +10001108.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +10001109.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +11001110.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +11001111.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +10001112.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +11001113.Cm PermitRootLogin ,
Damien Miller5ff30c62013-10-30 22:21:50 +11001114.Cm PermitTTY ,
Damien Millerab6de352010-06-26 09:38:45 +10001115.Cm PermitTunnel ,
Damien Miller72e6b5c2014-07-04 09:00:04 +10001116.Cm PermitUserRC ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001117.Cm PubkeyAcceptedKeyTypes ,
Darren Tucker1477ea12009-10-07 08:36:05 +11001118.Cm PubkeyAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001119.Cm RekeyLimit ,
1120.Cm RevokedKeys ,
1121.Cm RhostsRSAAuthentication ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +00001122.Cm RSAAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001123.Cm StreamLocalBindMask ,
1124.Cm StreamLocalBindUnlink ,
1125.Cm TrustedUserCAKeys ,
Damien Millerd1de9952006-07-24 14:05:48 +10001126.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +11001127.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +10001128and
Damien Miller0296ae82009-02-23 11:00:24 +11001129.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +10001130.It Cm MaxAuthTries
1131Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +10001132connection.
1133Once the number of failures reaches half this value,
1134additional failures are logged.
1135The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +10001136.It Cm MaxSessions
djm@openbsd.orgcac3b662016-02-05 02:37:56 +00001137Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1138sessions permitted per network connection.
1139Multiple sessions may be established by clients that support connection
1140multiplexing.
1141Setting
1142.Cm MaxSessions
1143to 1 will effectively disable session multiplexing, whereas setting it to 0
1144will prevent all shell, login and subsystem sessions while still permitting
1145forwarding.
Damien Miller7207f642008-05-19 15:34:50 +10001146The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001147.It Cm MaxStartups
1148Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001149SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001150Additional connections will be dropped until authentication succeeds or the
1151.Cm LoginGraceTime
1152expires for a connection.
Damien Miller1f583df2013-02-12 11:02:08 +11001153The default is 10:30:100.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001154.Pp
1155Alternatively, random early drop can be enabled by specifying
1156the three colon separated values
1157.Dq start:rate:full
Damien Miller208f1ed2006-03-15 11:56:03 +11001158(e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +11001159.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001160will refuse connection attempts with a probability of
1161.Dq rate/100
1162(30%)
1163if there are currently
1164.Dq start
1165(10)
1166unauthenticated connections.
1167The probability increases linearly and all connection attempts
1168are refused if the number of unauthenticated connections reaches
1169.Dq full
1170(60).
1171.It Cm PasswordAuthentication
1172Specifies whether password authentication is allowed.
1173The default is
1174.Dq yes .
1175.It Cm PermitEmptyPasswords
1176When password authentication is allowed, it specifies whether the
1177server allows login to accounts with empty password strings.
1178The default is
1179.Dq no .
Damien Miller9b439df2006-07-24 14:04:00 +10001180.It Cm PermitOpen
1181Specifies the destinations to which TCP port forwarding is permitted.
1182The forwarding specification must be one of the following forms:
1183.Pp
1184.Bl -item -offset indent -compact
1185.It
1186.Cm PermitOpen
1187.Sm off
1188.Ar host : port
1189.Sm on
1190.It
1191.Cm PermitOpen
1192.Sm off
1193.Ar IPv4_addr : port
1194.Sm on
1195.It
1196.Cm PermitOpen
1197.Sm off
1198.Ar \&[ IPv6_addr \&] : port
1199.Sm on
1200.El
1201.Pp
Damien Millera765cf42006-07-24 14:08:13 +10001202Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +10001203An argument of
1204.Dq any
1205can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +10001206An argument of
1207.Dq none
1208can be used to prohibit all forwarding requests.
Damien Miller65bc2c42006-07-24 14:04:16 +10001209By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001210.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +11001211Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +00001212.Xr ssh 1 .
1213The argument must be
1214.Dq yes ,
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001215.Dq prohibit-password ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001216.Dq without-password ,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001217.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001218or
1219.Dq no .
1220The default is
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001221.Dq prohibit-password .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001222.Pp
1223If this option is set to
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001224.Dq prohibit-password
1225or
Damien Miller5b0d63f2006-03-15 11:56:56 +11001226.Dq without-password ,
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001227password and keyboard-interactive authentication are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001228.Pp
1229If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001230.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001231root login with public key authentication will be allowed,
1232but only if the
1233.Ar command
1234option has been specified
1235(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +10001236normally not allowed).
1237All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001238.Pp
1239If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001240.Dq no ,
Darren Tuckerb3509012005-01-20 11:01:46 +11001241root is not allowed to log in.
Damien Millerd27b9472005-12-13 19:29:02 +11001242.It Cm PermitTunnel
1243Specifies whether
1244.Xr tun 4
1245device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +11001246The argument must be
1247.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +10001248.Dq point-to-point
1249(layer 3),
1250.Dq ethernet
1251(layer 2), or
Damien Miller7b58e802005-12-13 19:33:19 +11001252.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +10001253Specifying
1254.Dq yes
1255permits both
1256.Dq point-to-point
1257and
1258.Dq ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +11001259The default is
1260.Dq no .
djm@openbsd.org48dffd52014-09-09 09:45:36 +00001261.Pp
1262Independent of this setting, the permissions of the selected
1263.Xr tun 4
1264device must allow access to the user.
Damien Miller5ff30c62013-10-30 22:21:50 +11001265.It Cm PermitTTY
1266Specifies whether
Damien Miller63857c92013-10-30 22:31:06 +11001267.Xr pty 4
Damien Miller5ff30c62013-10-30 22:21:50 +11001268allocation is permitted.
1269The default is
1270.Dq yes .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001271.It Cm PermitUserEnvironment
1272Specifies whether
1273.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001274and
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001275.Cm environment=
1276options in
1277.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001278are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +11001279.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001280The default is
1281.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001282Enabling environment processing may enable users to bypass access
1283restrictions in some configurations using mechanisms such as
1284.Ev LD_PRELOAD .
Damien Miller72e6b5c2014-07-04 09:00:04 +10001285.It Cm PermitUserRC
1286Specifies whether any
1287.Pa ~/.ssh/rc
1288file is executed.
1289The default is
1290.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001291.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +00001292Specifies the file that contains the process ID of the
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001293SSH daemon, or
1294.Dq none
1295to not write one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001296The default is
1297.Pa /var/run/sshd.pid .
1298.It Cm Port
1299Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +11001300.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001301listens on.
1302The default is 22.
1303Multiple options of this type are permitted.
1304See also
1305.Cm ListenAddress .
1306.It Cm PrintLastLog
1307Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001308.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +11001309should print the date and time of the last user login when a user logs
1310in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001311The default is
1312.Dq yes .
1313.It Cm PrintMotd
1314Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001315.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001316should print
1317.Pa /etc/motd
1318when a user logs in interactively.
1319(On some systems it is also printed by the shell,
1320.Pa /etc/profile ,
1321or equivalent.)
1322The default is
1323.Dq yes .
1324.It Cm Protocol
1325Specifies the protocol versions
Damien Miller5b0d63f2006-03-15 11:56:56 +11001326.Xr sshd 8
Ben Lindstrom9c445542002-07-11 03:59:18 +00001327supports.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001328The possible values are
Damien Miller5b0d63f2006-03-15 11:56:56 +11001329.Sq 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001330and
Damien Miller5b0d63f2006-03-15 11:56:56 +11001331.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001332Multiple versions must be comma-separated.
1333The default is
Darren Tucker7a4a7652009-10-11 21:51:40 +11001334.Sq 2 .
djm@openbsd.orge7901ef2016-02-16 05:11:04 +00001335Protocol 1 suffers from a number of cryptographic weaknesses and should
1336not be used.
1337It is only offered to support legacy devices.
1338.Pp
Ben Lindstrom9c445542002-07-11 03:59:18 +00001339Note that the order of the protocol list does not indicate preference,
1340because the client selects among multiple protocol versions offered
1341by the server.
1342Specifying
1343.Dq 2,1
1344is identical to
1345.Dq 1,2 .
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001346.It Cm PubkeyAcceptedKeyTypes
1347Specifies the key types that will be accepted for public key authentication
1348as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001349Alternately if the specified value begins with a
1350.Sq +
1351character, then the specified key types will be appended to the default set
1352instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001353The default for this option is:
1354.Bd -literal -offset 3n
1355ecdsa-sha2-nistp256-cert-v01@openssh.com,
1356ecdsa-sha2-nistp384-cert-v01@openssh.com,
1357ecdsa-sha2-nistp521-cert-v01@openssh.com,
1358ssh-ed25519-cert-v01@openssh.com,
1359ssh-rsa-cert-v01@openssh.com,
1360ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001361ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001362.Ed
1363.Pp
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001364The
1365.Fl Q
1366option of
1367.Xr ssh 1
1368may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001369.It Cm PubkeyAuthentication
1370Specifies whether public key authentication is allowed.
1371The default is
1372.Dq yes .
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001373.It Cm RekeyLimit
1374Specifies the maximum amount of data that may be transmitted before the
1375session key is renegotiated, optionally followed a maximum amount of
1376time that may pass before the session key is renegotiated.
1377The first argument is specified in bytes and may have a suffix of
1378.Sq K ,
1379.Sq M ,
1380or
1381.Sq G
1382to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1383The default is between
1384.Sq 1G
1385and
1386.Sq 4G ,
1387depending on the cipher.
1388The optional second value is specified in seconds and may use any of the
1389units documented in the
1390.Sx TIME FORMATS
Darren Tucker64d22942013-05-16 20:31:29 +10001391section.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001392The default value for
1393.Cm RekeyLimit
1394is
1395.Dq default none ,
1396which means that rekeying is performed after the cipher's default amount
1397of data has been sent or received and no time based rekeying is done.
Damien Miller1aed65e2010-03-04 21:53:35 +11001398.It Cm RevokedKeys
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001399Specifies revoked public keys file, or
1400.Dq none
1401to not use one.
Damien Miller1aed65e2010-03-04 21:53:35 +11001402Keys listed in this file will be refused for public key authentication.
1403Note that if this file is not readable, then public key authentication will
1404be refused for all users.
Damien Millerf3747bf2013-01-18 11:44:04 +11001405Keys may be specified as a text file, listing one public key per line, or as
1406an OpenSSH Key Revocation List (KRL) as generated by
Damien Miller72abeb72013-01-20 22:33:44 +11001407.Xr ssh-keygen 1 .
Damien Millerfecfd112013-07-18 16:11:50 +10001408For more information on KRLs, see the KEY REVOCATION LISTS section in
Damien Millerf3747bf2013-01-18 11:44:04 +11001409.Xr ssh-keygen 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001410.It Cm RhostsRSAAuthentication
1411Specifies whether rhosts or /etc/hosts.equiv authentication together
1412with successful RSA host authentication is allowed.
1413The default is
1414.Dq no .
1415This option applies to protocol version 1 only.
1416.It Cm RSAAuthentication
1417Specifies whether pure RSA authentication is allowed.
1418The default is
1419.Dq yes .
1420This option applies to protocol version 1 only.
1421.It Cm ServerKeyBits
1422Defines the number of bits in the ephemeral protocol version 1 server key.
djm@openbsd.org933935c2015-07-03 03:49:45 +00001423The default and minimum value is 1024.
Damien Miller7acefbb2014-07-18 14:11:24 +10001424.It Cm StreamLocalBindMask
1425Sets the octal file creation mode mask
1426.Pq umask
1427used when creating a Unix-domain socket file for local or remote
1428port forwarding.
1429This option is only used for port forwarding to a Unix-domain socket file.
1430.Pp
1431The default value is 0177, which creates a Unix-domain socket file that is
1432readable and writable only by the owner.
1433Note that not all operating systems honor the file mode on Unix-domain
1434socket files.
1435.It Cm StreamLocalBindUnlink
1436Specifies whether to remove an existing Unix-domain socket file for local
1437or remote port forwarding before creating a new one.
1438If the socket file already exists and
1439.Cm StreamLocalBindUnlink
1440is not enabled,
1441.Nm sshd
1442will be unable to forward the port to the Unix-domain socket file.
1443This option is only used for port forwarding to a Unix-domain socket file.
1444.Pp
1445The argument must be
1446.Dq yes
1447or
1448.Dq no .
1449The default is
1450.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001451.It Cm StrictModes
1452Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001453.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001454should check file modes and ownership of the
1455user's files and home directory before accepting login.
1456This is normally desirable because novices sometimes accidentally leave their
1457directory or files world-writable.
1458The default is
1459.Dq yes .
Darren Tuckerf788a912010-01-08 17:06:47 +11001460Note that this does not apply to
1461.Cm ChrootDirectory ,
1462whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001463.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +11001464Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +10001465Arguments should be a subsystem name and a command (with optional arguments)
1466to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001467.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001468The command
1469.Xr sftp-server 8
1470implements the
1471.Dq sftp
1472file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001473.Pp
1474Alternately the name
1475.Dq internal-sftp
1476implements an in-process
1477.Dq sftp
1478server.
1479This may simplify configurations using
1480.Cm ChrootDirectory
1481to force a different filesystem root on clients.
1482.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001483By default no subsystems are defined.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001484.It Cm SyslogFacility
1485Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001486.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001487The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1488LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1489The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001490.It Cm TCPKeepAlive
1491Specifies whether the system should send TCP keepalive messages to the
1492other side.
1493If they are sent, death of the connection or crash of one
1494of the machines will be properly noticed.
1495However, this means that
1496connections will die if the route is down temporarily, and some people
1497find it annoying.
1498On the other hand, if TCP keepalives are not sent,
1499sessions may hang indefinitely on the server, leaving
1500.Dq ghost
1501users and consuming server resources.
1502.Pp
1503The default is
1504.Dq yes
1505(to send TCP keepalive messages), and the server will notice
1506if the network goes down or the client host crashes.
1507This avoids infinitely hanging sessions.
1508.Pp
1509To disable TCP keepalive messages, the value should be set to
1510.Dq no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001511.It Cm TrustedUserCAKeys
1512Specifies a file containing public keys of certificate authorities that are
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001513trusted to sign user certificates for authentication, or
1514.Dq none
1515to not use one.
Damien Miller72b33822010-03-05 07:39:01 +11001516Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001517.Ql #
1518are allowed.
1519If a certificate is presented for authentication and has its signing CA key
1520listed in this file, then it may be used for authentication for any user
1521listed in the certificate's principals list.
1522Note that certificates that lack a list of principals will not be permitted
1523for authentication using
1524.Cm TrustedUserCAKeys .
Damien Millerfecfd112013-07-18 16:11:50 +10001525For more details on certificates, see the CERTIFICATES section in
Damien Miller1aed65e2010-03-04 21:53:35 +11001526.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001527.It Cm UseDNS
1528Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001529.Xr sshd 8
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001530should look up the remote host name, and to check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001531the resolved host name for the remote IP address maps back to the
1532very same IP address.
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001533.Pp
1534If this option is set to
1535.Dq no
1536(the default) then only addresses and not host names may be used in
1537.Pa ~/.ssh/known_hosts
1538.Cm from
1539and
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +00001540.Nm
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001541.Cm Match
1542.Cm Host
1543directives.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001544.It Cm UseLogin
1545Specifies whether
1546.Xr login 1
1547is used for interactive login sessions.
1548The default is
1549.Dq no .
1550Note that
1551.Xr login 1
1552is never used for remote command execution.
1553Note also, that if this is enabled,
1554.Cm X11Forwarding
1555will be disabled because
1556.Xr login 1
1557does not know how to handle
1558.Xr xauth 1
Damien Miller495dca32003-04-01 21:42:14 +10001559cookies.
1560If
Ben Lindstrom9f049032002-06-21 00:59:05 +00001561.Cm UsePrivilegeSeparation
1562is specified, it will be disabled after authentication.
Damien Miller2e193e22003-05-14 15:13:03 +10001563.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001564Enables the Pluggable Authentication Module interface.
1565If set to
1566.Dq yes
1567this will enable PAM authentication using
1568.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001569and
1570.Cm PasswordAuthentication
1571in addition to PAM account and session module processing for all
1572authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001573.Pp
1574Because PAM challenge-response authentication usually serves an equivalent
1575role to password authentication, you should disable either
1576.Cm PasswordAuthentication
1577or
1578.Cm ChallengeResponseAuthentication.
1579.Pp
1580If
1581.Cm UsePAM
1582is enabled, you will not be able to run
1583.Xr sshd 8
1584as a non-root user.
1585The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +10001586.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001587.It Cm UsePrivilegeSeparation
1588Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001589.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001590separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +10001591to deal with incoming network traffic.
1592After successful authentication, another process will be created that has
1593the privilege of the authenticated user.
1594The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +00001595escalation by containing any corruption within the unprivileged processes.
sobrado@openbsd.orgbdcb73f2015-10-07 14:45:30 +00001596The argument must be
1597.Dq yes ,
1598.Dq no ,
1599or
1600.Dq sandbox .
Damien Miller69ff1df2011-06-23 08:30:03 +10001601If
1602.Cm UsePrivilegeSeparation
1603is set to
1604.Dq sandbox
1605then the pre-authentication unprivileged process is subject to additional
1606restrictions.
sobrado@openbsd.orgbdcb73f2015-10-07 14:45:30 +00001607The default is
1608.Dq sandbox .
Damien Miller23528812012-04-22 11:24:43 +10001609.It Cm VersionAddendum
1610Optionally specifies additional text to append to the SSH protocol banner
1611sent by the server upon connection.
1612The default is
1613.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001614.It Cm X11DisplayOffset
1615Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001616.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001617X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001618This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001619The default is 10.
1620.It Cm X11Forwarding
1621Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001622The argument must be
1623.Dq yes
1624or
1625.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001626The default is
1627.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +10001628.Pp
1629When X11 forwarding is enabled, there may be additional exposure to
1630the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001631.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001632proxy display is configured to listen on the wildcard address (see
1633.Cm X11UseLocalhost
Damien Miller5b0d63f2006-03-15 11:56:56 +11001634below), though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001635Additionally, the authentication spoofing and authentication data
1636verification and substitution occur on the client side.
1637The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001638display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001639forwarding (see the warnings for
1640.Cm ForwardX11
1641in
Damien Millerf1ce5052003-06-11 22:04:39 +10001642.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001643A system administrator may have a stance in which they want to
1644protect clients that may expose themselves to attack by unwittingly
1645requesting X11 forwarding, which can warrant a
1646.Dq no
1647setting.
1648.Pp
1649Note that disabling X11 forwarding does not prevent users from
1650forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001651X11 forwarding is automatically disabled if
1652.Cm UseLogin
1653is enabled.
1654.It Cm X11UseLocalhost
1655Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001656.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001657should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001658the wildcard address.
1659By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001660sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001661hostname part of the
1662.Ev DISPLAY
1663environment variable to
1664.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001665This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001666However, some older X11 clients may not function with this
1667configuration.
1668.Cm X11UseLocalhost
1669may be set to
1670.Dq no
1671to specify that the forwarding server should be bound to the wildcard
1672address.
1673The argument must be
1674.Dq yes
1675or
1676.Dq no .
1677The default is
1678.Dq yes .
1679.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001680Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001681.Xr xauth 1
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001682program, or
1683.Dq none
1684to not use one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001685The default is
1686.Pa /usr/X11R6/bin/xauth .
1687.El
Damien Millere3beba22006-03-15 11:59:25 +11001688.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001689.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001690command-line arguments and configuration file options that specify time
1691may be expressed using a sequence of the form:
1692.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001693.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001694.Sm on
1695where
1696.Ar time
1697is a positive integer value and
1698.Ar qualifier
1699is one of the following:
1700.Pp
1701.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001702.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001703seconds
1704.It Cm s | Cm S
1705seconds
1706.It Cm m | Cm M
1707minutes
1708.It Cm h | Cm H
1709hours
1710.It Cm d | Cm D
1711days
1712.It Cm w | Cm W
1713weeks
1714.El
1715.Pp
1716Each member of the sequence is added together to calculate
1717the total time value.
1718.Pp
1719Time format examples:
1720.Pp
1721.Bl -tag -width Ds -compact -offset indent
1722.It 600
1723600 seconds (10 minutes)
1724.It 10m
172510 minutes
1726.It 1h30m
17271 hour 30 minutes (90 minutes)
1728.El
1729.Sh FILES
1730.Bl -tag -width Ds
1731.It Pa /etc/ssh/sshd_config
1732Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001733.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001734This file should be writable by root only, but it is recommended
1735(though not necessary) that it be world-readable.
1736.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001737.Sh SEE ALSO
1738.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001739.Sh AUTHORS
1740OpenSSH is a derivative of the original and free
1741ssh 1.2.12 release by Tatu Ylonen.
1742Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1743Theo de Raadt and Dug Song
1744removed many bugs, re-added newer features and
1745created OpenSSH.
1746Markus Friedl contributed the support for SSH
1747protocol versions 1.5 and 2.0.
1748Niels Provos and Markus Friedl contributed support
1749for privilege separation.