blob: 6c30f7084efaa329d0ed28aee2a848983c779b46 [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.\"
djm@openbsd.org16277fc2016-09-22 17:55:13 +000036.\" $OpenBSD: sshd_config.5,v 1.234 2016/09/22 17:55:13 djm Exp $
37.Dd $Mdocdate: September 22 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.
Damien Miller7acefbb2014-07-18 14:11:24 +1000126.It Cm AllowStreamLocalForwarding
127Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
128The available options are
129.Dq yes
130or
131.Dq all
132to allow StreamLocal forwarding,
133.Dq no
134to prevent all StreamLocal forwarding,
135.Dq local
136to allow local (from the perspective of
137.Xr ssh 1 )
138forwarding only or
139.Dq remote
140to allow remote forwarding only.
141The default is
142.Dq yes .
143Note that disabling StreamLocal forwarding does not improve security unless
144users are also denied shell access, as they can always install their
145own forwarders.
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000146.It Cm AllowTcpForwarding
147Specifies whether TCP forwarding is permitted.
148The available options are
149.Dq yes
150or
151.Dq all
152to allow TCP forwarding,
153.Dq no
154to prevent all TCP 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 TCP 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
djm@openbsd.orge7907c12016-09-14 05:42:25 +0000307at runtime:
308%% is replaced by a literal '%',
djm@openbsd.orge7907c12016-09-14 05:42:25 +0000309%F with the fingerprint of the CA key,
djm@openbsd.orgbfa9d962016-09-21 01:34:45 +0000310%f is replaced with certificate fingerprint,
djm@openbsd.orge7907c12016-09-14 05:42:25 +0000311%K is replaced with the base-64 encoded CA key.
djm@openbsd.orgbfa9d962016-09-21 01:34:45 +0000312%k is replaced with the full base-64 encoded certificate,
313%h is replaced with the home directory of the user being authenticated,
314%i is replaced with key ID in the certificate,
315%s is replaced with the serial number of the certificate,
316%T with the type of the CA key,
317%t is replaced with type of the certificate being offered, and
318%u is replaced by the username being authenticated,
djm@openbsd.orge7907c12016-09-14 05:42:25 +0000319If no arguments are specified then the username of the target user
320will be supplied.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000321.Pp
322The program should produce on standard output zero or
323more lines of
324.Cm AuthorizedPrincipalsFile
325output.
326If either
327.Cm AuthorizedPrincipalsCommand
328or
329.Cm AuthorizedPrincipalsFile
330is specified, then certificates offered by the client for authentication
331must contain a principal that is listed.
332By default, no AuthorizedPrincipalsCommand is run.
333.It Cm AuthorizedPrincipalsCommandUser
334Specifies the user under whose account the AuthorizedPrincipalsCommand is run.
335It is recommended to use a dedicated user that has no other role on the host
336than running authorized principals commands.
337If
338.Cm AuthorizedPrincipalsCommand
339is specified but
340.Cm AuthorizedPrincipalsCommandUser
341is not, then
342.Xr sshd 8
343will refuse to start.
Damien Miller30da3442010-05-10 11:58:03 +1000344.It Cm AuthorizedPrincipalsFile
345Specifies a file that lists principal names that are accepted for
346certificate authentication.
347When using certificates signed by a key listed in
348.Cm TrustedUserCAKeys ,
349this file lists names, one of which must appear in the certificate for it
350to be accepted for authentication.
Damien Millerd59dab82010-07-02 13:37:17 +1000351Names are listed one per line preceded by key options (as described
Damien Millerfecfd112013-07-18 16:11:50 +1000352in AUTHORIZED_KEYS FILE FORMAT in
Damien Millerd59dab82010-07-02 13:37:17 +1000353.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000354Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000355.Ql #
356are ignored.
357.Pp
358.Cm AuthorizedPrincipalsFile
359may contain tokens of the form %T which are substituted during connection
360setup.
361The following tokens are defined: %% is replaced by a literal '%',
362%h is replaced by the home directory of the user being authenticated, and
363%u is replaced by the username of that user.
364After expansion,
365.Cm AuthorizedPrincipalsFile
366is taken to be an absolute path or one relative to the user's home
367directory.
368.Pp
Damien Miller8fef9eb2012-04-22 11:25:10 +1000369The default is
370.Dq none ,
371i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000372of the user must appear in a certificate's principals list for it to be
373accepted.
374Note that
375.Cm AuthorizedPrincipalsFile
376is only used when authentication proceeds using a CA listed in
377.Cm TrustedUserCAKeys
378and is not consulted for certification authorities trusted via
379.Pa ~/.ssh/authorized_keys ,
380though the
381.Cm principals=
382key option offers a similar facility (see
383.Xr sshd 8
384for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000385.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000386The contents of the specified file are sent to the remote user before
387authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000388If the argument is
389.Dq none
390then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000391By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000392.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000393Specifies whether challenge-response authentication is allowed (e.g. via
Damien Millere8c9f262014-10-03 09:24:56 +1000394PAM or through authentication styles supported in
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000395.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000396The default is
397.Dq yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100398.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100399Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100400.Xr chroot 2
401to after authentication.
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000402At session startup
403.Xr sshd 8
404checks that all components of the pathname are root-owned directories
405which are not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000406After the chroot,
407.Xr sshd 8
408changes the working directory to the user's home directory.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100409.Pp
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100410The pathname may contain the following tokens that are expanded at runtime once
Damien Millerd8cb1f12008-02-10 22:40:12 +1100411the connecting user has been authenticated: %% is replaced by a literal '%',
412%h is replaced by the home directory of the user being authenticated, and
413%u is replaced by the username of that user.
414.Pp
415The
416.Cm ChrootDirectory
417must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000418user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100419For an interactive session this requires at least a shell, typically
420.Xr sh 1 ,
421and basic
422.Pa /dev
423nodes such as
424.Xr null 4 ,
425.Xr zero 4 ,
426.Xr stdin 4 ,
427.Xr stdout 4 ,
428.Xr stderr 4 ,
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000429and
Damien Millerd8cb1f12008-02-10 22:40:12 +1100430.Xr tty 4
431devices.
432For file transfer sessions using
Darren Tuckerf92077f2009-06-21 17:56:25 +1000433.Dq sftp ,
Damien Millerd8cb1f12008-02-10 22:40:12 +1100434no additional configuration of the environment is necessary if the
Darren Tuckerf92077f2009-06-21 17:56:25 +1000435in-process sftp server is used,
Damien Miller426117b2014-07-30 12:33:20 +1000436though sessions which use logging may require
Darren Tucker00fcd712009-06-21 17:56:00 +1000437.Pa /dev/log
Damien Miller426117b2014-07-30 12:33:20 +1000438inside the chroot directory on some operating systems (see
Darren Tucker00fcd712009-06-21 17:56:00 +1000439.Xr sftp-server 8
440for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100441.Pp
jmc@openbsd.orga5a3e332015-01-22 21:00:42 +0000442For safety, it is very important that the directory hierarchy be
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000443prevented from modification by other processes on the system (especially
444those outside the jail).
445Misconfiguration can lead to unsafe environments which
446.Xr sshd 8
447cannot detect.
448.Pp
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000449The default is
450.Dq none ,
451indicating not to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100452.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000453.It Cm Ciphers
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000454Specifies the ciphers allowed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000455Multiple ciphers must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000456If the specified value begins with a
457.Sq +
458character, then the specified ciphers will be appended to the default set
459instead of replacing them.
460.Pp
Damien Miller0fde8ac2013-11-21 14:12:23 +1100461The supported ciphers are:
462.Pp
Damien Millerc1621c82014-04-20 13:22:46 +1000463.Bl -item -compact -offset indent
464.It
4653des-cbc
466.It
467aes128-cbc
468.It
469aes192-cbc
470.It
471aes256-cbc
472.It
473aes128-ctr
474.It
475aes192-ctr
476.It
477aes256-ctr
478.It
479aes128-gcm@openssh.com
480.It
481aes256-gcm@openssh.com
482.It
483arcfour
484.It
485arcfour128
486.It
487arcfour256
488.It
489blowfish-cbc
490.It
491cast128-cbc
492.It
493chacha20-poly1305@openssh.com
494.El
Damien Miller0fde8ac2013-11-21 14:12:23 +1100495.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100496The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000497.Bd -literal -offset indent
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000498chacha20-poly1305@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000499aes128-ctr,aes192-ctr,aes256-ctr,
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000500aes128-gcm@openssh.com,aes256-gcm@openssh.com
Ben Lindstrom9f049032002-06-21 00:59:05 +0000501.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100502.Pp
503The list of available ciphers may also be obtained using the
504.Fl Q
505option of
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000506.Xr ssh 1
507with an argument of
508.Dq cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000509.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100510Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000511sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100512.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000513receiving any messages back from the client.
514If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100515sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000516It is important to note that the use of client alive messages is very
517different from
Damien Miller12c150e2003-12-17 16:31:10 +1100518.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000519(below).
520The client alive messages are sent through the encrypted channel
521and therefore will not be spoofable.
522The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100523.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000524is spoofable.
525The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000526server depend on knowing when a connection has become inactive.
527.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000528The default value is 3.
529If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000530.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100531(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000532.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100533is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000534will be disconnected after approximately 45 seconds.
Damien Miller1594ad52005-05-26 12:12:19 +1000535.It Cm ClientAliveInterval
536Sets a timeout interval in seconds after which if no data has been received
537from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100538.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000539will send a message through the encrypted
540channel to request a response from the client.
541The default
542is 0, indicating that these messages will not be sent to the client.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000543.It Cm Compression
Damien Miller9786e6e2005-07-26 21:54:56 +1000544Specifies whether compression is allowed, or delayed until
545the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000546The argument must be
Damien Miller9786e6e2005-07-26 21:54:56 +1000547.Dq yes ,
548.Dq delayed ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000549or
550.Dq no .
551The default is
Damien Miller9786e6e2005-07-26 21:54:56 +1000552.Dq delayed .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000553.It Cm DenyGroups
554This keyword can be followed by a list of group name patterns, separated
555by spaces.
556Login is disallowed for users whose primary group or supplementary
557group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000558Only group names are valid; a numerical group ID is not recognized.
559By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100560The allow/deny directives are processed in the following order:
561.Cm DenyUsers ,
562.Cm AllowUsers ,
563.Cm DenyGroups ,
564and finally
565.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100566.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000567See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100568.Xr ssh_config 5
569for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000570.It Cm DenyUsers
571This keyword can be followed by a list of user name patterns, separated
572by spaces.
573Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000574Only user names are valid; a numerical user ID is not recognized.
575By default, login is allowed for all users.
576If the pattern takes the form USER@HOST then USER and HOST
577are separately checked, restricting logins to particular
578users from particular hosts.
jmc@openbsd.orgee1e0a12016-04-27 13:53:48 +0000579HOST criteria may additionally contain addresses to match in CIDR
580address/masklen format.
Damien Millerac73e512006-03-15 11:58:49 +1100581The allow/deny directives are processed in the following order:
582.Cm DenyUsers ,
583.Cm AllowUsers ,
584.Cm DenyGroups ,
585and finally
586.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100587.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000588See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100589.Xr ssh_config 5
590for more information on patterns.
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000591.It Cm FingerprintHash
592Specifies the hash algorithm used when logging key fingerprints.
593Valid options are:
594.Dq md5
595and
596.Dq sha256 .
597The default is
598.Dq sha256 .
Damien Millere2754432006-07-24 14:06:47 +1000599.It Cm ForceCommand
600Forces the execution of the command specified by
601.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100602ignoring any command supplied by the client and
603.Pa ~/.ssh/rc
604if present.
Damien Millere2754432006-07-24 14:06:47 +1000605The command is invoked by using the user's login shell with the -c option.
606This applies to shell, command, or subsystem execution.
607It is most useful inside a
608.Cm Match
609block.
610The command originally supplied by the client is available in the
611.Ev SSH_ORIGINAL_COMMAND
612environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100613Specifying a command of
614.Dq internal-sftp
615will force the use of an in-process sftp server that requires no support
616files when used with
617.Cm ChrootDirectory .
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000618The default is
619.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000620.It Cm GatewayPorts
621Specifies whether remote hosts are allowed to connect to ports
622forwarded for the client.
623By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100624.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000625binds remote port forwardings to the loopback address.
626This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000627.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100628can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100629should allow remote port forwardings to bind to non-loopback addresses, thus
630allowing other hosts to connect.
631The argument may be
632.Dq no
633to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000634.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100635to force remote port forwardings to bind to the wildcard address, or
636.Dq clientspecified
637to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000638The default is
639.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000640.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000641Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100642The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000643.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000644.It Cm GSSAPICleanupCredentials
645Specifies whether to automatically destroy the user's credentials cache
646on logout.
647The default is
648.Dq yes .
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000649.It Cm GSSAPIStrictAcceptorCheck
650Determines whether to be strict about the identity of the GSSAPI acceptor
651a client authenticates against.
652If set to
653.Dq yes
654then the client must authenticate against the
655.Pa host
656service on the current hostname.
657If set to
658.Dq no
659then the client may authenticate against any service key stored in the
660machine's default store.
661This facility is provided to assist with operation on multi homed machines.
662The default is
663.Dq yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000664.It Cm HostbasedAcceptedKeyTypes
665Specifies the key types that will be accepted for hostbased authentication
666as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000667Alternately if the specified value begins with a
668.Sq +
669character, then the specified key types will be appended to the default set
670instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000671The default for this option is:
672.Bd -literal -offset 3n
673ecdsa-sha2-nistp256-cert-v01@openssh.com,
674ecdsa-sha2-nistp384-cert-v01@openssh.com,
675ecdsa-sha2-nistp521-cert-v01@openssh.com,
676ssh-ed25519-cert-v01@openssh.com,
677ssh-rsa-cert-v01@openssh.com,
678ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +0000679ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000680.Ed
681.Pp
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000682The
683.Fl Q
684option of
685.Xr ssh 1
686may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000687.It Cm HostbasedAuthentication
688Specifies whether rhosts or /etc/hosts.equiv authentication together
689with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100690(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000691The default is
692.Dq no .
Damien Millerb594f382006-08-30 11:06:34 +1000693.It Cm HostbasedUsesNameFromPacketOnly
694Specifies whether or not the server will attempt to perform a reverse
695name lookup when matching the name in the
696.Pa ~/.shosts ,
697.Pa ~/.rhosts ,
698and
699.Pa /etc/hosts.equiv
700files during
701.Cm HostbasedAuthentication .
702A setting of
703.Dq yes
704means that
705.Xr sshd 8
706uses the name supplied by the client rather than
707attempting to resolve the name from the TCP connection itself.
708The default is
709.Dq no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100710.It Cm HostCertificate
711Specifies a file containing a public host certificate.
712The certificate's public key must match a private host key already specified
713by
714.Cm HostKey .
715The default behaviour of
716.Xr sshd 8
717is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000718.It Cm HostKey
719Specifies a file containing a private host key
720used by SSH.
naddy@openbsd.orgffe65492016-08-15 12:32:04 +0000721The defaults are
Damien Millereb8b60e2010-08-31 22:41:14 +1000722.Pa /etc/ssh/ssh_host_dsa_key ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100723.Pa /etc/ssh/ssh_host_ecdsa_key ,
724.Pa /etc/ssh/ssh_host_ed25519_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000725and
naddy@openbsd.orgffe65492016-08-15 12:32:04 +0000726.Pa /etc/ssh/ssh_host_rsa_key .
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000727.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000728Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100729.Xr sshd 8
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000730will refuse to use a file if it is group/world-accessible
731and that the
732.Cm HostKeyAlgorithms
733option restricts which of the keys are actually used by
734.Xr sshd 8 .
735.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000736It is possible to have multiple host key files.
Damien Miller85b45e02013-07-20 13:21:52 +1000737It is also possible to specify public host key files instead.
738In this case operations on the private key will be delegated
739to an
740.Xr ssh-agent 1 .
741.It Cm HostKeyAgent
742Identifies the UNIX-domain socket used to communicate
743with an agent that has access to the private host keys.
markus@openbsd.org1a75d142016-05-04 14:29:58 +0000744If the string
Damien Miller85b45e02013-07-20 13:21:52 +1000745.Dq SSH_AUTH_SOCK
746is specified, the location of the socket will be read from the
747.Ev SSH_AUTH_SOCK
748environment variable.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000749.It Cm HostKeyAlgorithms
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000750Specifies the host key algorithms
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000751that the server offers.
752The default for this option is:
753.Bd -literal -offset 3n
754ecdsa-sha2-nistp256-cert-v01@openssh.com,
755ecdsa-sha2-nistp384-cert-v01@openssh.com,
756ecdsa-sha2-nistp521-cert-v01@openssh.com,
757ssh-ed25519-cert-v01@openssh.com,
758ssh-rsa-cert-v01@openssh.com,
759ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +0000760ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000761.Ed
762.Pp
763The list of available key types may also be obtained using the
764.Fl Q
765option of
766.Xr ssh 1
767with an argument of
768.Dq key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000769.It Cm IgnoreRhosts
770Specifies that
771.Pa .rhosts
772and
773.Pa .shosts
774files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000775.Cm HostbasedAuthentication .
776.Pp
777.Pa /etc/hosts.equiv
778and
779.Pa /etc/shosts.equiv
780are still used.
781The default is
782.Dq yes .
783.It Cm IgnoreUserKnownHosts
784Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100785.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000786should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000787.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000788during
Ben Lindstrom9f049032002-06-21 00:59:05 +0000789.Cm HostbasedAuthentication .
790The default is
791.Dq no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100792.It Cm IPQoS
793Specifies the IPv4 type-of-service or DSCP class for the connection.
794Accepted values are
795.Dq af11 ,
796.Dq af12 ,
797.Dq af13 ,
Damien Millerf6e758c2011-09-22 21:37:13 +1000798.Dq af21 ,
Damien Miller0dac6fb2010-11-20 15:19:38 +1100799.Dq af22 ,
800.Dq af23 ,
801.Dq af31 ,
802.Dq af32 ,
803.Dq af33 ,
804.Dq af41 ,
805.Dq af42 ,
806.Dq af43 ,
807.Dq cs0 ,
808.Dq cs1 ,
809.Dq cs2 ,
810.Dq cs3 ,
811.Dq cs4 ,
812.Dq cs5 ,
813.Dq cs6 ,
814.Dq cs7 ,
815.Dq ef ,
816.Dq lowdelay ,
817.Dq throughput ,
818.Dq reliability ,
819or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +1100820This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100821If one argument is specified, it is used as the packet class unconditionally.
822If two values are specified, the first is automatically selected for
823interactive sessions and the second for non-interactive sessions.
824The default is
825.Dq lowdelay
826for interactive sessions and
827.Dq throughput
828for non-interactive sessions.
Damien Millere1e480a2014-02-04 11:13:17 +1100829.It Cm KbdInteractiveAuthentication
830Specifies whether to allow keyboard-interactive authentication.
831The argument to this keyword must be
832.Dq yes
833or
834.Dq no .
835The default is to use whatever value
836.Cm ChallengeResponseAuthentication
837is set to
838(by default
839.Dq yes ) .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000840.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000841Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000842.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000843will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000844To use this option, the server needs a
845Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100846The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000847.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100848.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000849If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100850an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100851The default is
Damien Miller8448e662004-03-08 23:13:15 +1100852.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000853.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100854If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000855the password will be validated via any additional local mechanism
856such as
857.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100858The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000859.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000860.It Cm KerberosTicketCleanup
861Specifies whether to automatically destroy the user's ticket cache
862file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100863The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000864.Dq yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000865.It Cm KexAlgorithms
866Specifies the available KEX (Key Exchange) algorithms.
867Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000868Alternately if the specified value begins with a
869.Sq +
870character, then the specified methods will be appended to the default set
871instead of replacing them.
Damien Millerc1621c82014-04-20 13:22:46 +1000872The supported algorithms are:
873.Pp
874.Bl -item -compact -offset indent
875.It
djm@openbsd.org16277fc2016-09-22 17:55:13 +0000876curve25519-sha256
877.It
Damien Millerc1621c82014-04-20 13:22:46 +1000878curve25519-sha256@libssh.org
879.It
880diffie-hellman-group1-sha1
881.It
882diffie-hellman-group14-sha1
883.It
884diffie-hellman-group-exchange-sha1
885.It
886diffie-hellman-group-exchange-sha256
887.It
888ecdh-sha2-nistp256
889.It
890ecdh-sha2-nistp384
891.It
892ecdh-sha2-nistp521
893.El
894.Pp
895The default is:
Damien Miller6575c3a2013-12-18 17:47:02 +1100896.Bd -literal -offset indent
djm@openbsd.org16277fc2016-09-22 17:55:13 +0000897curve25519-sha256,curve25519-sha256@libssh.org,
Damien Miller6575c3a2013-12-18 17:47:02 +1100898ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
899diffie-hellman-group-exchange-sha256,
Damien Millerc1621c82014-04-20 13:22:46 +1000900diffie-hellman-group14-sha1
Damien Miller6575c3a2013-12-18 17:47:02 +1100901.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000902.Pp
903The list of available key exchange algorithms may also be obtained using the
904.Fl Q
905option of
906.Xr ssh 1
907with an argument of
908.Dq kex .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000909.It Cm ListenAddress
910Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100911.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000912should listen on.
913The following forms may be used:
914.Pp
915.Bl -item -offset indent -compact
916.It
917.Cm ListenAddress
918.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000919.Ar host | Ar IPv4_addr | Ar IPv6_addr
Ben Lindstrom9f049032002-06-21 00:59:05 +0000920.Sm on
921.It
922.Cm ListenAddress
923.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000924.Ar host | Ar IPv4_addr : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000925.Sm on
926.It
927.Cm ListenAddress
928.Sm off
929.Oo
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000930.Ar host | Ar IPv6_addr Oc : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000931.Sm on
932.El
933.Pp
934If
935.Ar port
936is not specified,
dtucker@openbsd.org531a57a2015-04-29 03:48:56 +0000937sshd will listen on the address and all
Ben Lindstrom9f049032002-06-21 00:59:05 +0000938.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000939options specified.
940The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000941Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000942.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000943options are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000944.It Cm LoginGraceTime
945The server disconnects after this time if the user has not
946successfully logged in.
947If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000948The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000949.It Cm LogLevel
950Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100951.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000952The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100953QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000954The default is INFO.
955DEBUG and DEBUG1 are equivalent.
956DEBUG2 and DEBUG3 each specify higher levels of debugging output.
957Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000958.It Cm MACs
959Specifies the available MAC (message authentication code) algorithms.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000960The MAC algorithm is used for data integrity protection.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000961Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000962If the specified value begins with a
963.Sq +
964character, then the specified algorithms will be appended to the default set
965instead of replacing them.
966.Pp
Damien Milleraf43a7a2012-12-12 10:46:31 +1100967The algorithms that contain
968.Dq -etm
969calculate the MAC after encryption (encrypt-then-mac).
970These are considered safer and their use recommended.
Damien Millerc1621c82014-04-20 13:22:46 +1000971The supported MACs are:
972.Pp
973.Bl -item -compact -offset indent
974.It
975hmac-md5
976.It
977hmac-md5-96
978.It
979hmac-ripemd160
980.It
981hmac-sha1
982.It
983hmac-sha1-96
984.It
985hmac-sha2-256
986.It
987hmac-sha2-512
988.It
989umac-64@openssh.com
990.It
991umac-128@openssh.com
992.It
993hmac-md5-etm@openssh.com
994.It
995hmac-md5-96-etm@openssh.com
996.It
997hmac-ripemd160-etm@openssh.com
998.It
999hmac-sha1-etm@openssh.com
1000.It
1001hmac-sha1-96-etm@openssh.com
1002.It
1003hmac-sha2-256-etm@openssh.com
1004.It
1005hmac-sha2-512-etm@openssh.com
1006.It
1007umac-64-etm@openssh.com
1008.It
1009umac-128-etm@openssh.com
1010.El
1011.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +11001012The default is:
Damien Miller22b7b492007-06-11 14:07:12 +10001013.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +11001014umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1015hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001016hmac-sha1-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +10001017umac-64@openssh.com,umac-128@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001018hmac-sha2-256,hmac-sha2-512,hmac-sha1
Damien Miller22b7b492007-06-11 14:07:12 +10001019.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001020.Pp
1021The list of available MAC algorithms may also be obtained using the
1022.Fl Q
1023option of
1024.Xr ssh 1
1025with an argument of
1026.Dq mac .
Darren Tucker45150472006-07-12 22:34:17 +10001027.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +10001028Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +10001029If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +10001030.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001031line are satisfied, the keywords on the following lines override those
1032set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +10001033.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001034line or the end of the file.
Damien Millerfc5d6752014-02-28 10:01:28 +11001035If a keyword appears in multiple
1036.Cm Match
sobrado@openbsd.org180bcb42014-08-30 16:32:25 +00001037blocks that are satisfied, only the first instance of the keyword is
Damien Millerfc5d6752014-02-28 10:01:28 +11001038applied.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001039.Pp
Damien Millerd04f3572006-07-24 13:46:50 +10001040The arguments to
Darren Tucker45150472006-07-12 22:34:17 +10001041.Cm Match
Damien Millercf31f382013-10-24 21:02:56 +11001042are one or more criteria-pattern pairs or the single token
1043.Cm All
1044which matches all criteria.
Darren Tucker45150472006-07-12 22:34:17 +10001045The available criteria are
1046.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +10001047.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +10001048.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +10001049.Cm LocalAddress ,
1050.Cm LocalPort ,
Darren Tucker45150472006-07-12 22:34:17 +10001051and
1052.Cm Address .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001053The match patterns may consist of single entries or comma-separated
1054lists and may use the wildcard and negation operators described in the
Damien Millerfecfd112013-07-18 16:11:50 +10001055PATTERNS section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +10001056.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001057.Pp
1058The patterns in an
1059.Cm Address
1060criteria may additionally contain addresses to match in CIDR
Darren Tucker6a2a4002008-06-10 23:03:04 +10001061address/masklen format, e.g.\&
Darren Tucker7a3935d2008-06-10 22:59:10 +10001062.Dq 192.0.2.0/24
1063or
jca@openbsd.org42d47ad2016-08-12 19:19:04 +00001064.Dq 2001:db8::/32 .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001065Note that the mask length provided must be consistent with the address -
1066it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +10001067or one with bits set in this host portion of the address.
1068For example,
Darren Tucker7a3935d2008-06-10 22:59:10 +10001069.Dq 192.0.2.0/33
1070and
Darren Tucker6a2a4002008-06-10 23:03:04 +10001071.Dq 192.0.2.0/8
Darren Tucker7a3935d2008-06-10 22:59:10 +10001072respectively.
1073.Pp
Darren Tucker45150472006-07-12 22:34:17 +10001074Only a subset of keywords may be used on the lines following a
1075.Cm Match
1076keyword.
1077Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +10001078.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +11001079.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +10001080.Cm AllowGroups ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001081.Cm AllowStreamLocalForwarding ,
Damien Miller9b439df2006-07-24 14:04:00 +10001082.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +10001083.Cm AllowUsers ,
Damien Millera6e3f012012-11-04 23:21:40 +11001084.Cm AuthenticationMethods ,
Damien Miller09d3e122012-10-31 08:58:58 +11001085.Cm AuthorizedKeysCommand ,
1086.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +11001087.Cm AuthorizedKeysFile ,
djm@openbsd.orgb6b91082015-11-13 02:57:46 +00001088.Cm AuthorizedPrincipalsCommand ,
1089.Cm AuthorizedPrincipalsCommandUser ,
Damien Millerab6de352010-06-26 09:38:45 +10001090.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +11001091.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +10001092.Cm ChrootDirectory ,
Damien Millerc24da772012-06-20 21:53:58 +10001093.Cm DenyGroups ,
1094.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +10001095.Cm ForceCommand ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001096.Cm GatewayPorts ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +00001097.Cm GSSAPIAuthentication ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001098.Cm HostbasedAcceptedKeyTypes ,
Damien Miller25434de2008-05-19 14:29:08 +10001099.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +10001100.Cm HostbasedUsesNameFromPacketOnly ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001101.Cm IPQoS ,
Darren Tucker1d75f222007-03-01 21:31:28 +11001102.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +11001103.Cm KerberosAuthentication ,
Damien Miller307c1d12008-06-16 07:56:20 +10001104.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +10001105.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +11001106.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +11001107.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +10001108.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +11001109.Cm PermitRootLogin ,
Damien Miller5ff30c62013-10-30 22:21:50 +11001110.Cm PermitTTY ,
Damien Millerab6de352010-06-26 09:38:45 +10001111.Cm PermitTunnel ,
Damien Miller72e6b5c2014-07-04 09:00:04 +10001112.Cm PermitUserRC ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001113.Cm PubkeyAcceptedKeyTypes ,
Darren Tucker1477ea12009-10-07 08:36:05 +11001114.Cm PubkeyAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001115.Cm RekeyLimit ,
1116.Cm RevokedKeys ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001117.Cm StreamLocalBindMask ,
1118.Cm StreamLocalBindUnlink ,
1119.Cm TrustedUserCAKeys ,
Damien Millerd1de9952006-07-24 14:05:48 +10001120.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +11001121.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +10001122and
Damien Miller0296ae82009-02-23 11:00:24 +11001123.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +10001124.It Cm MaxAuthTries
1125Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +10001126connection.
1127Once the number of failures reaches half this value,
1128additional failures are logged.
1129The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +10001130.It Cm MaxSessions
djm@openbsd.orgcac3b662016-02-05 02:37:56 +00001131Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1132sessions permitted per network connection.
1133Multiple sessions may be established by clients that support connection
1134multiplexing.
1135Setting
1136.Cm MaxSessions
1137to 1 will effectively disable session multiplexing, whereas setting it to 0
1138will prevent all shell, login and subsystem sessions while still permitting
1139forwarding.
Damien Miller7207f642008-05-19 15:34:50 +10001140The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001141.It Cm MaxStartups
1142Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001143SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001144Additional connections will be dropped until authentication succeeds or the
1145.Cm LoginGraceTime
1146expires for a connection.
Damien Miller1f583df2013-02-12 11:02:08 +11001147The default is 10:30:100.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001148.Pp
1149Alternatively, random early drop can be enabled by specifying
1150the three colon separated values
1151.Dq start:rate:full
Damien Miller208f1ed2006-03-15 11:56:03 +11001152(e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +11001153.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001154will refuse connection attempts with a probability of
1155.Dq rate/100
1156(30%)
1157if there are currently
1158.Dq start
1159(10)
1160unauthenticated connections.
1161The probability increases linearly and all connection attempts
1162are refused if the number of unauthenticated connections reaches
1163.Dq full
1164(60).
1165.It Cm PasswordAuthentication
1166Specifies whether password authentication is allowed.
1167The default is
1168.Dq yes .
1169.It Cm PermitEmptyPasswords
1170When password authentication is allowed, it specifies whether the
1171server allows login to accounts with empty password strings.
1172The default is
1173.Dq no .
Damien Miller9b439df2006-07-24 14:04:00 +10001174.It Cm PermitOpen
1175Specifies the destinations to which TCP port forwarding is permitted.
1176The forwarding specification must be one of the following forms:
1177.Pp
1178.Bl -item -offset indent -compact
1179.It
1180.Cm PermitOpen
1181.Sm off
1182.Ar host : port
1183.Sm on
1184.It
1185.Cm PermitOpen
1186.Sm off
1187.Ar IPv4_addr : port
1188.Sm on
1189.It
1190.Cm PermitOpen
1191.Sm off
1192.Ar \&[ IPv6_addr \&] : port
1193.Sm on
1194.El
1195.Pp
Damien Millera765cf42006-07-24 14:08:13 +10001196Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +10001197An argument of
1198.Dq any
1199can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +10001200An argument of
1201.Dq none
1202can be used to prohibit all forwarding requests.
jmc@openbsd.org32d921c2016-07-19 12:59:16 +00001203The wildcard
dtucker@openbsd.orgd7eabc82016-07-19 11:38:53 +00001204.Dq *
jmc@openbsd.org32d921c2016-07-19 12:59:16 +00001205can be used for host or port to allow all hosts or ports, respectively.
Damien Miller65bc2c42006-07-24 14:04:16 +10001206By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001207.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +11001208Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +00001209.Xr ssh 1 .
1210The argument must be
1211.Dq yes ,
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001212.Dq prohibit-password ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001213.Dq without-password ,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001214.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001215or
1216.Dq no .
1217The default is
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001218.Dq prohibit-password .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001219.Pp
1220If this option is set to
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001221.Dq prohibit-password
1222or
Damien Miller5b0d63f2006-03-15 11:56:56 +11001223.Dq without-password ,
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001224password and keyboard-interactive authentication are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001225.Pp
1226If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001227.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001228root login with public key authentication will be allowed,
1229but only if the
1230.Ar command
1231option has been specified
1232(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +10001233normally not allowed).
1234All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001235.Pp
1236If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001237.Dq no ,
Darren Tuckerb3509012005-01-20 11:01:46 +11001238root is not allowed to log in.
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +00001239.It Cm PermitTTY
1240Specifies whether
1241.Xr pty 4
1242allocation is permitted.
1243The default is
1244.Dq yes .
Damien Millerd27b9472005-12-13 19:29:02 +11001245.It Cm PermitTunnel
1246Specifies whether
1247.Xr tun 4
1248device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +11001249The argument must be
1250.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +10001251.Dq point-to-point
1252(layer 3),
1253.Dq ethernet
1254(layer 2), or
Damien Miller7b58e802005-12-13 19:33:19 +11001255.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +10001256Specifying
1257.Dq yes
1258permits both
1259.Dq point-to-point
1260and
1261.Dq ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +11001262The default is
1263.Dq no .
djm@openbsd.org48dffd52014-09-09 09:45:36 +00001264.Pp
1265Independent of this setting, the permissions of the selected
1266.Xr tun 4
1267device must allow access to the user.
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001268.It Cm PermitUserEnvironment
1269Specifies whether
1270.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001271and
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001272.Cm environment=
1273options in
1274.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001275are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +11001276.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001277The default is
1278.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001279Enabling environment processing may enable users to bypass access
1280restrictions in some configurations using mechanisms such as
1281.Ev LD_PRELOAD .
Damien Miller72e6b5c2014-07-04 09:00:04 +10001282.It Cm PermitUserRC
1283Specifies whether any
1284.Pa ~/.ssh/rc
1285file is executed.
1286The default is
1287.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001288.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +00001289Specifies the file that contains the process ID of the
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001290SSH daemon, or
1291.Dq none
1292to not write one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001293The default is
1294.Pa /var/run/sshd.pid .
1295.It Cm Port
1296Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +11001297.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001298listens on.
1299The default is 22.
1300Multiple options of this type are permitted.
1301See also
1302.Cm ListenAddress .
1303.It Cm PrintLastLog
1304Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001305.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +11001306should print the date and time of the last user login when a user logs
1307in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001308The default is
1309.Dq yes .
1310.It Cm PrintMotd
1311Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001312.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001313should print
1314.Pa /etc/motd
1315when a user logs in interactively.
1316(On some systems it is also printed by the shell,
1317.Pa /etc/profile ,
1318or equivalent.)
1319The default is
1320.Dq yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001321.It Cm PubkeyAcceptedKeyTypes
1322Specifies the key types that will be accepted for public key authentication
1323as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001324Alternately if the specified value begins with a
1325.Sq +
1326character, then the specified key types will be appended to the default set
1327instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001328The default for this option is:
1329.Bd -literal -offset 3n
1330ecdsa-sha2-nistp256-cert-v01@openssh.com,
1331ecdsa-sha2-nistp384-cert-v01@openssh.com,
1332ecdsa-sha2-nistp521-cert-v01@openssh.com,
1333ssh-ed25519-cert-v01@openssh.com,
1334ssh-rsa-cert-v01@openssh.com,
1335ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +00001336ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001337.Ed
1338.Pp
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001339The
1340.Fl Q
1341option of
1342.Xr ssh 1
1343may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001344.It Cm PubkeyAuthentication
1345Specifies whether public key authentication is allowed.
1346The default is
1347.Dq yes .
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001348.It Cm RekeyLimit
1349Specifies the maximum amount of data that may be transmitted before the
1350session key is renegotiated, optionally followed a maximum amount of
1351time that may pass before the session key is renegotiated.
1352The first argument is specified in bytes and may have a suffix of
1353.Sq K ,
1354.Sq M ,
1355or
1356.Sq G
1357to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1358The default is between
1359.Sq 1G
1360and
1361.Sq 4G ,
1362depending on the cipher.
1363The optional second value is specified in seconds and may use any of the
1364units documented in the
1365.Sx TIME FORMATS
Darren Tucker64d22942013-05-16 20:31:29 +10001366section.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001367The default value for
1368.Cm RekeyLimit
1369is
1370.Dq default none ,
1371which means that rekeying is performed after the cipher's default amount
1372of data has been sent or received and no time based rekeying is done.
Damien Miller1aed65e2010-03-04 21:53:35 +11001373.It Cm RevokedKeys
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001374Specifies revoked public keys file, or
1375.Dq none
1376to not use one.
Damien Miller1aed65e2010-03-04 21:53:35 +11001377Keys listed in this file will be refused for public key authentication.
1378Note that if this file is not readable, then public key authentication will
1379be refused for all users.
Damien Millerf3747bf2013-01-18 11:44:04 +11001380Keys may be specified as a text file, listing one public key per line, or as
1381an OpenSSH Key Revocation List (KRL) as generated by
Damien Miller72abeb72013-01-20 22:33:44 +11001382.Xr ssh-keygen 1 .
Damien Millerfecfd112013-07-18 16:11:50 +10001383For more information on KRLs, see the KEY REVOCATION LISTS section in
Damien Millerf3747bf2013-01-18 11:44:04 +11001384.Xr ssh-keygen 1 .
Damien Miller7acefbb2014-07-18 14:11:24 +10001385.It Cm StreamLocalBindMask
1386Sets the octal file creation mode mask
1387.Pq umask
1388used when creating a Unix-domain socket file for local or remote
1389port forwarding.
1390This option is only used for port forwarding to a Unix-domain socket file.
1391.Pp
1392The default value is 0177, which creates a Unix-domain socket file that is
1393readable and writable only by the owner.
1394Note that not all operating systems honor the file mode on Unix-domain
1395socket files.
1396.It Cm StreamLocalBindUnlink
1397Specifies whether to remove an existing Unix-domain socket file for local
1398or remote port forwarding before creating a new one.
1399If the socket file already exists and
1400.Cm StreamLocalBindUnlink
1401is not enabled,
1402.Nm sshd
1403will be unable to forward the port to the Unix-domain socket file.
1404This option is only used for port forwarding to a Unix-domain socket file.
1405.Pp
1406The argument must be
1407.Dq yes
1408or
1409.Dq no .
1410The default is
1411.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001412.It Cm StrictModes
1413Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001414.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001415should check file modes and ownership of the
1416user's files and home directory before accepting login.
1417This is normally desirable because novices sometimes accidentally leave their
1418directory or files world-writable.
1419The default is
1420.Dq yes .
Darren Tuckerf788a912010-01-08 17:06:47 +11001421Note that this does not apply to
1422.Cm ChrootDirectory ,
1423whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001424.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +11001425Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +10001426Arguments should be a subsystem name and a command (with optional arguments)
1427to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001428.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001429The command
1430.Xr sftp-server 8
1431implements the
1432.Dq sftp
1433file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001434.Pp
1435Alternately the name
1436.Dq internal-sftp
1437implements an in-process
1438.Dq sftp
1439server.
1440This may simplify configurations using
1441.Cm ChrootDirectory
1442to force a different filesystem root on clients.
1443.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001444By default no subsystems are defined.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001445.It Cm SyslogFacility
1446Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001447.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001448The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1449LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1450The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001451.It Cm TCPKeepAlive
1452Specifies whether the system should send TCP keepalive messages to the
1453other side.
1454If they are sent, death of the connection or crash of one
1455of the machines will be properly noticed.
1456However, this means that
1457connections will die if the route is down temporarily, and some people
1458find it annoying.
1459On the other hand, if TCP keepalives are not sent,
1460sessions may hang indefinitely on the server, leaving
1461.Dq ghost
1462users and consuming server resources.
1463.Pp
1464The default is
1465.Dq yes
1466(to send TCP keepalive messages), and the server will notice
1467if the network goes down or the client host crashes.
1468This avoids infinitely hanging sessions.
1469.Pp
1470To disable TCP keepalive messages, the value should be set to
1471.Dq no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001472.It Cm TrustedUserCAKeys
1473Specifies a file containing public keys of certificate authorities that are
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001474trusted to sign user certificates for authentication, or
1475.Dq none
1476to not use one.
Damien Miller72b33822010-03-05 07:39:01 +11001477Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001478.Ql #
1479are allowed.
1480If a certificate is presented for authentication and has its signing CA key
1481listed in this file, then it may be used for authentication for any user
1482listed in the certificate's principals list.
1483Note that certificates that lack a list of principals will not be permitted
1484for authentication using
1485.Cm TrustedUserCAKeys .
Damien Millerfecfd112013-07-18 16:11:50 +10001486For more details on certificates, see the CERTIFICATES section in
Damien Miller1aed65e2010-03-04 21:53:35 +11001487.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001488.It Cm UseDNS
1489Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001490.Xr sshd 8
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001491should look up the remote host name, and to check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001492the resolved host name for the remote IP address maps back to the
1493very same IP address.
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001494.Pp
1495If this option is set to
1496.Dq no
1497(the default) then only addresses and not host names may be used in
djm@openbsd.org0235a5f2016-03-17 17:19:43 +00001498.Pa ~/.ssh/authorized_keys
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001499.Cm from
1500and
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +00001501.Nm
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001502.Cm Match
1503.Cm Host
1504directives.
Damien Miller2e193e22003-05-14 15:13:03 +10001505.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001506Enables the Pluggable Authentication Module interface.
1507If set to
1508.Dq yes
1509this will enable PAM authentication using
1510.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001511and
1512.Cm PasswordAuthentication
1513in addition to PAM account and session module processing for all
1514authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001515.Pp
1516Because PAM challenge-response authentication usually serves an equivalent
1517role to password authentication, you should disable either
1518.Cm PasswordAuthentication
1519or
1520.Cm ChallengeResponseAuthentication.
1521.Pp
1522If
1523.Cm UsePAM
1524is enabled, you will not be able to run
1525.Xr sshd 8
1526as a non-root user.
1527The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +10001528.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001529.It Cm UsePrivilegeSeparation
1530Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001531.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001532separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +10001533to deal with incoming network traffic.
1534After successful authentication, another process will be created that has
1535the privilege of the authenticated user.
1536The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +00001537escalation by containing any corruption within the unprivileged processes.
sobrado@openbsd.orgbdcb73f2015-10-07 14:45:30 +00001538The argument must be
1539.Dq yes ,
1540.Dq no ,
1541or
1542.Dq sandbox .
Damien Miller69ff1df2011-06-23 08:30:03 +10001543If
1544.Cm UsePrivilegeSeparation
1545is set to
1546.Dq sandbox
1547then the pre-authentication unprivileged process is subject to additional
1548restrictions.
sobrado@openbsd.orgbdcb73f2015-10-07 14:45:30 +00001549The default is
1550.Dq sandbox .
Damien Miller23528812012-04-22 11:24:43 +10001551.It Cm VersionAddendum
1552Optionally specifies additional text to append to the SSH protocol banner
1553sent by the server upon connection.
1554The default is
1555.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001556.It Cm X11DisplayOffset
1557Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001558.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001559X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001560This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001561The default is 10.
1562.It Cm X11Forwarding
1563Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001564The argument must be
1565.Dq yes
1566or
1567.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001568The default is
1569.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +10001570.Pp
1571When X11 forwarding is enabled, there may be additional exposure to
1572the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001573.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001574proxy display is configured to listen on the wildcard address (see
1575.Cm X11UseLocalhost
Damien Miller5b0d63f2006-03-15 11:56:56 +11001576below), though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001577Additionally, the authentication spoofing and authentication data
1578verification and substitution occur on the client side.
1579The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001580display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001581forwarding (see the warnings for
1582.Cm ForwardX11
1583in
Damien Millerf1ce5052003-06-11 22:04:39 +10001584.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001585A system administrator may have a stance in which they want to
1586protect clients that may expose themselves to attack by unwittingly
1587requesting X11 forwarding, which can warrant a
1588.Dq no
1589setting.
1590.Pp
1591Note that disabling X11 forwarding does not prevent users from
1592forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001593.It Cm X11UseLocalhost
1594Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001595.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001596should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001597the wildcard address.
1598By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001599sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001600hostname part of the
1601.Ev DISPLAY
1602environment variable to
1603.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001604This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001605However, some older X11 clients may not function with this
1606configuration.
1607.Cm X11UseLocalhost
1608may be set to
1609.Dq no
1610to specify that the forwarding server should be bound to the wildcard
1611address.
1612The argument must be
1613.Dq yes
1614or
1615.Dq no .
1616The default is
1617.Dq yes .
1618.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001619Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001620.Xr xauth 1
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001621program, or
1622.Dq none
1623to not use one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001624The default is
1625.Pa /usr/X11R6/bin/xauth .
1626.El
Damien Millere3beba22006-03-15 11:59:25 +11001627.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001628.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001629command-line arguments and configuration file options that specify time
1630may be expressed using a sequence of the form:
1631.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001632.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001633.Sm on
1634where
1635.Ar time
1636is a positive integer value and
1637.Ar qualifier
1638is one of the following:
1639.Pp
1640.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001641.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001642seconds
1643.It Cm s | Cm S
1644seconds
1645.It Cm m | Cm M
1646minutes
1647.It Cm h | Cm H
1648hours
1649.It Cm d | Cm D
1650days
1651.It Cm w | Cm W
1652weeks
1653.El
1654.Pp
1655Each member of the sequence is added together to calculate
1656the total time value.
1657.Pp
1658Time format examples:
1659.Pp
1660.Bl -tag -width Ds -compact -offset indent
1661.It 600
1662600 seconds (10 minutes)
1663.It 10m
166410 minutes
1665.It 1h30m
16661 hour 30 minutes (90 minutes)
1667.El
1668.Sh FILES
1669.Bl -tag -width Ds
1670.It Pa /etc/ssh/sshd_config
1671Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001672.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001673This file should be writable by root only, but it is recommended
1674(though not necessary) that it be world-readable.
1675.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001676.Sh SEE ALSO
1677.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001678.Sh AUTHORS
1679OpenSSH is a derivative of the original and free
1680ssh 1.2.12 release by Tatu Ylonen.
1681Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1682Theo de Raadt and Dug Song
1683removed many bugs, re-added newer features and
1684created OpenSSH.
1685Markus Friedl contributed the support for SSH
1686protocol versions 1.5 and 2.0.
1687Niels Provos and Markus Friedl contributed support
1688for privilege separation.