blob: 6907979581e170c62f58bf6b05325b75e8f7b671 [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.orgb64faeb2016-06-17 05:03:40 +000036.\" $OpenBSD: sshd_config.5,v 1.224 2016/06/17 05:03:40 djm Exp $
37.Dd $Mdocdate: June 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.
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
195methods.
196if 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
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000233This option will yield a fatal
Damien Millera6e3f012012-11-04 23:21:40 +1100234error if enabled if protocol 1 is also enabled.
235Note that each authentication method listed should also be explicitly enabled
236in the configuration.
djm@openbsd.orgb64faeb2016-06-17 05:03:40 +0000237The default
238.Dq any
239is not to require multiple authentication; successful completion
Damien Millera6e3f012012-11-04 23:21:40 +1100240of a single authentication method is sufficient.
Damien Miller09d3e122012-10-31 08:58:58 +1100241.It Cm AuthorizedKeysCommand
Damien Millerf33580e2012-11-04 22:22:52 +1100242Specifies a program to be used to look up the user's public keys.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000243The program must be owned by root, not writable by group or others and
244specified by an absolute path.
245.Pp
246Arguments to
247.Cm AuthorizedKeysCommand
248may be provided using the following tokens, which will be expanded
249at runtime: %% is replaced by a literal '%', %u is replaced by the
250username being authenticated, %h is replaced by the home directory
251of the user being authenticated, %t is replaced with the key type
252offered for authentication, %f is replaced with the fingerprint of
253the key, and %k is replaced with the key being offered for authentication.
254If no arguments are specified then the username of the target user
255will be supplied.
256.Pp
257The program should produce on standard output zero or
Damien Millerfecfd112013-07-18 16:11:50 +1000258more lines of authorized_keys output (see AUTHORIZED_KEYS in
Damien Millerf33580e2012-11-04 22:22:52 +1100259.Xr sshd 8 ) .
Damien Miller09d3e122012-10-31 08:58:58 +1100260If a key supplied by AuthorizedKeysCommand does not successfully authenticate
261and authorize the user then public key authentication continues using the usual
262.Cm AuthorizedKeysFile
263files.
264By default, no AuthorizedKeysCommand is run.
265.It Cm AuthorizedKeysCommandUser
266Specifies the user under whose account the AuthorizedKeysCommand is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100267It is recommended to use a dedicated user that has no other role on the host
268than running authorized keys commands.
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000269If
djm@openbsd.orgd663bea2014-12-11 05:25:06 +0000270.Cm AuthorizedKeysCommand
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000271is specified but
272.Cm AuthorizedKeysCommandUser
273is not, then
274.Xr sshd 8
275will refuse to start.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000276.It Cm AuthorizedKeysFile
277Specifies the file that contains the public keys that can be used
278for user authentication.
Damien Miller6018a362010-07-02 13:35:19 +1000279The format is described in the
Damien Millerfecfd112013-07-18 16:11:50 +1000280AUTHORIZED_KEYS FILE FORMAT
Damien Miller6018a362010-07-02 13:35:19 +1000281section of
282.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000283.Cm AuthorizedKeysFile
284may contain tokens of the form %T which are substituted during connection
Damien Miller5b0d63f2006-03-15 11:56:56 +1100285setup.
Damien Millerfbf486b2003-05-23 18:44:23 +1000286The following tokens are defined: %% is replaced by a literal '%',
Damien Miller5b0d63f2006-03-15 11:56:56 +1100287%h is replaced by the home directory of the user being authenticated, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000288%u is replaced by the username of that user.
289After expansion,
290.Cm AuthorizedKeysFile
291is taken to be an absolute path or one relative to the user's home
292directory.
Damien Millerb9132fc2011-05-29 21:41:40 +1000293Multiple files may be listed, separated by whitespace.
djm@openbsd.org2bca8a42015-09-11 03:13:36 +0000294Alternately this option may be set to
295.Dq none
296to skip checking for user keys in files.
Damien Millerb9132fc2011-05-29 21:41:40 +1000297The default is
298.Dq .ssh/authorized_keys .ssh/authorized_keys2 .
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000299.It Cm AuthorizedPrincipalsCommand
300Specifies a program to be used to generate the list of allowed
301certificate principals as per
302.Cm AuthorizedPrincipalsFile .
303The program must be owned by root, not writable by group or others and
304specified by an absolute path.
305.Pp
306Arguments to
307.Cm AuthorizedPrincipalsCommand
308may be provided using the following tokens, which will be expanded
309at runtime: %% is replaced by a literal '%', %u is replaced by the
310username being authenticated and %h is replaced by the home directory
311of the user being authenticated.
312.Pp
313The program should produce on standard output zero or
314more lines of
315.Cm AuthorizedPrincipalsFile
316output.
317If either
318.Cm AuthorizedPrincipalsCommand
319or
320.Cm AuthorizedPrincipalsFile
321is specified, then certificates offered by the client for authentication
322must contain a principal that is listed.
323By default, no AuthorizedPrincipalsCommand is run.
324.It Cm AuthorizedPrincipalsCommandUser
325Specifies the user under whose account the AuthorizedPrincipalsCommand is run.
326It is recommended to use a dedicated user that has no other role on the host
327than running authorized principals commands.
328If
329.Cm AuthorizedPrincipalsCommand
330is specified but
331.Cm AuthorizedPrincipalsCommandUser
332is not, then
333.Xr sshd 8
334will refuse to start.
Damien Miller30da3442010-05-10 11:58:03 +1000335.It Cm AuthorizedPrincipalsFile
336Specifies a file that lists principal names that are accepted for
337certificate authentication.
338When using certificates signed by a key listed in
339.Cm TrustedUserCAKeys ,
340this file lists names, one of which must appear in the certificate for it
341to be accepted for authentication.
Damien Millerd59dab82010-07-02 13:37:17 +1000342Names are listed one per line preceded by key options (as described
Damien Millerfecfd112013-07-18 16:11:50 +1000343in AUTHORIZED_KEYS FILE FORMAT in
Damien Millerd59dab82010-07-02 13:37:17 +1000344.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000345Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000346.Ql #
347are ignored.
348.Pp
349.Cm AuthorizedPrincipalsFile
350may contain tokens of the form %T which are substituted during connection
351setup.
352The following tokens are defined: %% is replaced by a literal '%',
353%h is replaced by the home directory of the user being authenticated, and
354%u is replaced by the username of that user.
355After expansion,
356.Cm AuthorizedPrincipalsFile
357is taken to be an absolute path or one relative to the user's home
358directory.
359.Pp
Damien Miller8fef9eb2012-04-22 11:25:10 +1000360The default is
361.Dq none ,
362i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000363of the user must appear in a certificate's principals list for it to be
364accepted.
365Note that
366.Cm AuthorizedPrincipalsFile
367is only used when authentication proceeds using a CA listed in
368.Cm TrustedUserCAKeys
369and is not consulted for certification authorities trusted via
370.Pa ~/.ssh/authorized_keys ,
371though the
372.Cm principals=
373key option offers a similar facility (see
374.Xr sshd 8
375for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000376.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000377The contents of the specified file are sent to the remote user before
378authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000379If the argument is
380.Dq none
381then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000382By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000383.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000384Specifies whether challenge-response authentication is allowed (e.g. via
Damien Millere8c9f262014-10-03 09:24:56 +1000385PAM or through authentication styles supported in
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000386.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000387The default is
388.Dq yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100389.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100390Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100391.Xr chroot 2
392to after authentication.
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000393At session startup
394.Xr sshd 8
395checks that all components of the pathname are root-owned directories
396which are not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000397After the chroot,
398.Xr sshd 8
399changes the working directory to the user's home directory.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100400.Pp
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100401The pathname may contain the following tokens that are expanded at runtime once
Damien Millerd8cb1f12008-02-10 22:40:12 +1100402the connecting user has been authenticated: %% is replaced by a literal '%',
403%h is replaced by the home directory of the user being authenticated, and
404%u is replaced by the username of that user.
405.Pp
406The
407.Cm ChrootDirectory
408must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000409user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100410For an interactive session this requires at least a shell, typically
411.Xr sh 1 ,
412and basic
413.Pa /dev
414nodes such as
415.Xr null 4 ,
416.Xr zero 4 ,
417.Xr stdin 4 ,
418.Xr stdout 4 ,
419.Xr stderr 4 ,
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000420and
Damien Millerd8cb1f12008-02-10 22:40:12 +1100421.Xr tty 4
422devices.
423For file transfer sessions using
Darren Tuckerf92077f2009-06-21 17:56:25 +1000424.Dq sftp ,
Damien Millerd8cb1f12008-02-10 22:40:12 +1100425no additional configuration of the environment is necessary if the
Darren Tuckerf92077f2009-06-21 17:56:25 +1000426in-process sftp server is used,
Damien Miller426117b2014-07-30 12:33:20 +1000427though sessions which use logging may require
Darren Tucker00fcd712009-06-21 17:56:00 +1000428.Pa /dev/log
Damien Miller426117b2014-07-30 12:33:20 +1000429inside the chroot directory on some operating systems (see
Darren Tucker00fcd712009-06-21 17:56:00 +1000430.Xr sftp-server 8
431for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100432.Pp
jmc@openbsd.orga5a3e332015-01-22 21:00:42 +0000433For safety, it is very important that the directory hierarchy be
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000434prevented from modification by other processes on the system (especially
435those outside the jail).
436Misconfiguration can lead to unsafe environments which
437.Xr sshd 8
438cannot detect.
439.Pp
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000440The default is
441.Dq none ,
442indicating not to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100443.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000444.It Cm Ciphers
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000445Specifies the ciphers allowed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000446Multiple ciphers must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000447If the specified value begins with a
448.Sq +
449character, then the specified ciphers will be appended to the default set
450instead of replacing them.
451.Pp
Damien Miller0fde8ac2013-11-21 14:12:23 +1100452The supported ciphers are:
453.Pp
Damien Millerc1621c82014-04-20 13:22:46 +1000454.Bl -item -compact -offset indent
455.It
4563des-cbc
457.It
458aes128-cbc
459.It
460aes192-cbc
461.It
462aes256-cbc
463.It
464aes128-ctr
465.It
466aes192-ctr
467.It
468aes256-ctr
469.It
470aes128-gcm@openssh.com
471.It
472aes256-gcm@openssh.com
473.It
474arcfour
475.It
476arcfour128
477.It
478arcfour256
479.It
480blowfish-cbc
481.It
482cast128-cbc
483.It
484chacha20-poly1305@openssh.com
485.El
Damien Miller0fde8ac2013-11-21 14:12:23 +1100486.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100487The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000488.Bd -literal -offset indent
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000489chacha20-poly1305@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000490aes128-ctr,aes192-ctr,aes256-ctr,
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000491aes128-gcm@openssh.com,aes256-gcm@openssh.com
Ben Lindstrom9f049032002-06-21 00:59:05 +0000492.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100493.Pp
494The list of available ciphers may also be obtained using the
495.Fl Q
496option of
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000497.Xr ssh 1
498with an argument of
499.Dq cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000500.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100501Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000502sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100503.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000504receiving any messages back from the client.
505If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100506sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000507It is important to note that the use of client alive messages is very
508different from
Damien Miller12c150e2003-12-17 16:31:10 +1100509.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000510(below).
511The client alive messages are sent through the encrypted channel
512and therefore will not be spoofable.
513The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100514.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000515is spoofable.
516The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000517server depend on knowing when a connection has become inactive.
518.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000519The default value is 3.
520If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000521.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100522(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000523.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100524is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000525will be disconnected after approximately 45 seconds.
Damien Miller1594ad52005-05-26 12:12:19 +1000526.It Cm ClientAliveInterval
527Sets a timeout interval in seconds after which if no data has been received
528from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100529.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000530will send a message through the encrypted
531channel to request a response from the client.
532The default
533is 0, indicating that these messages will not be sent to the client.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000534.It Cm Compression
Damien Miller9786e6e2005-07-26 21:54:56 +1000535Specifies whether compression is allowed, or delayed until
536the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000537The argument must be
Damien Miller9786e6e2005-07-26 21:54:56 +1000538.Dq yes ,
539.Dq delayed ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000540or
541.Dq no .
542The default is
Damien Miller9786e6e2005-07-26 21:54:56 +1000543.Dq delayed .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000544.It Cm DenyGroups
545This keyword can be followed by a list of group name patterns, separated
546by spaces.
547Login is disallowed for users whose primary group or supplementary
548group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000549Only group names are valid; a numerical group ID is not recognized.
550By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100551The allow/deny directives are processed in the following order:
552.Cm DenyUsers ,
553.Cm AllowUsers ,
554.Cm DenyGroups ,
555and finally
556.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100557.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000558See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100559.Xr ssh_config 5
560for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000561.It Cm DenyUsers
562This keyword can be followed by a list of user name patterns, separated
563by spaces.
564Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000565Only user names are valid; a numerical user ID is not recognized.
566By default, login is allowed for all users.
567If the pattern takes the form USER@HOST then USER and HOST
568are separately checked, restricting logins to particular
569users from particular hosts.
jmc@openbsd.orgee1e0a12016-04-27 13:53:48 +0000570HOST criteria may additionally contain addresses to match in CIDR
571address/masklen format.
Damien Millerac73e512006-03-15 11:58:49 +1100572The allow/deny directives are processed in the following order:
573.Cm DenyUsers ,
574.Cm AllowUsers ,
575.Cm DenyGroups ,
576and finally
577.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100578.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000579See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100580.Xr ssh_config 5
581for more information on patterns.
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000582.It Cm FingerprintHash
583Specifies the hash algorithm used when logging key fingerprints.
584Valid options are:
585.Dq md5
586and
587.Dq sha256 .
588The default is
589.Dq sha256 .
Damien Millere2754432006-07-24 14:06:47 +1000590.It Cm ForceCommand
591Forces the execution of the command specified by
592.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100593ignoring any command supplied by the client and
594.Pa ~/.ssh/rc
595if present.
Damien Millere2754432006-07-24 14:06:47 +1000596The command is invoked by using the user's login shell with the -c option.
597This applies to shell, command, or subsystem execution.
598It is most useful inside a
599.Cm Match
600block.
601The command originally supplied by the client is available in the
602.Ev SSH_ORIGINAL_COMMAND
603environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100604Specifying a command of
605.Dq internal-sftp
606will force the use of an in-process sftp server that requires no support
607files when used with
608.Cm ChrootDirectory .
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000609The default is
610.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000611.It Cm GatewayPorts
612Specifies whether remote hosts are allowed to connect to ports
613forwarded for the client.
614By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100615.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000616binds remote port forwardings to the loopback address.
617This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000618.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100619can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100620should allow remote port forwardings to bind to non-loopback addresses, thus
621allowing other hosts to connect.
622The argument may be
623.Dq no
624to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000625.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100626to force remote port forwardings to bind to the wildcard address, or
627.Dq clientspecified
628to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000629The default is
630.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000631.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000632Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100633The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000634.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000635.It Cm GSSAPICleanupCredentials
636Specifies whether to automatically destroy the user's credentials cache
637on logout.
638The default is
639.Dq yes .
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000640.It Cm GSSAPIStrictAcceptorCheck
641Determines whether to be strict about the identity of the GSSAPI acceptor
642a client authenticates against.
643If set to
644.Dq yes
645then the client must authenticate against the
646.Pa host
647service on the current hostname.
648If set to
649.Dq no
650then the client may authenticate against any service key stored in the
651machine's default store.
652This facility is provided to assist with operation on multi homed machines.
653The default is
654.Dq yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000655.It Cm HostbasedAcceptedKeyTypes
656Specifies the key types that will be accepted for hostbased authentication
657as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000658Alternately if the specified value begins with a
659.Sq +
660character, then the specified key types will be appended to the default set
661instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000662The default for this option is:
663.Bd -literal -offset 3n
664ecdsa-sha2-nistp256-cert-v01@openssh.com,
665ecdsa-sha2-nistp384-cert-v01@openssh.com,
666ecdsa-sha2-nistp521-cert-v01@openssh.com,
667ssh-ed25519-cert-v01@openssh.com,
668ssh-rsa-cert-v01@openssh.com,
669ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +0000670ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000671.Ed
672.Pp
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000673The
674.Fl Q
675option of
676.Xr ssh 1
677may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000678.It Cm HostbasedAuthentication
679Specifies whether rhosts or /etc/hosts.equiv authentication together
680with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100681(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000682The default is
683.Dq no .
Damien Millerb594f382006-08-30 11:06:34 +1000684.It Cm HostbasedUsesNameFromPacketOnly
685Specifies whether or not the server will attempt to perform a reverse
686name lookup when matching the name in the
687.Pa ~/.shosts ,
688.Pa ~/.rhosts ,
689and
690.Pa /etc/hosts.equiv
691files during
692.Cm HostbasedAuthentication .
693A setting of
694.Dq yes
695means that
696.Xr sshd 8
697uses the name supplied by the client rather than
698attempting to resolve the name from the TCP connection itself.
699The default is
700.Dq no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100701.It Cm HostCertificate
702Specifies a file containing a public host certificate.
703The certificate's public key must match a private host key already specified
704by
705.Cm HostKey .
706The default behaviour of
707.Xr sshd 8
708is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000709.It Cm HostKey
710Specifies a file containing a private host key
711used by SSH.
712The default is
713.Pa /etc/ssh/ssh_host_key
714for protocol version 1, and
Damien Millereb8b60e2010-08-31 22:41:14 +1000715.Pa /etc/ssh/ssh_host_dsa_key ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100716.Pa /etc/ssh/ssh_host_ecdsa_key ,
717.Pa /etc/ssh/ssh_host_ed25519_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000718and
Damien Millereb8b60e2010-08-31 22:41:14 +1000719.Pa /etc/ssh/ssh_host_rsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000720for protocol version 2.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000721.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000722Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100723.Xr sshd 8
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000724will refuse to use a file if it is group/world-accessible
725and that the
726.Cm HostKeyAlgorithms
727option restricts which of the keys are actually used by
728.Xr sshd 8 .
729.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000730It is possible to have multiple host key files.
731.Dq rsa1
732keys are used for version 1 and
Damien Millereb8b60e2010-08-31 22:41:14 +1000733.Dq dsa ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100734.Dq ecdsa ,
735.Dq ed25519
Ben Lindstrom9f049032002-06-21 00:59:05 +0000736or
737.Dq rsa
738are used for version 2 of the SSH protocol.
Damien Miller85b45e02013-07-20 13:21:52 +1000739It is also possible to specify public host key files instead.
740In this case operations on the private key will be delegated
741to an
742.Xr ssh-agent 1 .
743.It Cm HostKeyAgent
744Identifies the UNIX-domain socket used to communicate
745with an agent that has access to the private host keys.
markus@openbsd.org1a75d142016-05-04 14:29:58 +0000746If the string
Damien Miller85b45e02013-07-20 13:21:52 +1000747.Dq SSH_AUTH_SOCK
748is specified, the location of the socket will be read from the
749.Ev SSH_AUTH_SOCK
750environment variable.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000751.It Cm HostKeyAlgorithms
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000752Specifies the host key algorithms
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000753that the server offers.
754The default for this option is:
755.Bd -literal -offset 3n
756ecdsa-sha2-nistp256-cert-v01@openssh.com,
757ecdsa-sha2-nistp384-cert-v01@openssh.com,
758ecdsa-sha2-nistp521-cert-v01@openssh.com,
759ssh-ed25519-cert-v01@openssh.com,
760ssh-rsa-cert-v01@openssh.com,
761ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +0000762ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000763.Ed
764.Pp
765The list of available key types may also be obtained using the
766.Fl Q
767option of
768.Xr ssh 1
769with an argument of
770.Dq key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000771.It Cm IgnoreRhosts
772Specifies that
773.Pa .rhosts
774and
775.Pa .shosts
776files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000777.Cm RhostsRSAAuthentication
778or
779.Cm HostbasedAuthentication .
780.Pp
781.Pa /etc/hosts.equiv
782and
783.Pa /etc/shosts.equiv
784are still used.
785The default is
786.Dq yes .
787.It Cm IgnoreUserKnownHosts
788Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100789.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000790should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000791.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000792during
793.Cm RhostsRSAAuthentication
794or
795.Cm HostbasedAuthentication .
796The default is
797.Dq no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100798.It Cm IPQoS
799Specifies the IPv4 type-of-service or DSCP class for the connection.
800Accepted values are
801.Dq af11 ,
802.Dq af12 ,
803.Dq af13 ,
Damien Millerf6e758c2011-09-22 21:37:13 +1000804.Dq af21 ,
Damien Miller0dac6fb2010-11-20 15:19:38 +1100805.Dq af22 ,
806.Dq af23 ,
807.Dq af31 ,
808.Dq af32 ,
809.Dq af33 ,
810.Dq af41 ,
811.Dq af42 ,
812.Dq af43 ,
813.Dq cs0 ,
814.Dq cs1 ,
815.Dq cs2 ,
816.Dq cs3 ,
817.Dq cs4 ,
818.Dq cs5 ,
819.Dq cs6 ,
820.Dq cs7 ,
821.Dq ef ,
822.Dq lowdelay ,
823.Dq throughput ,
824.Dq reliability ,
825or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +1100826This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100827If one argument is specified, it is used as the packet class unconditionally.
828If two values are specified, the first is automatically selected for
829interactive sessions and the second for non-interactive sessions.
830The default is
831.Dq lowdelay
832for interactive sessions and
833.Dq throughput
834for non-interactive sessions.
Damien Millere1e480a2014-02-04 11:13:17 +1100835.It Cm KbdInteractiveAuthentication
836Specifies whether to allow keyboard-interactive authentication.
837The argument to this keyword must be
838.Dq yes
839or
840.Dq no .
841The default is to use whatever value
842.Cm ChallengeResponseAuthentication
843is set to
844(by default
845.Dq yes ) .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000846.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000847Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000848.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000849will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000850To use this option, the server needs a
851Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100852The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000853.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100854.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000855If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100856an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100857The default is
Damien Miller8448e662004-03-08 23:13:15 +1100858.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000859.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100860If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000861the password will be validated via any additional local mechanism
862such as
863.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100864The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000865.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000866.It Cm KerberosTicketCleanup
867Specifies whether to automatically destroy the user's ticket cache
868file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100869The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000870.Dq yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000871.It Cm KexAlgorithms
872Specifies the available KEX (Key Exchange) algorithms.
873Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000874Alternately if the specified value begins with a
875.Sq +
876character, then the specified methods will be appended to the default set
877instead of replacing them.
Damien Millerc1621c82014-04-20 13:22:46 +1000878The supported algorithms are:
879.Pp
880.Bl -item -compact -offset indent
881.It
882curve25519-sha256@libssh.org
883.It
884diffie-hellman-group1-sha1
885.It
886diffie-hellman-group14-sha1
887.It
888diffie-hellman-group-exchange-sha1
889.It
890diffie-hellman-group-exchange-sha256
891.It
892ecdh-sha2-nistp256
893.It
894ecdh-sha2-nistp384
895.It
896ecdh-sha2-nistp521
897.El
898.Pp
899The default is:
Damien Miller6575c3a2013-12-18 17:47:02 +1100900.Bd -literal -offset indent
901curve25519-sha256@libssh.org,
902ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
903diffie-hellman-group-exchange-sha256,
Damien Millerc1621c82014-04-20 13:22:46 +1000904diffie-hellman-group14-sha1
Damien Miller6575c3a2013-12-18 17:47:02 +1100905.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000906.Pp
907The list of available key exchange algorithms may also be obtained using the
908.Fl Q
909option of
910.Xr ssh 1
911with an argument of
912.Dq kex .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000913.It Cm KeyRegenerationInterval
914In protocol version 1, the ephemeral server key is automatically regenerated
915after this many seconds (if it has been used).
916The purpose of regeneration is to prevent
917decrypting captured sessions by later breaking into the machine and
918stealing the keys.
919The key is never stored anywhere.
920If the value is 0, the key is never regenerated.
921The default is 3600 (seconds).
922.It Cm ListenAddress
923Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100924.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000925should listen on.
926The following forms may be used:
927.Pp
928.Bl -item -offset indent -compact
929.It
930.Cm ListenAddress
931.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000932.Ar host | Ar IPv4_addr | Ar IPv6_addr
Ben Lindstrom9f049032002-06-21 00:59:05 +0000933.Sm on
934.It
935.Cm ListenAddress
936.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000937.Ar host | Ar IPv4_addr : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000938.Sm on
939.It
940.Cm ListenAddress
941.Sm off
942.Oo
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000943.Ar host | Ar IPv6_addr Oc : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000944.Sm on
945.El
946.Pp
947If
948.Ar port
949is not specified,
dtucker@openbsd.org531a57a2015-04-29 03:48:56 +0000950sshd will listen on the address and all
Ben Lindstrom9f049032002-06-21 00:59:05 +0000951.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000952options specified.
953The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000954Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000955.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000956options are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000957.It Cm LoginGraceTime
958The server disconnects after this time if the user has not
959successfully logged in.
960If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000961The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000962.It Cm LogLevel
963Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100964.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000965The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100966QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000967The default is INFO.
968DEBUG and DEBUG1 are equivalent.
969DEBUG2 and DEBUG3 each specify higher levels of debugging output.
970Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000971.It Cm MACs
972Specifies the available MAC (message authentication code) algorithms.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000973The MAC algorithm is used for data integrity protection.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000974Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000975If the specified value begins with a
976.Sq +
977character, then the specified algorithms will be appended to the default set
978instead of replacing them.
979.Pp
Damien Milleraf43a7a2012-12-12 10:46:31 +1100980The algorithms that contain
981.Dq -etm
982calculate the MAC after encryption (encrypt-then-mac).
983These are considered safer and their use recommended.
Damien Millerc1621c82014-04-20 13:22:46 +1000984The supported MACs are:
985.Pp
986.Bl -item -compact -offset indent
987.It
988hmac-md5
989.It
990hmac-md5-96
991.It
992hmac-ripemd160
993.It
994hmac-sha1
995.It
996hmac-sha1-96
997.It
998hmac-sha2-256
999.It
1000hmac-sha2-512
1001.It
1002umac-64@openssh.com
1003.It
1004umac-128@openssh.com
1005.It
1006hmac-md5-etm@openssh.com
1007.It
1008hmac-md5-96-etm@openssh.com
1009.It
1010hmac-ripemd160-etm@openssh.com
1011.It
1012hmac-sha1-etm@openssh.com
1013.It
1014hmac-sha1-96-etm@openssh.com
1015.It
1016hmac-sha2-256-etm@openssh.com
1017.It
1018hmac-sha2-512-etm@openssh.com
1019.It
1020umac-64-etm@openssh.com
1021.It
1022umac-128-etm@openssh.com
1023.El
1024.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +11001025The default is:
Damien Miller22b7b492007-06-11 14:07:12 +10001026.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +11001027umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1028hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001029hmac-sha1-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +10001030umac-64@openssh.com,umac-128@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001031hmac-sha2-256,hmac-sha2-512,hmac-sha1
Damien Miller22b7b492007-06-11 14:07:12 +10001032.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001033.Pp
1034The list of available MAC algorithms may also be obtained using the
1035.Fl Q
1036option of
1037.Xr ssh 1
1038with an argument of
1039.Dq mac .
Darren Tucker45150472006-07-12 22:34:17 +10001040.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +10001041Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +10001042If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +10001043.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001044line are satisfied, the keywords on the following lines override those
1045set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +10001046.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001047line or the end of the file.
Damien Millerfc5d6752014-02-28 10:01:28 +11001048If a keyword appears in multiple
1049.Cm Match
sobrado@openbsd.org180bcb42014-08-30 16:32:25 +00001050blocks that are satisfied, only the first instance of the keyword is
Damien Millerfc5d6752014-02-28 10:01:28 +11001051applied.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001052.Pp
Damien Millerd04f3572006-07-24 13:46:50 +10001053The arguments to
Darren Tucker45150472006-07-12 22:34:17 +10001054.Cm Match
Damien Millercf31f382013-10-24 21:02:56 +11001055are one or more criteria-pattern pairs or the single token
1056.Cm All
1057which matches all criteria.
Darren Tucker45150472006-07-12 22:34:17 +10001058The available criteria are
1059.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +10001060.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +10001061.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +10001062.Cm LocalAddress ,
1063.Cm LocalPort ,
Darren Tucker45150472006-07-12 22:34:17 +10001064and
1065.Cm Address .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001066The match patterns may consist of single entries or comma-separated
1067lists and may use the wildcard and negation operators described in the
Damien Millerfecfd112013-07-18 16:11:50 +10001068PATTERNS section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +10001069.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001070.Pp
1071The patterns in an
1072.Cm Address
1073criteria may additionally contain addresses to match in CIDR
Darren Tucker6a2a4002008-06-10 23:03:04 +10001074address/masklen format, e.g.\&
Darren Tucker7a3935d2008-06-10 22:59:10 +10001075.Dq 192.0.2.0/24
1076or
1077.Dq 3ffe:ffff::/32 .
1078Note that the mask length provided must be consistent with the address -
1079it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +10001080or one with bits set in this host portion of the address.
1081For example,
Darren Tucker7a3935d2008-06-10 22:59:10 +10001082.Dq 192.0.2.0/33
1083and
Darren Tucker6a2a4002008-06-10 23:03:04 +10001084.Dq 192.0.2.0/8
Darren Tucker7a3935d2008-06-10 22:59:10 +10001085respectively.
1086.Pp
Darren Tucker45150472006-07-12 22:34:17 +10001087Only a subset of keywords may be used on the lines following a
1088.Cm Match
1089keyword.
1090Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +10001091.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +11001092.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +10001093.Cm AllowGroups ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001094.Cm AllowStreamLocalForwarding ,
Damien Miller9b439df2006-07-24 14:04:00 +10001095.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +10001096.Cm AllowUsers ,
Damien Millera6e3f012012-11-04 23:21:40 +11001097.Cm AuthenticationMethods ,
Damien Miller09d3e122012-10-31 08:58:58 +11001098.Cm AuthorizedKeysCommand ,
1099.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +11001100.Cm AuthorizedKeysFile ,
djm@openbsd.orgb6b91082015-11-13 02:57:46 +00001101.Cm AuthorizedPrincipalsCommand ,
1102.Cm AuthorizedPrincipalsCommandUser ,
Damien Millerab6de352010-06-26 09:38:45 +10001103.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +11001104.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +10001105.Cm ChrootDirectory ,
Damien Millerc24da772012-06-20 21:53:58 +10001106.Cm DenyGroups ,
1107.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +10001108.Cm ForceCommand ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001109.Cm GatewayPorts ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +00001110.Cm GSSAPIAuthentication ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001111.Cm HostbasedAcceptedKeyTypes ,
Damien Miller25434de2008-05-19 14:29:08 +10001112.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +10001113.Cm HostbasedUsesNameFromPacketOnly ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001114.Cm IPQoS ,
Darren Tucker1d75f222007-03-01 21:31:28 +11001115.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +11001116.Cm KerberosAuthentication ,
Damien Miller307c1d12008-06-16 07:56:20 +10001117.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +10001118.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +11001119.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +11001120.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +10001121.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +11001122.Cm PermitRootLogin ,
Damien Miller5ff30c62013-10-30 22:21:50 +11001123.Cm PermitTTY ,
Damien Millerab6de352010-06-26 09:38:45 +10001124.Cm PermitTunnel ,
Damien Miller72e6b5c2014-07-04 09:00:04 +10001125.Cm PermitUserRC ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001126.Cm PubkeyAcceptedKeyTypes ,
Darren Tucker1477ea12009-10-07 08:36:05 +11001127.Cm PubkeyAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001128.Cm RekeyLimit ,
1129.Cm RevokedKeys ,
1130.Cm RhostsRSAAuthentication ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +00001131.Cm RSAAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001132.Cm StreamLocalBindMask ,
1133.Cm StreamLocalBindUnlink ,
1134.Cm TrustedUserCAKeys ,
Damien Millerd1de9952006-07-24 14:05:48 +10001135.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +11001136.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +10001137and
Damien Miller0296ae82009-02-23 11:00:24 +11001138.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +10001139.It Cm MaxAuthTries
1140Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +10001141connection.
1142Once the number of failures reaches half this value,
1143additional failures are logged.
1144The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +10001145.It Cm MaxSessions
djm@openbsd.orgcac3b662016-02-05 02:37:56 +00001146Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1147sessions permitted per network connection.
1148Multiple sessions may be established by clients that support connection
1149multiplexing.
1150Setting
1151.Cm MaxSessions
1152to 1 will effectively disable session multiplexing, whereas setting it to 0
1153will prevent all shell, login and subsystem sessions while still permitting
1154forwarding.
Damien Miller7207f642008-05-19 15:34:50 +10001155The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001156.It Cm MaxStartups
1157Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001158SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001159Additional connections will be dropped until authentication succeeds or the
1160.Cm LoginGraceTime
1161expires for a connection.
Damien Miller1f583df2013-02-12 11:02:08 +11001162The default is 10:30:100.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001163.Pp
1164Alternatively, random early drop can be enabled by specifying
1165the three colon separated values
1166.Dq start:rate:full
Damien Miller208f1ed2006-03-15 11:56:03 +11001167(e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +11001168.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001169will refuse connection attempts with a probability of
1170.Dq rate/100
1171(30%)
1172if there are currently
1173.Dq start
1174(10)
1175unauthenticated connections.
1176The probability increases linearly and all connection attempts
1177are refused if the number of unauthenticated connections reaches
1178.Dq full
1179(60).
1180.It Cm PasswordAuthentication
1181Specifies whether password authentication is allowed.
1182The default is
1183.Dq yes .
1184.It Cm PermitEmptyPasswords
1185When password authentication is allowed, it specifies whether the
1186server allows login to accounts with empty password strings.
1187The default is
1188.Dq no .
Damien Miller9b439df2006-07-24 14:04:00 +10001189.It Cm PermitOpen
1190Specifies the destinations to which TCP port forwarding is permitted.
1191The forwarding specification must be one of the following forms:
1192.Pp
1193.Bl -item -offset indent -compact
1194.It
1195.Cm PermitOpen
1196.Sm off
1197.Ar host : port
1198.Sm on
1199.It
1200.Cm PermitOpen
1201.Sm off
1202.Ar IPv4_addr : port
1203.Sm on
1204.It
1205.Cm PermitOpen
1206.Sm off
1207.Ar \&[ IPv6_addr \&] : port
1208.Sm on
1209.El
1210.Pp
Damien Millera765cf42006-07-24 14:08:13 +10001211Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +10001212An argument of
1213.Dq any
1214can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +10001215An argument of
1216.Dq none
1217can be used to prohibit all forwarding requests.
Damien Miller65bc2c42006-07-24 14:04:16 +10001218By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001219.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +11001220Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +00001221.Xr ssh 1 .
1222The argument must be
1223.Dq yes ,
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001224.Dq prohibit-password ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001225.Dq without-password ,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001226.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001227or
1228.Dq no .
1229The default is
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001230.Dq prohibit-password .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001231.Pp
1232If this option is set to
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001233.Dq prohibit-password
1234or
Damien Miller5b0d63f2006-03-15 11:56:56 +11001235.Dq without-password ,
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001236password and keyboard-interactive authentication are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001237.Pp
1238If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001239.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001240root login with public key authentication will be allowed,
1241but only if the
1242.Ar command
1243option has been specified
1244(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +10001245normally not allowed).
1246All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001247.Pp
1248If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001249.Dq no ,
Darren Tuckerb3509012005-01-20 11:01:46 +11001250root is not allowed to log in.
Damien Millerd27b9472005-12-13 19:29:02 +11001251.It Cm PermitTunnel
1252Specifies whether
1253.Xr tun 4
1254device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +11001255The argument must be
1256.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +10001257.Dq point-to-point
1258(layer 3),
1259.Dq ethernet
1260(layer 2), or
Damien Miller7b58e802005-12-13 19:33:19 +11001261.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +10001262Specifying
1263.Dq yes
1264permits both
1265.Dq point-to-point
1266and
1267.Dq ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +11001268The default is
1269.Dq no .
djm@openbsd.org48dffd52014-09-09 09:45:36 +00001270.Pp
1271Independent of this setting, the permissions of the selected
1272.Xr tun 4
1273device must allow access to the user.
Damien Miller5ff30c62013-10-30 22:21:50 +11001274.It Cm PermitTTY
1275Specifies whether
Damien Miller63857c92013-10-30 22:31:06 +11001276.Xr pty 4
Damien Miller5ff30c62013-10-30 22:21:50 +11001277allocation is permitted.
1278The default is
1279.Dq yes .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001280.It Cm PermitUserEnvironment
1281Specifies whether
1282.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001283and
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001284.Cm environment=
1285options in
1286.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001287are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +11001288.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001289The default is
1290.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001291Enabling environment processing may enable users to bypass access
1292restrictions in some configurations using mechanisms such as
1293.Ev LD_PRELOAD .
Damien Miller72e6b5c2014-07-04 09:00:04 +10001294.It Cm PermitUserRC
1295Specifies whether any
1296.Pa ~/.ssh/rc
1297file is executed.
1298The default is
1299.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001300.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +00001301Specifies the file that contains the process ID of the
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001302SSH daemon, or
1303.Dq none
1304to not write one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001305The default is
1306.Pa /var/run/sshd.pid .
1307.It Cm Port
1308Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +11001309.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001310listens on.
1311The default is 22.
1312Multiple options of this type are permitted.
1313See also
1314.Cm ListenAddress .
1315.It Cm PrintLastLog
1316Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001317.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +11001318should print the date and time of the last user login when a user logs
1319in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001320The default is
1321.Dq yes .
1322.It Cm PrintMotd
1323Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001324.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001325should print
1326.Pa /etc/motd
1327when a user logs in interactively.
1328(On some systems it is also printed by the shell,
1329.Pa /etc/profile ,
1330or equivalent.)
1331The default is
1332.Dq yes .
1333.It Cm Protocol
1334Specifies the protocol versions
Damien Miller5b0d63f2006-03-15 11:56:56 +11001335.Xr sshd 8
Ben Lindstrom9c445542002-07-11 03:59:18 +00001336supports.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001337The possible values are
Damien Miller5b0d63f2006-03-15 11:56:56 +11001338.Sq 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001339and
Damien Miller5b0d63f2006-03-15 11:56:56 +11001340.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001341Multiple versions must be comma-separated.
1342The default is
Darren Tucker7a4a7652009-10-11 21:51:40 +11001343.Sq 2 .
djm@openbsd.orge7901ef2016-02-16 05:11:04 +00001344Protocol 1 suffers from a number of cryptographic weaknesses and should
1345not be used.
1346It is only offered to support legacy devices.
1347.Pp
Ben Lindstrom9c445542002-07-11 03:59:18 +00001348Note that the order of the protocol list does not indicate preference,
1349because the client selects among multiple protocol versions offered
1350by the server.
1351Specifying
1352.Dq 2,1
1353is identical to
1354.Dq 1,2 .
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001355.It Cm PubkeyAcceptedKeyTypes
1356Specifies the key types that will be accepted for public key authentication
1357as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001358Alternately if the specified value begins with a
1359.Sq +
1360character, then the specified key types will be appended to the default set
1361instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001362The default for this option is:
1363.Bd -literal -offset 3n
1364ecdsa-sha2-nistp256-cert-v01@openssh.com,
1365ecdsa-sha2-nistp384-cert-v01@openssh.com,
1366ecdsa-sha2-nistp521-cert-v01@openssh.com,
1367ssh-ed25519-cert-v01@openssh.com,
1368ssh-rsa-cert-v01@openssh.com,
1369ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +00001370ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001371.Ed
1372.Pp
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001373The
1374.Fl Q
1375option of
1376.Xr ssh 1
1377may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001378.It Cm PubkeyAuthentication
1379Specifies whether public key authentication is allowed.
1380The default is
1381.Dq yes .
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001382.It Cm RekeyLimit
1383Specifies the maximum amount of data that may be transmitted before the
1384session key is renegotiated, optionally followed a maximum amount of
1385time that may pass before the session key is renegotiated.
1386The first argument is specified in bytes and may have a suffix of
1387.Sq K ,
1388.Sq M ,
1389or
1390.Sq G
1391to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1392The default is between
1393.Sq 1G
1394and
1395.Sq 4G ,
1396depending on the cipher.
1397The optional second value is specified in seconds and may use any of the
1398units documented in the
1399.Sx TIME FORMATS
Darren Tucker64d22942013-05-16 20:31:29 +10001400section.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001401The default value for
1402.Cm RekeyLimit
1403is
1404.Dq default none ,
1405which means that rekeying is performed after the cipher's default amount
1406of data has been sent or received and no time based rekeying is done.
Damien Miller1aed65e2010-03-04 21:53:35 +11001407.It Cm RevokedKeys
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001408Specifies revoked public keys file, or
1409.Dq none
1410to not use one.
Damien Miller1aed65e2010-03-04 21:53:35 +11001411Keys listed in this file will be refused for public key authentication.
1412Note that if this file is not readable, then public key authentication will
1413be refused for all users.
Damien Millerf3747bf2013-01-18 11:44:04 +11001414Keys may be specified as a text file, listing one public key per line, or as
1415an OpenSSH Key Revocation List (KRL) as generated by
Damien Miller72abeb72013-01-20 22:33:44 +11001416.Xr ssh-keygen 1 .
Damien Millerfecfd112013-07-18 16:11:50 +10001417For more information on KRLs, see the KEY REVOCATION LISTS section in
Damien Millerf3747bf2013-01-18 11:44:04 +11001418.Xr ssh-keygen 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001419.It Cm RhostsRSAAuthentication
1420Specifies whether rhosts or /etc/hosts.equiv authentication together
1421with successful RSA host authentication is allowed.
1422The default is
1423.Dq no .
1424This option applies to protocol version 1 only.
1425.It Cm RSAAuthentication
1426Specifies whether pure RSA authentication is allowed.
1427The default is
1428.Dq yes .
1429This option applies to protocol version 1 only.
1430.It Cm ServerKeyBits
1431Defines the number of bits in the ephemeral protocol version 1 server key.
djm@openbsd.org933935c2015-07-03 03:49:45 +00001432The default and minimum value is 1024.
Damien Miller7acefbb2014-07-18 14:11:24 +10001433.It Cm StreamLocalBindMask
1434Sets the octal file creation mode mask
1435.Pq umask
1436used when creating a Unix-domain socket file for local or remote
1437port forwarding.
1438This option is only used for port forwarding to a Unix-domain socket file.
1439.Pp
1440The default value is 0177, which creates a Unix-domain socket file that is
1441readable and writable only by the owner.
1442Note that not all operating systems honor the file mode on Unix-domain
1443socket files.
1444.It Cm StreamLocalBindUnlink
1445Specifies whether to remove an existing Unix-domain socket file for local
1446or remote port forwarding before creating a new one.
1447If the socket file already exists and
1448.Cm StreamLocalBindUnlink
1449is not enabled,
1450.Nm sshd
1451will be unable to forward the port to the Unix-domain socket file.
1452This option is only used for port forwarding to a Unix-domain socket file.
1453.Pp
1454The argument must be
1455.Dq yes
1456or
1457.Dq no .
1458The default is
1459.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001460.It Cm StrictModes
1461Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001462.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001463should check file modes and ownership of the
1464user's files and home directory before accepting login.
1465This is normally desirable because novices sometimes accidentally leave their
1466directory or files world-writable.
1467The default is
1468.Dq yes .
Darren Tuckerf788a912010-01-08 17:06:47 +11001469Note that this does not apply to
1470.Cm ChrootDirectory ,
1471whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001472.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +11001473Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +10001474Arguments should be a subsystem name and a command (with optional arguments)
1475to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001476.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001477The command
1478.Xr sftp-server 8
1479implements the
1480.Dq sftp
1481file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001482.Pp
1483Alternately the name
1484.Dq internal-sftp
1485implements an in-process
1486.Dq sftp
1487server.
1488This may simplify configurations using
1489.Cm ChrootDirectory
1490to force a different filesystem root on clients.
1491.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001492By default no subsystems are defined.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001493.It Cm SyslogFacility
1494Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001495.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001496The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1497LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1498The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001499.It Cm TCPKeepAlive
1500Specifies whether the system should send TCP keepalive messages to the
1501other side.
1502If they are sent, death of the connection or crash of one
1503of the machines will be properly noticed.
1504However, this means that
1505connections will die if the route is down temporarily, and some people
1506find it annoying.
1507On the other hand, if TCP keepalives are not sent,
1508sessions may hang indefinitely on the server, leaving
1509.Dq ghost
1510users and consuming server resources.
1511.Pp
1512The default is
1513.Dq yes
1514(to send TCP keepalive messages), and the server will notice
1515if the network goes down or the client host crashes.
1516This avoids infinitely hanging sessions.
1517.Pp
1518To disable TCP keepalive messages, the value should be set to
1519.Dq no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001520.It Cm TrustedUserCAKeys
1521Specifies a file containing public keys of certificate authorities that are
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001522trusted to sign user certificates for authentication, or
1523.Dq none
1524to not use one.
Damien Miller72b33822010-03-05 07:39:01 +11001525Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001526.Ql #
1527are allowed.
1528If a certificate is presented for authentication and has its signing CA key
1529listed in this file, then it may be used for authentication for any user
1530listed in the certificate's principals list.
1531Note that certificates that lack a list of principals will not be permitted
1532for authentication using
1533.Cm TrustedUserCAKeys .
Damien Millerfecfd112013-07-18 16:11:50 +10001534For more details on certificates, see the CERTIFICATES section in
Damien Miller1aed65e2010-03-04 21:53:35 +11001535.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001536.It Cm UseDNS
1537Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001538.Xr sshd 8
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001539should look up the remote host name, and to check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001540the resolved host name for the remote IP address maps back to the
1541very same IP address.
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001542.Pp
1543If this option is set to
1544.Dq no
1545(the default) then only addresses and not host names may be used in
djm@openbsd.org0235a5f2016-03-17 17:19:43 +00001546.Pa ~/.ssh/authorized_keys
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001547.Cm from
1548and
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +00001549.Nm
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001550.Cm Match
1551.Cm Host
1552directives.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001553.It Cm UseLogin
1554Specifies whether
1555.Xr login 1
1556is used for interactive login sessions.
1557The default is
1558.Dq no .
1559Note that
1560.Xr login 1
1561is never used for remote command execution.
1562Note also, that if this is enabled,
1563.Cm X11Forwarding
1564will be disabled because
1565.Xr login 1
1566does not know how to handle
1567.Xr xauth 1
Damien Miller495dca32003-04-01 21:42:14 +10001568cookies.
1569If
Ben Lindstrom9f049032002-06-21 00:59:05 +00001570.Cm UsePrivilegeSeparation
1571is specified, it will be disabled after authentication.
Damien Miller2e193e22003-05-14 15:13:03 +10001572.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001573Enables the Pluggable Authentication Module interface.
1574If set to
1575.Dq yes
1576this will enable PAM authentication using
1577.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001578and
1579.Cm PasswordAuthentication
1580in addition to PAM account and session module processing for all
1581authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001582.Pp
1583Because PAM challenge-response authentication usually serves an equivalent
1584role to password authentication, you should disable either
1585.Cm PasswordAuthentication
1586or
1587.Cm ChallengeResponseAuthentication.
1588.Pp
1589If
1590.Cm UsePAM
1591is enabled, you will not be able to run
1592.Xr sshd 8
1593as a non-root user.
1594The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +10001595.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001596.It Cm UsePrivilegeSeparation
1597Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001598.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001599separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +10001600to deal with incoming network traffic.
1601After successful authentication, another process will be created that has
1602the privilege of the authenticated user.
1603The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +00001604escalation by containing any corruption within the unprivileged processes.
sobrado@openbsd.orgbdcb73f2015-10-07 14:45:30 +00001605The argument must be
1606.Dq yes ,
1607.Dq no ,
1608or
1609.Dq sandbox .
Damien Miller69ff1df2011-06-23 08:30:03 +10001610If
1611.Cm UsePrivilegeSeparation
1612is set to
1613.Dq sandbox
1614then the pre-authentication unprivileged process is subject to additional
1615restrictions.
sobrado@openbsd.orgbdcb73f2015-10-07 14:45:30 +00001616The default is
1617.Dq sandbox .
Damien Miller23528812012-04-22 11:24:43 +10001618.It Cm VersionAddendum
1619Optionally specifies additional text to append to the SSH protocol banner
1620sent by the server upon connection.
1621The default is
1622.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001623.It Cm X11DisplayOffset
1624Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001625.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001626X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001627This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001628The default is 10.
1629.It Cm X11Forwarding
1630Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001631The argument must be
1632.Dq yes
1633or
1634.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001635The default is
1636.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +10001637.Pp
1638When X11 forwarding is enabled, there may be additional exposure to
1639the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001640.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001641proxy display is configured to listen on the wildcard address (see
1642.Cm X11UseLocalhost
Damien Miller5b0d63f2006-03-15 11:56:56 +11001643below), though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001644Additionally, the authentication spoofing and authentication data
1645verification and substitution occur on the client side.
1646The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001647display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001648forwarding (see the warnings for
1649.Cm ForwardX11
1650in
Damien Millerf1ce5052003-06-11 22:04:39 +10001651.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001652A system administrator may have a stance in which they want to
1653protect clients that may expose themselves to attack by unwittingly
1654requesting X11 forwarding, which can warrant a
1655.Dq no
1656setting.
1657.Pp
1658Note that disabling X11 forwarding does not prevent users from
1659forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001660X11 forwarding is automatically disabled if
1661.Cm UseLogin
1662is enabled.
1663.It Cm X11UseLocalhost
1664Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001665.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001666should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001667the wildcard address.
1668By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001669sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001670hostname part of the
1671.Ev DISPLAY
1672environment variable to
1673.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001674This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001675However, some older X11 clients may not function with this
1676configuration.
1677.Cm X11UseLocalhost
1678may be set to
1679.Dq no
1680to specify that the forwarding server should be bound to the wildcard
1681address.
1682The argument must be
1683.Dq yes
1684or
1685.Dq no .
1686The default is
1687.Dq yes .
1688.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001689Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001690.Xr xauth 1
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001691program, or
1692.Dq none
1693to not use one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001694The default is
1695.Pa /usr/X11R6/bin/xauth .
1696.El
Damien Millere3beba22006-03-15 11:59:25 +11001697.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001698.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001699command-line arguments and configuration file options that specify time
1700may be expressed using a sequence of the form:
1701.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001702.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001703.Sm on
1704where
1705.Ar time
1706is a positive integer value and
1707.Ar qualifier
1708is one of the following:
1709.Pp
1710.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001711.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001712seconds
1713.It Cm s | Cm S
1714seconds
1715.It Cm m | Cm M
1716minutes
1717.It Cm h | Cm H
1718hours
1719.It Cm d | Cm D
1720days
1721.It Cm w | Cm W
1722weeks
1723.El
1724.Pp
1725Each member of the sequence is added together to calculate
1726the total time value.
1727.Pp
1728Time format examples:
1729.Pp
1730.Bl -tag -width Ds -compact -offset indent
1731.It 600
1732600 seconds (10 minutes)
1733.It 10m
173410 minutes
1735.It 1h30m
17361 hour 30 minutes (90 minutes)
1737.El
1738.Sh FILES
1739.Bl -tag -width Ds
1740.It Pa /etc/ssh/sshd_config
1741Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001742.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001743This file should be writable by root only, but it is recommended
1744(though not necessary) that it be world-readable.
1745.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001746.Sh SEE ALSO
1747.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001748.Sh AUTHORS
1749OpenSSH is a derivative of the original and free
1750ssh 1.2.12 release by Tatu Ylonen.
1751Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1752Theo de Raadt and Dug Song
1753removed many bugs, re-added newer features and
1754created OpenSSH.
1755Markus Friedl contributed the support for SSH
1756protocol versions 1.5 and 2.0.
1757Niels Provos and Markus Friedl contributed support
1758for privilege separation.