blob: 3eb1bb8e0cf7c9c3b4aa3554da18ea966fc3f38f [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.orgb6b91082015-11-13 02:57:46 +000036.\" $OpenBSD: sshd_config.5,v 1.214 2015/11/13 02:57:46 djm Exp $
37.Dd $Mdocdate: November 13 2015 $
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.
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +000073Note that environment passing is only supported for protocol 2, and
74that the
75.Ev TERM
jmc@openbsd.orgc1d5bcf2015-04-28 13:47:38 +000076environment variable is always sent whenever the client
djm@openbsd.org732d61f2015-06-05 03:44:14 +000077requests a pseudo-terminal as it is required by the protocol.
Darren Tucker46bc0752004-05-02 22:11:30 +100078Variables are specified by name, which may contain the wildcard characters
Damien Miller208f1ed2006-03-15 11:56:03 +110079.Ql *
Darren Tucker46bc0752004-05-02 22:11:30 +100080and
81.Ql \&? .
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100082Multiple environment variables may be separated by whitespace or spread
Darren Tucker46bc0752004-05-02 22:11:30 +100083across multiple
84.Cm AcceptEnv
85directives.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100086Be warned that some environment variables could be used to bypass restricted
Darren Tucker46bc0752004-05-02 22:11:30 +100087user environments.
88For this reason, care should be taken in the use of this directive.
89The default is not to accept any environment variables.
Darren Tucker0f383232005-01-20 10:57:56 +110090.It Cm AddressFamily
91Specifies which address family should be used by
Damien Millerf4f22b52006-03-15 11:57:25 +110092.Xr sshd 8 .
Darren Tucker0f383232005-01-20 10:57:56 +110093Valid arguments are
94.Dq any ,
95.Dq inet
Damien Miller5b0d63f2006-03-15 11:56:56 +110096(use IPv4 only), or
Darren Tucker0f383232005-01-20 10:57:56 +110097.Dq inet6
98(use IPv6 only).
99The default is
100.Dq any .
Damien Millere9890192008-05-19 14:59:02 +1000101.It Cm AllowAgentForwarding
102Specifies whether
103.Xr ssh-agent 1
104forwarding is permitted.
105The default is
106.Dq yes .
107Note that disabling agent forwarding does not improve security
108unless users are also denied shell access, as they can always install
109their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000110.It Cm AllowGroups
111This keyword can be followed by a list of group name patterns, separated
112by spaces.
113If specified, login is allowed only for users whose primary
114group or supplementary group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000115Only group names are valid; a numerical group ID is not recognized.
116By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100117The allow/deny directives are processed in the following order:
118.Cm DenyUsers ,
119.Cm AllowUsers ,
120.Cm DenyGroups ,
121and finally
122.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100123.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000124See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100125.Xr ssh_config 5
126for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000127.It Cm AllowTcpForwarding
128Specifies whether TCP forwarding is permitted.
Damien Milleraa5b3f82012-12-03 09:50:54 +1100129The available options are
130.Dq yes
131or
132.Dq all
133to allow TCP forwarding,
134.Dq no
135to prevent all TCP forwarding,
136.Dq local
137to allow local (from the perspective of
Darren Tuckerf9333d52012-12-07 13:06:13 +1100138.Xr ssh 1 )
139forwarding only or
Damien Milleraa5b3f82012-12-03 09:50:54 +1100140.Dq remote
141to allow remote forwarding only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000142The default is
143.Dq yes .
144Note that disabling TCP forwarding does not improve security unless
145users are also denied shell access, as they can always install their
146own forwarders.
Damien Miller7acefbb2014-07-18 14:11:24 +1000147.It Cm AllowStreamLocalForwarding
148Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
149The available options are
150.Dq yes
151or
152.Dq all
153to allow StreamLocal forwarding,
154.Dq no
155to prevent all StreamLocal forwarding,
156.Dq local
157to allow local (from the perspective of
158.Xr ssh 1 )
159forwarding only or
160.Dq remote
161to allow remote forwarding only.
162The default is
163.Dq yes .
164Note that disabling StreamLocal forwarding does not improve security unless
165users are also denied shell access, as they can always install their
166own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000167.It Cm AllowUsers
168This keyword can be followed by a list of user name patterns, separated
169by spaces.
Damien Miller5a93add2003-01-24 11:34:52 +1100170If specified, login is allowed only for user names that
Ben Lindstrom9f049032002-06-21 00:59:05 +0000171match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000172Only user names are valid; a numerical user ID is not recognized.
173By default, login is allowed for all users.
174If the pattern takes the form USER@HOST then USER and HOST
175are separately checked, restricting logins to particular
176users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100177The allow/deny directives are processed in the following order:
178.Cm DenyUsers ,
179.Cm AllowUsers ,
180.Cm DenyGroups ,
181and finally
182.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100183.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000184See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100185.Xr ssh_config 5
186for more information on patterns.
Damien Millera6e3f012012-11-04 23:21:40 +1100187.It Cm AuthenticationMethods
188Specifies the authentication methods that must be successfully completed
189for a user to be granted access.
190This option must be followed by one or more comma-separated lists of
191authentication method names.
192Successful authentication requires completion of every method in at least
193one of these lists.
194.Pp
195For example, an argument of
196.Dq publickey,password publickey,keyboard-interactive
197would require the user to complete public key authentication, followed by
198either password or keyboard interactive authentication.
199Only methods that are next in one or more lists are offered at each stage,
200so for this example, it would not be possible to attempt password or
201keyboard-interactive authentication before public key.
202.Pp
Damien Miller91a55f22013-04-23 15:18:10 +1000203For keyboard interactive authentication it is also possible to
204restrict authentication to a specific device by appending a
205colon followed by the device identifier
206.Dq bsdauth ,
207.Dq pam ,
208or
209.Dq skey ,
210depending on the server configuration.
211For example,
212.Dq keyboard-interactive:bsdauth
213would restrict keyboard interactive authentication to the
214.Dq bsdauth
215device.
216.Pp
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000217If the
218.Dq publickey
jmc@openbsd.org449e11b2014-12-22 08:24:17 +0000219method is listed more than once,
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000220.Xr sshd 8
221verifies that keys that have been used successfully are not reused for
222subsequent authentications.
223For example, an
224.Cm AuthenticationMethods
225of
226.Dq publickey,publickey
227will require successful authentication using two different public keys.
228.Pp
Damien Millera6e3f012012-11-04 23:21:40 +1100229This option is only available for SSH protocol 2 and will yield a fatal
230error if enabled if protocol 1 is also enabled.
231Note that each authentication method listed should also be explicitly enabled
232in the configuration.
233The default is not to require multiple authentication; successful completion
234of a single authentication method is sufficient.
Damien Miller09d3e122012-10-31 08:58:58 +1100235.It Cm AuthorizedKeysCommand
Damien Millerf33580e2012-11-04 22:22:52 +1100236Specifies a program to be used to look up the user's public keys.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000237The program must be owned by root, not writable by group or others and
238specified by an absolute path.
239.Pp
240Arguments to
241.Cm AuthorizedKeysCommand
242may be provided using the following tokens, which will be expanded
243at runtime: %% is replaced by a literal '%', %u is replaced by the
244username being authenticated, %h is replaced by the home directory
245of the user being authenticated, %t is replaced with the key type
246offered for authentication, %f is replaced with the fingerprint of
247the key, and %k is replaced with the key being offered for authentication.
248If no arguments are specified then the username of the target user
249will be supplied.
250.Pp
251The program should produce on standard output zero or
Damien Millerfecfd112013-07-18 16:11:50 +1000252more lines of authorized_keys output (see AUTHORIZED_KEYS in
Damien Millerf33580e2012-11-04 22:22:52 +1100253.Xr sshd 8 ) .
Damien Miller09d3e122012-10-31 08:58:58 +1100254If a key supplied by AuthorizedKeysCommand does not successfully authenticate
255and authorize the user then public key authentication continues using the usual
256.Cm AuthorizedKeysFile
257files.
258By default, no AuthorizedKeysCommand is run.
259.It Cm AuthorizedKeysCommandUser
260Specifies the user under whose account the AuthorizedKeysCommand is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100261It is recommended to use a dedicated user that has no other role on the host
262than running authorized keys commands.
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000263If
djm@openbsd.orgd663bea2014-12-11 05:25:06 +0000264.Cm AuthorizedKeysCommand
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000265is specified but
266.Cm AuthorizedKeysCommandUser
267is not, then
268.Xr sshd 8
269will refuse to start.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000270.It Cm AuthorizedKeysFile
271Specifies the file that contains the public keys that can be used
272for user authentication.
Damien Miller6018a362010-07-02 13:35:19 +1000273The format is described in the
Damien Millerfecfd112013-07-18 16:11:50 +1000274AUTHORIZED_KEYS FILE FORMAT
Damien Miller6018a362010-07-02 13:35:19 +1000275section of
276.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000277.Cm AuthorizedKeysFile
278may contain tokens of the form %T which are substituted during connection
Damien Miller5b0d63f2006-03-15 11:56:56 +1100279setup.
Damien Millerfbf486b2003-05-23 18:44:23 +1000280The following tokens are defined: %% is replaced by a literal '%',
Damien Miller5b0d63f2006-03-15 11:56:56 +1100281%h is replaced by the home directory of the user being authenticated, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000282%u is replaced by the username of that user.
283After expansion,
284.Cm AuthorizedKeysFile
285is taken to be an absolute path or one relative to the user's home
286directory.
Damien Millerb9132fc2011-05-29 21:41:40 +1000287Multiple files may be listed, separated by whitespace.
djm@openbsd.org2bca8a42015-09-11 03:13:36 +0000288Alternately this option may be set to
289.Dq none
290to skip checking for user keys in files.
Damien Millerb9132fc2011-05-29 21:41:40 +1000291The default is
292.Dq .ssh/authorized_keys .ssh/authorized_keys2 .
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000293.It Cm AuthorizedPrincipalsCommand
294Specifies a program to be used to generate the list of allowed
295certificate principals as per
296.Cm AuthorizedPrincipalsFile .
297The program must be owned by root, not writable by group or others and
298specified by an absolute path.
299.Pp
300Arguments to
301.Cm AuthorizedPrincipalsCommand
302may be provided using the following tokens, which will be expanded
303at runtime: %% is replaced by a literal '%', %u is replaced by the
304username being authenticated and %h is replaced by the home directory
305of the user being authenticated.
306.Pp
307The program should produce on standard output zero or
308more lines of
309.Cm AuthorizedPrincipalsFile
310output.
311If either
312.Cm AuthorizedPrincipalsCommand
313or
314.Cm AuthorizedPrincipalsFile
315is specified, then certificates offered by the client for authentication
316must contain a principal that is listed.
317By default, no AuthorizedPrincipalsCommand is run.
318.It Cm AuthorizedPrincipalsCommandUser
319Specifies the user under whose account the AuthorizedPrincipalsCommand is run.
320It is recommended to use a dedicated user that has no other role on the host
321than running authorized principals commands.
322If
323.Cm AuthorizedPrincipalsCommand
324is specified but
325.Cm AuthorizedPrincipalsCommandUser
326is not, then
327.Xr sshd 8
328will refuse to start.
Damien Miller30da3442010-05-10 11:58:03 +1000329.It Cm AuthorizedPrincipalsFile
330Specifies a file that lists principal names that are accepted for
331certificate authentication.
332When using certificates signed by a key listed in
333.Cm TrustedUserCAKeys ,
334this file lists names, one of which must appear in the certificate for it
335to be accepted for authentication.
Damien Millerd59dab82010-07-02 13:37:17 +1000336Names are listed one per line preceded by key options (as described
Damien Millerfecfd112013-07-18 16:11:50 +1000337in AUTHORIZED_KEYS FILE FORMAT in
Damien Millerd59dab82010-07-02 13:37:17 +1000338.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000339Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000340.Ql #
341are ignored.
342.Pp
343.Cm AuthorizedPrincipalsFile
344may contain tokens of the form %T which are substituted during connection
345setup.
346The following tokens are defined: %% is replaced by a literal '%',
347%h is replaced by the home directory of the user being authenticated, and
348%u is replaced by the username of that user.
349After expansion,
350.Cm AuthorizedPrincipalsFile
351is taken to be an absolute path or one relative to the user's home
352directory.
353.Pp
Damien Miller8fef9eb2012-04-22 11:25:10 +1000354The default is
355.Dq none ,
356i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000357of the user must appear in a certificate's principals list for it to be
358accepted.
359Note that
360.Cm AuthorizedPrincipalsFile
361is only used when authentication proceeds using a CA listed in
362.Cm TrustedUserCAKeys
363and is not consulted for certification authorities trusted via
364.Pa ~/.ssh/authorized_keys ,
365though the
366.Cm principals=
367key option offers a similar facility (see
368.Xr sshd 8
369for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000370.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000371The contents of the specified file are sent to the remote user before
372authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000373If the argument is
374.Dq none
375then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000376This option is only available for protocol version 2.
377By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000378.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000379Specifies whether challenge-response authentication is allowed (e.g. via
Damien Millere8c9f262014-10-03 09:24:56 +1000380PAM or through authentication styles supported in
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000381.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000382The default is
383.Dq yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100384.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100385Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100386.Xr chroot 2
387to after authentication.
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000388At session startup
389.Xr sshd 8
390checks that all components of the pathname are root-owned directories
391which are not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000392After the chroot,
393.Xr sshd 8
394changes the working directory to the user's home directory.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100395.Pp
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100396The pathname may contain the following tokens that are expanded at runtime once
Damien Millerd8cb1f12008-02-10 22:40:12 +1100397the connecting user has been authenticated: %% is replaced by a literal '%',
398%h is replaced by the home directory of the user being authenticated, and
399%u is replaced by the username of that user.
400.Pp
401The
402.Cm ChrootDirectory
403must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000404user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100405For an interactive session this requires at least a shell, typically
406.Xr sh 1 ,
407and basic
408.Pa /dev
409nodes such as
410.Xr null 4 ,
411.Xr zero 4 ,
412.Xr stdin 4 ,
413.Xr stdout 4 ,
414.Xr stderr 4 ,
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000415and
Damien Millerd8cb1f12008-02-10 22:40:12 +1100416.Xr tty 4
417devices.
418For file transfer sessions using
Darren Tuckerf92077f2009-06-21 17:56:25 +1000419.Dq sftp ,
Damien Millerd8cb1f12008-02-10 22:40:12 +1100420no additional configuration of the environment is necessary if the
Darren Tuckerf92077f2009-06-21 17:56:25 +1000421in-process sftp server is used,
Damien Miller426117b2014-07-30 12:33:20 +1000422though sessions which use logging may require
Darren Tucker00fcd712009-06-21 17:56:00 +1000423.Pa /dev/log
Damien Miller426117b2014-07-30 12:33:20 +1000424inside the chroot directory on some operating systems (see
Darren Tucker00fcd712009-06-21 17:56:00 +1000425.Xr sftp-server 8
426for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100427.Pp
jmc@openbsd.orga5a3e332015-01-22 21:00:42 +0000428For safety, it is very important that the directory hierarchy be
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000429prevented from modification by other processes on the system (especially
430those outside the jail).
431Misconfiguration can lead to unsafe environments which
432.Xr sshd 8
433cannot detect.
434.Pp
Damien Millerd8cb1f12008-02-10 22:40:12 +1100435The default is not to
436.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000437.It Cm Ciphers
438Specifies the ciphers allowed for protocol version 2.
439Multiple ciphers must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000440If the specified value begins with a
441.Sq +
442character, then the specified ciphers will be appended to the default set
443instead of replacing them.
444.Pp
Damien Miller0fde8ac2013-11-21 14:12:23 +1100445The supported ciphers are:
446.Pp
Damien Millerc1621c82014-04-20 13:22:46 +1000447.Bl -item -compact -offset indent
448.It
4493des-cbc
450.It
451aes128-cbc
452.It
453aes192-cbc
454.It
455aes256-cbc
456.It
457aes128-ctr
458.It
459aes192-ctr
460.It
461aes256-ctr
462.It
463aes128-gcm@openssh.com
464.It
465aes256-gcm@openssh.com
466.It
467arcfour
468.It
469arcfour128
470.It
471arcfour256
472.It
473blowfish-cbc
474.It
475cast128-cbc
476.It
477chacha20-poly1305@openssh.com
478.El
Damien Miller0fde8ac2013-11-21 14:12:23 +1100479.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100480The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000481.Bd -literal -offset indent
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000482chacha20-poly1305@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000483aes128-ctr,aes192-ctr,aes256-ctr,
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000484aes128-gcm@openssh.com,aes256-gcm@openssh.com
Ben Lindstrom9f049032002-06-21 00:59:05 +0000485.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100486.Pp
487The list of available ciphers may also be obtained using the
488.Fl Q
489option of
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000490.Xr ssh 1
491with an argument of
492.Dq cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000493.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100494Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000495sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100496.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000497receiving any messages back from the client.
498If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100499sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000500It is important to note that the use of client alive messages is very
501different from
Damien Miller12c150e2003-12-17 16:31:10 +1100502.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000503(below).
504The client alive messages are sent through the encrypted channel
505and therefore will not be spoofable.
506The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100507.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000508is spoofable.
509The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000510server depend on knowing when a connection has become inactive.
511.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000512The default value is 3.
513If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000514.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100515(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000516.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100517is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000518will be disconnected after approximately 45 seconds.
Damien Millercc3e8ba2006-03-15 12:06:55 +1100519This option applies to protocol version 2 only.
Damien Miller1594ad52005-05-26 12:12:19 +1000520.It Cm ClientAliveInterval
521Sets a timeout interval in seconds after which if no data has been received
522from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100523.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000524will send a message through the encrypted
525channel to request a response from the client.
526The default
527is 0, indicating that these messages will not be sent to the client.
528This option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000529.It Cm Compression
Damien Miller9786e6e2005-07-26 21:54:56 +1000530Specifies whether compression is allowed, or delayed until
531the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000532The argument must be
Damien Miller9786e6e2005-07-26 21:54:56 +1000533.Dq yes ,
534.Dq delayed ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000535or
536.Dq no .
537The default is
Damien Miller9786e6e2005-07-26 21:54:56 +1000538.Dq delayed .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000539.It Cm DenyGroups
540This keyword can be followed by a list of group name patterns, separated
541by spaces.
542Login is disallowed for users whose primary group or supplementary
543group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000544Only group names are valid; a numerical group ID is not recognized.
545By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100546The allow/deny directives are processed in the following order:
547.Cm DenyUsers ,
548.Cm AllowUsers ,
549.Cm DenyGroups ,
550and finally
551.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100552.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000553See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100554.Xr ssh_config 5
555for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000556.It Cm DenyUsers
557This keyword can be followed by a list of user name patterns, separated
558by spaces.
559Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000560Only user names are valid; a numerical user ID is not recognized.
561By default, login is allowed for all users.
562If the pattern takes the form USER@HOST then USER and HOST
563are separately checked, restricting logins to particular
564users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100565The allow/deny directives are processed in the following order:
566.Cm DenyUsers ,
567.Cm AllowUsers ,
568.Cm DenyGroups ,
569and finally
570.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100571.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000572See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100573.Xr ssh_config 5
574for more information on patterns.
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000575.It Cm FingerprintHash
576Specifies the hash algorithm used when logging key fingerprints.
577Valid options are:
578.Dq md5
579and
580.Dq sha256 .
581The default is
582.Dq sha256 .
Damien Millere2754432006-07-24 14:06:47 +1000583.It Cm ForceCommand
584Forces the execution of the command specified by
585.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100586ignoring any command supplied by the client and
587.Pa ~/.ssh/rc
588if present.
Damien Millere2754432006-07-24 14:06:47 +1000589The command is invoked by using the user's login shell with the -c option.
590This applies to shell, command, or subsystem execution.
591It is most useful inside a
592.Cm Match
593block.
594The command originally supplied by the client is available in the
595.Ev SSH_ORIGINAL_COMMAND
596environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100597Specifying a command of
598.Dq internal-sftp
599will force the use of an in-process sftp server that requires no support
600files when used with
601.Cm ChrootDirectory .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000602.It Cm GatewayPorts
603Specifies whether remote hosts are allowed to connect to ports
604forwarded for the client.
605By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100606.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000607binds remote port forwardings to the loopback address.
608This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000609.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100610can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100611should allow remote port forwardings to bind to non-loopback addresses, thus
612allowing other hosts to connect.
613The argument may be
614.Dq no
615to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000616.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100617to force remote port forwardings to bind to the wildcard address, or
618.Dq clientspecified
619to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000620The default is
621.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000622.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000623Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100624The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000625.Dq no .
626Note that this option applies to protocol version 2 only.
627.It Cm GSSAPICleanupCredentials
628Specifies whether to automatically destroy the user's credentials cache
629on logout.
630The default is
631.Dq yes .
632Note that this option applies to protocol version 2 only.
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000633.It Cm GSSAPIStrictAcceptorCheck
634Determines whether to be strict about the identity of the GSSAPI acceptor
635a client authenticates against.
636If set to
637.Dq yes
638then the client must authenticate against the
639.Pa host
640service on the current hostname.
641If set to
642.Dq no
643then the client may authenticate against any service key stored in the
644machine's default store.
645This facility is provided to assist with operation on multi homed machines.
646The default is
647.Dq yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000648.It Cm HostbasedAcceptedKeyTypes
649Specifies the key types that will be accepted for hostbased authentication
650as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000651Alternately if the specified value begins with a
652.Sq +
653character, then the specified key types will be appended to the default set
654instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000655The default for this option is:
656.Bd -literal -offset 3n
657ecdsa-sha2-nistp256-cert-v01@openssh.com,
658ecdsa-sha2-nistp384-cert-v01@openssh.com,
659ecdsa-sha2-nistp521-cert-v01@openssh.com,
660ssh-ed25519-cert-v01@openssh.com,
661ssh-rsa-cert-v01@openssh.com,
662ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
663ssh-ed25519,ssh-rsa
664.Ed
665.Pp
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000666The
667.Fl Q
668option of
669.Xr ssh 1
670may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000671.It Cm HostbasedAuthentication
672Specifies whether rhosts or /etc/hosts.equiv authentication together
673with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100674(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000675This option is similar to
676.Cm RhostsRSAAuthentication
677and applies to protocol version 2 only.
678The default is
679.Dq no .
Damien Millerb594f382006-08-30 11:06:34 +1000680.It Cm HostbasedUsesNameFromPacketOnly
681Specifies whether or not the server will attempt to perform a reverse
682name lookup when matching the name in the
683.Pa ~/.shosts ,
684.Pa ~/.rhosts ,
685and
686.Pa /etc/hosts.equiv
687files during
688.Cm HostbasedAuthentication .
689A setting of
690.Dq yes
691means that
692.Xr sshd 8
693uses the name supplied by the client rather than
694attempting to resolve the name from the TCP connection itself.
695The default is
696.Dq no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100697.It Cm HostCertificate
698Specifies a file containing a public host certificate.
699The certificate's public key must match a private host key already specified
700by
701.Cm HostKey .
702The default behaviour of
703.Xr sshd 8
704is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000705.It Cm HostKey
706Specifies a file containing a private host key
707used by SSH.
708The default is
709.Pa /etc/ssh/ssh_host_key
710for protocol version 1, and
Damien Millereb8b60e2010-08-31 22:41:14 +1000711.Pa /etc/ssh/ssh_host_dsa_key ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100712.Pa /etc/ssh/ssh_host_ecdsa_key ,
713.Pa /etc/ssh/ssh_host_ed25519_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000714and
Damien Millereb8b60e2010-08-31 22:41:14 +1000715.Pa /etc/ssh/ssh_host_rsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000716for protocol version 2.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000717.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000718Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100719.Xr sshd 8
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000720will refuse to use a file if it is group/world-accessible
721and that the
722.Cm HostKeyAlgorithms
723option restricts which of the keys are actually used by
724.Xr sshd 8 .
725.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000726It is possible to have multiple host key files.
727.Dq rsa1
728keys are used for version 1 and
Damien Millereb8b60e2010-08-31 22:41:14 +1000729.Dq dsa ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100730.Dq ecdsa ,
731.Dq ed25519
Ben Lindstrom9f049032002-06-21 00:59:05 +0000732or
733.Dq rsa
734are used for version 2 of the SSH protocol.
Damien Miller85b45e02013-07-20 13:21:52 +1000735It is also possible to specify public host key files instead.
736In this case operations on the private key will be delegated
737to an
738.Xr ssh-agent 1 .
739.It Cm HostKeyAgent
740Identifies the UNIX-domain socket used to communicate
741with an agent that has access to the private host keys.
742If
743.Dq SSH_AUTH_SOCK
744is specified, the location of the socket will be read from the
745.Ev SSH_AUTH_SOCK
746environment variable.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000747.It Cm HostKeyAlgorithms
748Specifies the protocol version 2 host key algorithms
749that the server offers.
750The default for this option is:
751.Bd -literal -offset 3n
752ecdsa-sha2-nistp256-cert-v01@openssh.com,
753ecdsa-sha2-nistp384-cert-v01@openssh.com,
754ecdsa-sha2-nistp521-cert-v01@openssh.com,
755ssh-ed25519-cert-v01@openssh.com,
756ssh-rsa-cert-v01@openssh.com,
757ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
758ssh-ed25519,ssh-rsa
759.Ed
760.Pp
761The list of available key types may also be obtained using the
762.Fl Q
763option of
764.Xr ssh 1
765with an argument of
766.Dq key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000767.It Cm IgnoreRhosts
768Specifies that
769.Pa .rhosts
770and
771.Pa .shosts
772files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000773.Cm RhostsRSAAuthentication
774or
775.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
789.Cm RhostsRSAAuthentication
790or
791.Cm HostbasedAuthentication .
792The default is
793.Dq no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100794.It Cm IPQoS
795Specifies the IPv4 type-of-service or DSCP class for the connection.
796Accepted values are
797.Dq af11 ,
798.Dq af12 ,
799.Dq af13 ,
Damien Millerf6e758c2011-09-22 21:37:13 +1000800.Dq af21 ,
Damien Miller0dac6fb2010-11-20 15:19:38 +1100801.Dq af22 ,
802.Dq af23 ,
803.Dq af31 ,
804.Dq af32 ,
805.Dq af33 ,
806.Dq af41 ,
807.Dq af42 ,
808.Dq af43 ,
809.Dq cs0 ,
810.Dq cs1 ,
811.Dq cs2 ,
812.Dq cs3 ,
813.Dq cs4 ,
814.Dq cs5 ,
815.Dq cs6 ,
816.Dq cs7 ,
817.Dq ef ,
818.Dq lowdelay ,
819.Dq throughput ,
820.Dq reliability ,
821or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +1100822This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100823If one argument is specified, it is used as the packet class unconditionally.
824If two values are specified, the first is automatically selected for
825interactive sessions and the second for non-interactive sessions.
826The default is
827.Dq lowdelay
828for interactive sessions and
829.Dq throughput
830for non-interactive sessions.
Damien Millere1e480a2014-02-04 11:13:17 +1100831.It Cm KbdInteractiveAuthentication
832Specifies whether to allow keyboard-interactive authentication.
833The argument to this keyword must be
834.Dq yes
835or
836.Dq no .
837The default is to use whatever value
838.Cm ChallengeResponseAuthentication
839is set to
840(by default
841.Dq yes ) .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000842.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000843Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000844.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000845will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000846To use this option, the server needs a
847Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100848The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000849.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100850.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000851If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100852an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100853The default is
Damien Miller8448e662004-03-08 23:13:15 +1100854.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000855.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100856If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000857the password will be validated via any additional local mechanism
858such as
859.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100860The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000861.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000862.It Cm KerberosTicketCleanup
863Specifies whether to automatically destroy the user's ticket cache
864file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100865The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000866.Dq yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000867.It Cm KexAlgorithms
868Specifies the available KEX (Key Exchange) algorithms.
869Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000870Alternately if the specified value begins with a
871.Sq +
872character, then the specified methods will be appended to the default set
873instead of replacing them.
Damien Millerc1621c82014-04-20 13:22:46 +1000874The supported algorithms are:
875.Pp
876.Bl -item -compact -offset indent
877.It
878curve25519-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
897curve25519-sha256@libssh.org,
898ecdh-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 KeyRegenerationInterval
910In protocol version 1, the ephemeral server key is automatically regenerated
911after this many seconds (if it has been used).
912The purpose of regeneration is to prevent
913decrypting captured sessions by later breaking into the machine and
914stealing the keys.
915The key is never stored anywhere.
916If the value is 0, the key is never regenerated.
917The default is 3600 (seconds).
918.It Cm ListenAddress
919Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100920.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000921should listen on.
922The following forms may be used:
923.Pp
924.Bl -item -offset indent -compact
925.It
926.Cm ListenAddress
927.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000928.Ar host | Ar IPv4_addr | Ar IPv6_addr
Ben Lindstrom9f049032002-06-21 00:59:05 +0000929.Sm on
930.It
931.Cm ListenAddress
932.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000933.Ar host | Ar IPv4_addr : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000934.Sm on
935.It
936.Cm ListenAddress
937.Sm off
938.Oo
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000939.Ar host | Ar IPv6_addr Oc : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000940.Sm on
941.El
942.Pp
943If
944.Ar port
945is not specified,
dtucker@openbsd.org531a57a2015-04-29 03:48:56 +0000946sshd will listen on the address and all
Ben Lindstrom9f049032002-06-21 00:59:05 +0000947.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000948options specified.
949The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000950Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000951.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000952options are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000953.It Cm LoginGraceTime
954The server disconnects after this time if the user has not
955successfully logged in.
956If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000957The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000958.It Cm LogLevel
959Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100960.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000961The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100962QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000963The default is INFO.
964DEBUG and DEBUG1 are equivalent.
965DEBUG2 and DEBUG3 each specify higher levels of debugging output.
966Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000967.It Cm MACs
968Specifies the available MAC (message authentication code) algorithms.
969The MAC algorithm is used in protocol version 2
970for data integrity protection.
971Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000972If the specified value begins with a
973.Sq +
974character, then the specified algorithms will be appended to the default set
975instead of replacing them.
976.Pp
Damien Milleraf43a7a2012-12-12 10:46:31 +1100977The algorithms that contain
978.Dq -etm
979calculate the MAC after encryption (encrypt-then-mac).
980These are considered safer and their use recommended.
Damien Millerc1621c82014-04-20 13:22:46 +1000981The supported MACs are:
982.Pp
983.Bl -item -compact -offset indent
984.It
985hmac-md5
986.It
987hmac-md5-96
988.It
989hmac-ripemd160
990.It
991hmac-sha1
992.It
993hmac-sha1-96
994.It
995hmac-sha2-256
996.It
997hmac-sha2-512
998.It
999umac-64@openssh.com
1000.It
1001umac-128@openssh.com
1002.It
1003hmac-md5-etm@openssh.com
1004.It
1005hmac-md5-96-etm@openssh.com
1006.It
1007hmac-ripemd160-etm@openssh.com
1008.It
1009hmac-sha1-etm@openssh.com
1010.It
1011hmac-sha1-96-etm@openssh.com
1012.It
1013hmac-sha2-256-etm@openssh.com
1014.It
1015hmac-sha2-512-etm@openssh.com
1016.It
1017umac-64-etm@openssh.com
1018.It
1019umac-128-etm@openssh.com
1020.El
1021.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +11001022The default is:
Damien Miller22b7b492007-06-11 14:07:12 +10001023.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +11001024umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1025hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +10001026umac-64@openssh.com,umac-128@openssh.com,
1027hmac-sha2-256,hmac-sha2-512
Damien Miller22b7b492007-06-11 14:07:12 +10001028.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001029.Pp
1030The list of available MAC algorithms may also be obtained using the
1031.Fl Q
1032option of
1033.Xr ssh 1
1034with an argument of
1035.Dq mac .
Darren Tucker45150472006-07-12 22:34:17 +10001036.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +10001037Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +10001038If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +10001039.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001040line are satisfied, the keywords on the following lines override those
1041set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +10001042.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001043line or the end of the file.
Damien Millerfc5d6752014-02-28 10:01:28 +11001044If a keyword appears in multiple
1045.Cm Match
sobrado@openbsd.org180bcb42014-08-30 16:32:25 +00001046blocks that are satisfied, only the first instance of the keyword is
Damien Millerfc5d6752014-02-28 10:01:28 +11001047applied.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001048.Pp
Damien Millerd04f3572006-07-24 13:46:50 +10001049The arguments to
Darren Tucker45150472006-07-12 22:34:17 +10001050.Cm Match
Damien Millercf31f382013-10-24 21:02:56 +11001051are one or more criteria-pattern pairs or the single token
1052.Cm All
1053which matches all criteria.
Darren Tucker45150472006-07-12 22:34:17 +10001054The available criteria are
1055.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +10001056.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +10001057.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +10001058.Cm LocalAddress ,
1059.Cm LocalPort ,
Darren Tucker45150472006-07-12 22:34:17 +10001060and
1061.Cm Address .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001062The match patterns may consist of single entries or comma-separated
1063lists and may use the wildcard and negation operators described in the
Damien Millerfecfd112013-07-18 16:11:50 +10001064PATTERNS section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +10001065.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001066.Pp
1067The patterns in an
1068.Cm Address
1069criteria may additionally contain addresses to match in CIDR
Darren Tucker6a2a4002008-06-10 23:03:04 +10001070address/masklen format, e.g.\&
Darren Tucker7a3935d2008-06-10 22:59:10 +10001071.Dq 192.0.2.0/24
1072or
1073.Dq 3ffe:ffff::/32 .
1074Note that the mask length provided must be consistent with the address -
1075it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +10001076or one with bits set in this host portion of the address.
1077For example,
Darren Tucker7a3935d2008-06-10 22:59:10 +10001078.Dq 192.0.2.0/33
1079and
Darren Tucker6a2a4002008-06-10 23:03:04 +10001080.Dq 192.0.2.0/8
Darren Tucker7a3935d2008-06-10 22:59:10 +10001081respectively.
1082.Pp
Darren Tucker45150472006-07-12 22:34:17 +10001083Only a subset of keywords may be used on the lines following a
1084.Cm Match
1085keyword.
1086Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +10001087.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +11001088.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +10001089.Cm AllowGroups ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001090.Cm AllowStreamLocalForwarding ,
Damien Miller9b439df2006-07-24 14:04:00 +10001091.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +10001092.Cm AllowUsers ,
Damien Millera6e3f012012-11-04 23:21:40 +11001093.Cm AuthenticationMethods ,
Damien Miller09d3e122012-10-31 08:58:58 +11001094.Cm AuthorizedKeysCommand ,
1095.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +11001096.Cm AuthorizedKeysFile ,
djm@openbsd.orgb6b91082015-11-13 02:57:46 +00001097.Cm AuthorizedPrincipalsCommand ,
1098.Cm AuthorizedPrincipalsCommandUser ,
Damien Millerab6de352010-06-26 09:38:45 +10001099.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +11001100.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +10001101.Cm ChrootDirectory ,
Damien Millerc24da772012-06-20 21:53:58 +10001102.Cm DenyGroups ,
1103.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +10001104.Cm ForceCommand ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001105.Cm GatewayPorts ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +00001106.Cm GSSAPIAuthentication ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001107.Cm HostbasedAcceptedKeyTypes ,
Damien Miller25434de2008-05-19 14:29:08 +10001108.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +10001109.Cm HostbasedUsesNameFromPacketOnly ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001110.Cm IPQoS ,
Darren Tucker1d75f222007-03-01 21:31:28 +11001111.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +11001112.Cm KerberosAuthentication ,
Damien Miller307c1d12008-06-16 07:56:20 +10001113.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +10001114.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +11001115.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +11001116.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +10001117.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +11001118.Cm PermitRootLogin ,
Damien Miller5ff30c62013-10-30 22:21:50 +11001119.Cm PermitTTY ,
Damien Millerab6de352010-06-26 09:38:45 +10001120.Cm PermitTunnel ,
Damien Miller72e6b5c2014-07-04 09:00:04 +10001121.Cm PermitUserRC ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001122.Cm PubkeyAcceptedKeyTypes ,
Darren Tucker1477ea12009-10-07 08:36:05 +11001123.Cm PubkeyAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001124.Cm RekeyLimit ,
1125.Cm RevokedKeys ,
1126.Cm RhostsRSAAuthentication ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +00001127.Cm RSAAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001128.Cm StreamLocalBindMask ,
1129.Cm StreamLocalBindUnlink ,
1130.Cm TrustedUserCAKeys ,
Damien Millerd1de9952006-07-24 14:05:48 +10001131.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +11001132.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +10001133and
Damien Miller0296ae82009-02-23 11:00:24 +11001134.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +10001135.It Cm MaxAuthTries
1136Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +10001137connection.
1138Once the number of failures reaches half this value,
1139additional failures are logged.
1140The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +10001141.It Cm MaxSessions
1142Specifies the maximum number of open sessions permitted per network connection.
1143The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001144.It Cm MaxStartups
1145Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001146SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001147Additional connections will be dropped until authentication succeeds or the
1148.Cm LoginGraceTime
1149expires for a connection.
Damien Miller1f583df2013-02-12 11:02:08 +11001150The default is 10:30:100.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001151.Pp
1152Alternatively, random early drop can be enabled by specifying
1153the three colon separated values
1154.Dq start:rate:full
Damien Miller208f1ed2006-03-15 11:56:03 +11001155(e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +11001156.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001157will refuse connection attempts with a probability of
1158.Dq rate/100
1159(30%)
1160if there are currently
1161.Dq start
1162(10)
1163unauthenticated connections.
1164The probability increases linearly and all connection attempts
1165are refused if the number of unauthenticated connections reaches
1166.Dq full
1167(60).
1168.It Cm PasswordAuthentication
1169Specifies whether password authentication is allowed.
1170The default is
1171.Dq yes .
1172.It Cm PermitEmptyPasswords
1173When password authentication is allowed, it specifies whether the
1174server allows login to accounts with empty password strings.
1175The default is
1176.Dq no .
Damien Miller9b439df2006-07-24 14:04:00 +10001177.It Cm PermitOpen
1178Specifies the destinations to which TCP port forwarding is permitted.
1179The forwarding specification must be one of the following forms:
1180.Pp
1181.Bl -item -offset indent -compact
1182.It
1183.Cm PermitOpen
1184.Sm off
1185.Ar host : port
1186.Sm on
1187.It
1188.Cm PermitOpen
1189.Sm off
1190.Ar IPv4_addr : port
1191.Sm on
1192.It
1193.Cm PermitOpen
1194.Sm off
1195.Ar \&[ IPv6_addr \&] : port
1196.Sm on
1197.El
1198.Pp
Damien Millera765cf42006-07-24 14:08:13 +10001199Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +10001200An argument of
1201.Dq any
1202can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +10001203An argument of
1204.Dq none
1205can be used to prohibit all forwarding requests.
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.
Damien Millerd27b9472005-12-13 19:29:02 +11001239.It Cm PermitTunnel
1240Specifies whether
1241.Xr tun 4
1242device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +11001243The argument must be
1244.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +10001245.Dq point-to-point
1246(layer 3),
1247.Dq ethernet
1248(layer 2), or
Damien Miller7b58e802005-12-13 19:33:19 +11001249.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +10001250Specifying
1251.Dq yes
1252permits both
1253.Dq point-to-point
1254and
1255.Dq ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +11001256The default is
1257.Dq no .
djm@openbsd.org48dffd52014-09-09 09:45:36 +00001258.Pp
1259Independent of this setting, the permissions of the selected
1260.Xr tun 4
1261device must allow access to the user.
Damien Miller5ff30c62013-10-30 22:21:50 +11001262.It Cm PermitTTY
1263Specifies whether
Damien Miller63857c92013-10-30 22:31:06 +11001264.Xr pty 4
Damien Miller5ff30c62013-10-30 22:21:50 +11001265allocation is permitted.
1266The default is
1267.Dq yes .
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 .
1321.It Cm Protocol
1322Specifies the protocol versions
Damien Miller5b0d63f2006-03-15 11:56:56 +11001323.Xr sshd 8
Ben Lindstrom9c445542002-07-11 03:59:18 +00001324supports.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001325The possible values are
Damien Miller5b0d63f2006-03-15 11:56:56 +11001326.Sq 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001327and
Damien Miller5b0d63f2006-03-15 11:56:56 +11001328.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001329Multiple versions must be comma-separated.
1330The default is
Darren Tucker7a4a7652009-10-11 21:51:40 +11001331.Sq 2 .
Ben Lindstrom9c445542002-07-11 03:59:18 +00001332Note that the order of the protocol list does not indicate preference,
1333because the client selects among multiple protocol versions offered
1334by the server.
1335Specifying
1336.Dq 2,1
1337is identical to
1338.Dq 1,2 .
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001339.It Cm PubkeyAcceptedKeyTypes
1340Specifies the key types that will be accepted for public key authentication
1341as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001342Alternately if the specified value begins with a
1343.Sq +
1344character, then the specified key types will be appended to the default set
1345instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001346The default for this option is:
1347.Bd -literal -offset 3n
1348ecdsa-sha2-nistp256-cert-v01@openssh.com,
1349ecdsa-sha2-nistp384-cert-v01@openssh.com,
1350ecdsa-sha2-nistp521-cert-v01@openssh.com,
1351ssh-ed25519-cert-v01@openssh.com,
1352ssh-rsa-cert-v01@openssh.com,
1353ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1354ssh-ed25519,ssh-rsa
1355.Ed
1356.Pp
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001357The
1358.Fl Q
1359option of
1360.Xr ssh 1
1361may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001362.It Cm PubkeyAuthentication
1363Specifies whether public key authentication is allowed.
1364The default is
1365.Dq yes .
1366Note that this option applies to protocol version 2 only.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001367.It Cm RekeyLimit
1368Specifies the maximum amount of data that may be transmitted before the
1369session key is renegotiated, optionally followed a maximum amount of
1370time that may pass before the session key is renegotiated.
1371The first argument is specified in bytes and may have a suffix of
1372.Sq K ,
1373.Sq M ,
1374or
1375.Sq G
1376to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1377The default is between
1378.Sq 1G
1379and
1380.Sq 4G ,
1381depending on the cipher.
1382The optional second value is specified in seconds and may use any of the
1383units documented in the
1384.Sx TIME FORMATS
Darren Tucker64d22942013-05-16 20:31:29 +10001385section.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001386The default value for
1387.Cm RekeyLimit
1388is
1389.Dq default none ,
1390which means that rekeying is performed after the cipher's default amount
1391of data has been sent or received and no time based rekeying is done.
1392This option applies to protocol version 2 only.
Damien Miller1aed65e2010-03-04 21:53:35 +11001393.It Cm RevokedKeys
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001394Specifies revoked public keys file, or
1395.Dq none
1396to not use one.
Damien Miller1aed65e2010-03-04 21:53:35 +11001397Keys listed in this file will be refused for public key authentication.
1398Note that if this file is not readable, then public key authentication will
1399be refused for all users.
Damien Millerf3747bf2013-01-18 11:44:04 +11001400Keys may be specified as a text file, listing one public key per line, or as
1401an OpenSSH Key Revocation List (KRL) as generated by
Damien Miller72abeb72013-01-20 22:33:44 +11001402.Xr ssh-keygen 1 .
Damien Millerfecfd112013-07-18 16:11:50 +10001403For more information on KRLs, see the KEY REVOCATION LISTS section in
Damien Millerf3747bf2013-01-18 11:44:04 +11001404.Xr ssh-keygen 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001405.It Cm RhostsRSAAuthentication
1406Specifies whether rhosts or /etc/hosts.equiv authentication together
1407with successful RSA host authentication is allowed.
1408The default is
1409.Dq no .
1410This option applies to protocol version 1 only.
1411.It Cm RSAAuthentication
1412Specifies whether pure RSA authentication is allowed.
1413The default is
1414.Dq yes .
1415This option applies to protocol version 1 only.
1416.It Cm ServerKeyBits
1417Defines the number of bits in the ephemeral protocol version 1 server key.
djm@openbsd.org933935c2015-07-03 03:49:45 +00001418The default and minimum value is 1024.
Damien Miller7acefbb2014-07-18 14:11:24 +10001419.It Cm StreamLocalBindMask
1420Sets the octal file creation mode mask
1421.Pq umask
1422used when creating a Unix-domain socket file for local or remote
1423port forwarding.
1424This option is only used for port forwarding to a Unix-domain socket file.
1425.Pp
1426The default value is 0177, which creates a Unix-domain socket file that is
1427readable and writable only by the owner.
1428Note that not all operating systems honor the file mode on Unix-domain
1429socket files.
1430.It Cm StreamLocalBindUnlink
1431Specifies whether to remove an existing Unix-domain socket file for local
1432or remote port forwarding before creating a new one.
1433If the socket file already exists and
1434.Cm StreamLocalBindUnlink
1435is not enabled,
1436.Nm sshd
1437will be unable to forward the port to the Unix-domain socket file.
1438This option is only used for port forwarding to a Unix-domain socket file.
1439.Pp
1440The argument must be
1441.Dq yes
1442or
1443.Dq no .
1444The default is
1445.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001446.It Cm StrictModes
1447Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001448.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001449should check file modes and ownership of the
1450user's files and home directory before accepting login.
1451This is normally desirable because novices sometimes accidentally leave their
1452directory or files world-writable.
1453The default is
1454.Dq yes .
Darren Tuckerf788a912010-01-08 17:06:47 +11001455Note that this does not apply to
1456.Cm ChrootDirectory ,
1457whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001458.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +11001459Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +10001460Arguments should be a subsystem name and a command (with optional arguments)
1461to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001462.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001463The command
1464.Xr sftp-server 8
1465implements the
1466.Dq sftp
1467file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001468.Pp
1469Alternately the name
1470.Dq internal-sftp
1471implements an in-process
1472.Dq sftp
1473server.
1474This may simplify configurations using
1475.Cm ChrootDirectory
1476to force a different filesystem root on clients.
1477.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001478By default no subsystems are defined.
1479Note that this option applies to protocol version 2 only.
1480.It Cm SyslogFacility
1481Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001482.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001483The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1484LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1485The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001486.It Cm TCPKeepAlive
1487Specifies whether the system should send TCP keepalive messages to the
1488other side.
1489If they are sent, death of the connection or crash of one
1490of the machines will be properly noticed.
1491However, this means that
1492connections will die if the route is down temporarily, and some people
1493find it annoying.
1494On the other hand, if TCP keepalives are not sent,
1495sessions may hang indefinitely on the server, leaving
1496.Dq ghost
1497users and consuming server resources.
1498.Pp
1499The default is
1500.Dq yes
1501(to send TCP keepalive messages), and the server will notice
1502if the network goes down or the client host crashes.
1503This avoids infinitely hanging sessions.
1504.Pp
1505To disable TCP keepalive messages, the value should be set to
1506.Dq no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001507.It Cm TrustedUserCAKeys
1508Specifies a file containing public keys of certificate authorities that are
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001509trusted to sign user certificates for authentication, or
1510.Dq none
1511to not use one.
Damien Miller72b33822010-03-05 07:39:01 +11001512Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001513.Ql #
1514are allowed.
1515If a certificate is presented for authentication and has its signing CA key
1516listed in this file, then it may be used for authentication for any user
1517listed in the certificate's principals list.
1518Note that certificates that lack a list of principals will not be permitted
1519for authentication using
1520.Cm TrustedUserCAKeys .
Damien Millerfecfd112013-07-18 16:11:50 +10001521For more details on certificates, see the CERTIFICATES section in
Damien Miller1aed65e2010-03-04 21:53:35 +11001522.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001523.It Cm UseDNS
1524Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001525.Xr sshd 8
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001526should look up the remote host name, and to check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001527the resolved host name for the remote IP address maps back to the
1528very same IP address.
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001529.Pp
1530If this option is set to
1531.Dq no
1532(the default) then only addresses and not host names may be used in
1533.Pa ~/.ssh/known_hosts
1534.Cm from
1535and
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +00001536.Nm
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001537.Cm Match
1538.Cm Host
1539directives.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001540.It Cm UseLogin
1541Specifies whether
1542.Xr login 1
1543is used for interactive login sessions.
1544The default is
1545.Dq no .
1546Note that
1547.Xr login 1
1548is never used for remote command execution.
1549Note also, that if this is enabled,
1550.Cm X11Forwarding
1551will be disabled because
1552.Xr login 1
1553does not know how to handle
1554.Xr xauth 1
Damien Miller495dca32003-04-01 21:42:14 +10001555cookies.
1556If
Ben Lindstrom9f049032002-06-21 00:59:05 +00001557.Cm UsePrivilegeSeparation
1558is specified, it will be disabled after authentication.
Damien Miller2e193e22003-05-14 15:13:03 +10001559.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001560Enables the Pluggable Authentication Module interface.
1561If set to
1562.Dq yes
1563this will enable PAM authentication using
1564.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001565and
1566.Cm PasswordAuthentication
1567in addition to PAM account and session module processing for all
1568authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001569.Pp
1570Because PAM challenge-response authentication usually serves an equivalent
1571role to password authentication, you should disable either
1572.Cm PasswordAuthentication
1573or
1574.Cm ChallengeResponseAuthentication.
1575.Pp
1576If
1577.Cm UsePAM
1578is enabled, you will not be able to run
1579.Xr sshd 8
1580as a non-root user.
1581The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +10001582.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001583.It Cm UsePrivilegeSeparation
1584Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001585.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001586separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +10001587to deal with incoming network traffic.
1588After successful authentication, another process will be created that has
1589the privilege of the authenticated user.
1590The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +00001591escalation by containing any corruption within the unprivileged processes.
sobrado@openbsd.orgbdcb73f2015-10-07 14:45:30 +00001592The argument must be
1593.Dq yes ,
1594.Dq no ,
1595or
1596.Dq sandbox .
Damien Miller69ff1df2011-06-23 08:30:03 +10001597If
1598.Cm UsePrivilegeSeparation
1599is set to
1600.Dq sandbox
1601then the pre-authentication unprivileged process is subject to additional
1602restrictions.
sobrado@openbsd.orgbdcb73f2015-10-07 14:45:30 +00001603The default is
1604.Dq sandbox .
Damien Miller23528812012-04-22 11:24:43 +10001605.It Cm VersionAddendum
1606Optionally specifies additional text to append to the SSH protocol banner
1607sent by the server upon connection.
1608The default is
1609.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001610.It Cm X11DisplayOffset
1611Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001612.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001613X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001614This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001615The default is 10.
1616.It Cm X11Forwarding
1617Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001618The argument must be
1619.Dq yes
1620or
1621.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001622The default is
1623.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +10001624.Pp
1625When X11 forwarding is enabled, there may be additional exposure to
1626the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001627.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001628proxy display is configured to listen on the wildcard address (see
1629.Cm X11UseLocalhost
Damien Miller5b0d63f2006-03-15 11:56:56 +11001630below), though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001631Additionally, the authentication spoofing and authentication data
1632verification and substitution occur on the client side.
1633The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001634display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001635forwarding (see the warnings for
1636.Cm ForwardX11
1637in
Damien Millerf1ce5052003-06-11 22:04:39 +10001638.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001639A system administrator may have a stance in which they want to
1640protect clients that may expose themselves to attack by unwittingly
1641requesting X11 forwarding, which can warrant a
1642.Dq no
1643setting.
1644.Pp
1645Note that disabling X11 forwarding does not prevent users from
1646forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001647X11 forwarding is automatically disabled if
1648.Cm UseLogin
1649is enabled.
1650.It Cm X11UseLocalhost
1651Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001652.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001653should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001654the wildcard address.
1655By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001656sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001657hostname part of the
1658.Ev DISPLAY
1659environment variable to
1660.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001661This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001662However, some older X11 clients may not function with this
1663configuration.
1664.Cm X11UseLocalhost
1665may be set to
1666.Dq no
1667to specify that the forwarding server should be bound to the wildcard
1668address.
1669The argument must be
1670.Dq yes
1671or
1672.Dq no .
1673The default is
1674.Dq yes .
1675.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001676Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001677.Xr xauth 1
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001678program, or
1679.Dq none
1680to not use one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001681The default is
1682.Pa /usr/X11R6/bin/xauth .
1683.El
Damien Millere3beba22006-03-15 11:59:25 +11001684.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001685.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001686command-line arguments and configuration file options that specify time
1687may be expressed using a sequence of the form:
1688.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001689.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001690.Sm on
1691where
1692.Ar time
1693is a positive integer value and
1694.Ar qualifier
1695is one of the following:
1696.Pp
1697.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001698.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001699seconds
1700.It Cm s | Cm S
1701seconds
1702.It Cm m | Cm M
1703minutes
1704.It Cm h | Cm H
1705hours
1706.It Cm d | Cm D
1707days
1708.It Cm w | Cm W
1709weeks
1710.El
1711.Pp
1712Each member of the sequence is added together to calculate
1713the total time value.
1714.Pp
1715Time format examples:
1716.Pp
1717.Bl -tag -width Ds -compact -offset indent
1718.It 600
1719600 seconds (10 minutes)
1720.It 10m
172110 minutes
1722.It 1h30m
17231 hour 30 minutes (90 minutes)
1724.El
1725.Sh FILES
1726.Bl -tag -width Ds
1727.It Pa /etc/ssh/sshd_config
1728Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001729.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001730This file should be writable by root only, but it is recommended
1731(though not necessary) that it be world-readable.
1732.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001733.Sh SEE ALSO
1734.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001735.Sh AUTHORS
1736OpenSSH is a derivative of the original and free
1737ssh 1.2.12 release by Tatu Ylonen.
1738Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1739Theo de Raadt and Dug Song
1740removed many bugs, re-added newer features and
1741created OpenSSH.
1742Markus Friedl contributed the support for SSH
1743protocol versions 1.5 and 2.0.
1744Niels Provos and Markus Friedl contributed support
1745for privilege separation.