blob: 63807c030018a9cb4b9a30a1f20193cb808a6bf7 [file] [log] [blame]
Ben Lindstrom9f049032002-06-21 00:59:05 +00001.\"
2.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
3.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4.\" All rights reserved
5.\"
6.\" As far as I am concerned, the code I have written for this software
7.\" can be used freely for any purpose. Any derived versions of this
8.\" software must be clearly marked as such, and if the derived work is
9.\" incompatible with the protocol description in the RFC file, it must be
10.\" called by a name other than "ssh" or "Secure Shell".
11.\"
12.\" Copyright (c) 1999,2000 Markus Friedl. All rights reserved.
13.\" Copyright (c) 1999 Aaron Campbell. All rights reserved.
14.\" Copyright (c) 1999 Theo de Raadt. All rights reserved.
15.\"
16.\" Redistribution and use in source and binary forms, with or without
17.\" modification, are permitted provided that the following conditions
18.\" are met:
19.\" 1. Redistributions of source code must retain the above copyright
20.\" notice, this list of conditions and the following disclaimer.
21.\" 2. Redistributions in binary form must reproduce the above copyright
22.\" notice, this list of conditions and the following disclaimer in the
23.\" documentation and/or other materials provided with the distribution.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
26.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
29.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35.\"
jmc@openbsd.orgee1e0a12016-04-27 13:53:48 +000036.\" $OpenBSD: sshd_config.5,v 1.222 2016/04/27 13:53:48 jmc Exp $
37.Dd $Mdocdate: April 27 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
192authentication method names.
193Successful authentication requires completion of every method in at least
194one of these lists.
195.Pp
196For example, an argument of
197.Dq publickey,password publickey,keyboard-interactive
198would require the user to complete public key authentication, followed by
199either password or keyboard interactive authentication.
200Only methods that are next in one or more lists are offered at each stage,
201so for this example, it would not be possible to attempt password or
202keyboard-interactive authentication before public key.
203.Pp
Damien Miller91a55f22013-04-23 15:18:10 +1000204For keyboard interactive authentication it is also possible to
205restrict authentication to a specific device by appending a
206colon followed by the device identifier
207.Dq bsdauth ,
208.Dq pam ,
209or
210.Dq skey ,
211depending on the server configuration.
212For example,
213.Dq keyboard-interactive:bsdauth
214would restrict keyboard interactive authentication to the
215.Dq bsdauth
216device.
217.Pp
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000218If the
219.Dq publickey
jmc@openbsd.org449e11b2014-12-22 08:24:17 +0000220method is listed more than once,
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000221.Xr sshd 8
222verifies that keys that have been used successfully are not reused for
223subsequent authentications.
224For example, an
225.Cm AuthenticationMethods
226of
227.Dq publickey,publickey
228will require successful authentication using two different public keys.
229.Pp
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000230This option will yield a fatal
Damien Millera6e3f012012-11-04 23:21:40 +1100231error if enabled if protocol 1 is also enabled.
232Note that each authentication method listed should also be explicitly enabled
233in the configuration.
234The default is not to require multiple authentication; successful completion
235of a single authentication method is sufficient.
Damien Miller09d3e122012-10-31 08:58:58 +1100236.It Cm AuthorizedKeysCommand
Damien Millerf33580e2012-11-04 22:22:52 +1100237Specifies a program to be used to look up the user's public keys.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000238The program must be owned by root, not writable by group or others and
239specified by an absolute path.
240.Pp
241Arguments to
242.Cm AuthorizedKeysCommand
243may be provided using the following tokens, which will be expanded
244at runtime: %% is replaced by a literal '%', %u is replaced by the
245username being authenticated, %h is replaced by the home directory
246of the user being authenticated, %t is replaced with the key type
247offered for authentication, %f is replaced with the fingerprint of
248the key, and %k is replaced with the key being offered for authentication.
249If no arguments are specified then the username of the target user
250will be supplied.
251.Pp
252The program should produce on standard output zero or
Damien Millerfecfd112013-07-18 16:11:50 +1000253more lines of authorized_keys output (see AUTHORIZED_KEYS in
Damien Millerf33580e2012-11-04 22:22:52 +1100254.Xr sshd 8 ) .
Damien Miller09d3e122012-10-31 08:58:58 +1100255If a key supplied by AuthorizedKeysCommand does not successfully authenticate
256and authorize the user then public key authentication continues using the usual
257.Cm AuthorizedKeysFile
258files.
259By default, no AuthorizedKeysCommand is run.
260.It Cm AuthorizedKeysCommandUser
261Specifies the user under whose account the AuthorizedKeysCommand is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100262It is recommended to use a dedicated user that has no other role on the host
263than running authorized keys commands.
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000264If
djm@openbsd.orgd663bea2014-12-11 05:25:06 +0000265.Cm AuthorizedKeysCommand
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000266is specified but
267.Cm AuthorizedKeysCommandUser
268is not, then
269.Xr sshd 8
270will refuse to start.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000271.It Cm AuthorizedKeysFile
272Specifies the file that contains the public keys that can be used
273for user authentication.
Damien Miller6018a362010-07-02 13:35:19 +1000274The format is described in the
Damien Millerfecfd112013-07-18 16:11:50 +1000275AUTHORIZED_KEYS FILE FORMAT
Damien Miller6018a362010-07-02 13:35:19 +1000276section of
277.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000278.Cm AuthorizedKeysFile
279may contain tokens of the form %T which are substituted during connection
Damien Miller5b0d63f2006-03-15 11:56:56 +1100280setup.
Damien Millerfbf486b2003-05-23 18:44:23 +1000281The following tokens are defined: %% is replaced by a literal '%',
Damien Miller5b0d63f2006-03-15 11:56:56 +1100282%h is replaced by the home directory of the user being authenticated, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000283%u is replaced by the username of that user.
284After expansion,
285.Cm AuthorizedKeysFile
286is taken to be an absolute path or one relative to the user's home
287directory.
Damien Millerb9132fc2011-05-29 21:41:40 +1000288Multiple files may be listed, separated by whitespace.
djm@openbsd.org2bca8a42015-09-11 03:13:36 +0000289Alternately this option may be set to
290.Dq none
291to skip checking for user keys in files.
Damien Millerb9132fc2011-05-29 21:41:40 +1000292The default is
293.Dq .ssh/authorized_keys .ssh/authorized_keys2 .
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000294.It Cm AuthorizedPrincipalsCommand
295Specifies a program to be used to generate the list of allowed
296certificate principals as per
297.Cm AuthorizedPrincipalsFile .
298The program must be owned by root, not writable by group or others and
299specified by an absolute path.
300.Pp
301Arguments to
302.Cm AuthorizedPrincipalsCommand
303may be provided using the following tokens, which will be expanded
304at runtime: %% is replaced by a literal '%', %u is replaced by the
305username being authenticated and %h is replaced by the home directory
306of the user being authenticated.
307.Pp
308The program should produce on standard output zero or
309more lines of
310.Cm AuthorizedPrincipalsFile
311output.
312If either
313.Cm AuthorizedPrincipalsCommand
314or
315.Cm AuthorizedPrincipalsFile
316is specified, then certificates offered by the client for authentication
317must contain a principal that is listed.
318By default, no AuthorizedPrincipalsCommand is run.
319.It Cm AuthorizedPrincipalsCommandUser
320Specifies the user under whose account the AuthorizedPrincipalsCommand is run.
321It is recommended to use a dedicated user that has no other role on the host
322than running authorized principals commands.
323If
324.Cm AuthorizedPrincipalsCommand
325is specified but
326.Cm AuthorizedPrincipalsCommandUser
327is not, then
328.Xr sshd 8
329will refuse to start.
Damien Miller30da3442010-05-10 11:58:03 +1000330.It Cm AuthorizedPrincipalsFile
331Specifies a file that lists principal names that are accepted for
332certificate authentication.
333When using certificates signed by a key listed in
334.Cm TrustedUserCAKeys ,
335this file lists names, one of which must appear in the certificate for it
336to be accepted for authentication.
Damien Millerd59dab82010-07-02 13:37:17 +1000337Names are listed one per line preceded by key options (as described
Damien Millerfecfd112013-07-18 16:11:50 +1000338in AUTHORIZED_KEYS FILE FORMAT in
Damien Millerd59dab82010-07-02 13:37:17 +1000339.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000340Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000341.Ql #
342are ignored.
343.Pp
344.Cm AuthorizedPrincipalsFile
345may contain tokens of the form %T which are substituted during connection
346setup.
347The following tokens are defined: %% is replaced by a literal '%',
348%h is replaced by the home directory of the user being authenticated, and
349%u is replaced by the username of that user.
350After expansion,
351.Cm AuthorizedPrincipalsFile
352is taken to be an absolute path or one relative to the user's home
353directory.
354.Pp
Damien Miller8fef9eb2012-04-22 11:25:10 +1000355The default is
356.Dq none ,
357i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000358of the user must appear in a certificate's principals list for it to be
359accepted.
360Note that
361.Cm AuthorizedPrincipalsFile
362is only used when authentication proceeds using a CA listed in
363.Cm TrustedUserCAKeys
364and is not consulted for certification authorities trusted via
365.Pa ~/.ssh/authorized_keys ,
366though the
367.Cm principals=
368key option offers a similar facility (see
369.Xr sshd 8
370for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000371.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000372The contents of the specified file are sent to the remote user before
373authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000374If the argument is
375.Dq none
376then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000377By 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
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000435The default is
436.Dq none ,
437indicating not to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100438.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000439.It Cm Ciphers
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000440Specifies the ciphers allowed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000441Multiple ciphers must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000442If the specified value begins with a
443.Sq +
444character, then the specified ciphers will be appended to the default set
445instead of replacing them.
446.Pp
Damien Miller0fde8ac2013-11-21 14:12:23 +1100447The supported ciphers are:
448.Pp
Damien Millerc1621c82014-04-20 13:22:46 +1000449.Bl -item -compact -offset indent
450.It
4513des-cbc
452.It
453aes128-cbc
454.It
455aes192-cbc
456.It
457aes256-cbc
458.It
459aes128-ctr
460.It
461aes192-ctr
462.It
463aes256-ctr
464.It
465aes128-gcm@openssh.com
466.It
467aes256-gcm@openssh.com
468.It
469arcfour
470.It
471arcfour128
472.It
473arcfour256
474.It
475blowfish-cbc
476.It
477cast128-cbc
478.It
479chacha20-poly1305@openssh.com
480.El
Damien Miller0fde8ac2013-11-21 14:12:23 +1100481.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100482The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000483.Bd -literal -offset indent
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000484chacha20-poly1305@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000485aes128-ctr,aes192-ctr,aes256-ctr,
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000486aes128-gcm@openssh.com,aes256-gcm@openssh.com
Ben Lindstrom9f049032002-06-21 00:59:05 +0000487.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100488.Pp
489The list of available ciphers may also be obtained using the
490.Fl Q
491option of
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000492.Xr ssh 1
493with an argument of
494.Dq cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000495.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100496Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000497sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100498.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000499receiving any messages back from the client.
500If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100501sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000502It is important to note that the use of client alive messages is very
503different from
Damien Miller12c150e2003-12-17 16:31:10 +1100504.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000505(below).
506The client alive messages are sent through the encrypted channel
507and therefore will not be spoofable.
508The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100509.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000510is spoofable.
511The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000512server depend on knowing when a connection has become inactive.
513.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000514The default value is 3.
515If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000516.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100517(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000518.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100519is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000520will be disconnected after approximately 45 seconds.
Damien Miller1594ad52005-05-26 12:12:19 +1000521.It Cm ClientAliveInterval
522Sets a timeout interval in seconds after which if no data has been received
523from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100524.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000525will send a message through the encrypted
526channel to request a response from the client.
527The default
528is 0, indicating that these messages will not be sent to the client.
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.
jmc@openbsd.orgee1e0a12016-04-27 13:53:48 +0000565HOST criteria may additionally contain addresses to match in CIDR
566address/masklen format.
Damien Millerac73e512006-03-15 11:58:49 +1100567The allow/deny directives are processed in the following order:
568.Cm DenyUsers ,
569.Cm AllowUsers ,
570.Cm DenyGroups ,
571and finally
572.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100573.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000574See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100575.Xr ssh_config 5
576for more information on patterns.
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000577.It Cm FingerprintHash
578Specifies the hash algorithm used when logging key fingerprints.
579Valid options are:
580.Dq md5
581and
582.Dq sha256 .
583The default is
584.Dq sha256 .
Damien Millere2754432006-07-24 14:06:47 +1000585.It Cm ForceCommand
586Forces the execution of the command specified by
587.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100588ignoring any command supplied by the client and
589.Pa ~/.ssh/rc
590if present.
Damien Millere2754432006-07-24 14:06:47 +1000591The command is invoked by using the user's login shell with the -c option.
592This applies to shell, command, or subsystem execution.
593It is most useful inside a
594.Cm Match
595block.
596The command originally supplied by the client is available in the
597.Ev SSH_ORIGINAL_COMMAND
598environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100599Specifying a command of
600.Dq internal-sftp
601will force the use of an in-process sftp server that requires no support
602files when used with
603.Cm ChrootDirectory .
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000604The default is
605.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000606.It Cm GatewayPorts
607Specifies whether remote hosts are allowed to connect to ports
608forwarded for the client.
609By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100610.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000611binds remote port forwardings to the loopback address.
612This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000613.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100614can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100615should allow remote port forwardings to bind to non-loopback addresses, thus
616allowing other hosts to connect.
617The argument may be
618.Dq no
619to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000620.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100621to force remote port forwardings to bind to the wildcard address, or
622.Dq clientspecified
623to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000624The default is
625.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000626.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000627Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100628The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000629.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000630.It Cm GSSAPICleanupCredentials
631Specifies whether to automatically destroy the user's credentials cache
632on logout.
633The default is
634.Dq yes .
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000635.It Cm GSSAPIStrictAcceptorCheck
636Determines whether to be strict about the identity of the GSSAPI acceptor
637a client authenticates against.
638If set to
639.Dq yes
640then the client must authenticate against the
641.Pa host
642service on the current hostname.
643If set to
644.Dq no
645then the client may authenticate against any service key stored in the
646machine's default store.
647This facility is provided to assist with operation on multi homed machines.
648The default is
649.Dq yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000650.It Cm HostbasedAcceptedKeyTypes
651Specifies the key types that will be accepted for hostbased authentication
652as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000653Alternately if the specified value begins with a
654.Sq +
655character, then the specified key types will be appended to the default set
656instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000657The default for this option is:
658.Bd -literal -offset 3n
659ecdsa-sha2-nistp256-cert-v01@openssh.com,
660ecdsa-sha2-nistp384-cert-v01@openssh.com,
661ecdsa-sha2-nistp521-cert-v01@openssh.com,
662ssh-ed25519-cert-v01@openssh.com,
663ssh-rsa-cert-v01@openssh.com,
664ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +0000665ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000666.Ed
667.Pp
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000668The
669.Fl Q
670option of
671.Xr ssh 1
672may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000673.It Cm HostbasedAuthentication
674Specifies whether rhosts or /etc/hosts.equiv authentication together
675with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100676(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000677The default is
678.Dq no .
Damien Millerb594f382006-08-30 11:06:34 +1000679.It Cm HostbasedUsesNameFromPacketOnly
680Specifies whether or not the server will attempt to perform a reverse
681name lookup when matching the name in the
682.Pa ~/.shosts ,
683.Pa ~/.rhosts ,
684and
685.Pa /etc/hosts.equiv
686files during
687.Cm HostbasedAuthentication .
688A setting of
689.Dq yes
690means that
691.Xr sshd 8
692uses the name supplied by the client rather than
693attempting to resolve the name from the TCP connection itself.
694The default is
695.Dq no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100696.It Cm HostCertificate
697Specifies a file containing a public host certificate.
698The certificate's public key must match a private host key already specified
699by
700.Cm HostKey .
701The default behaviour of
702.Xr sshd 8
703is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000704.It Cm HostKey
705Specifies a file containing a private host key
706used by SSH.
707The default is
708.Pa /etc/ssh/ssh_host_key
709for protocol version 1, and
Damien Millereb8b60e2010-08-31 22:41:14 +1000710.Pa /etc/ssh/ssh_host_dsa_key ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100711.Pa /etc/ssh/ssh_host_ecdsa_key ,
712.Pa /etc/ssh/ssh_host_ed25519_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000713and
Damien Millereb8b60e2010-08-31 22:41:14 +1000714.Pa /etc/ssh/ssh_host_rsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000715for protocol version 2.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000716.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000717Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100718.Xr sshd 8
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000719will refuse to use a file if it is group/world-accessible
720and that the
721.Cm HostKeyAlgorithms
722option restricts which of the keys are actually used by
723.Xr sshd 8 .
724.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000725It is possible to have multiple host key files.
726.Dq rsa1
727keys are used for version 1 and
Damien Millereb8b60e2010-08-31 22:41:14 +1000728.Dq dsa ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100729.Dq ecdsa ,
730.Dq ed25519
Ben Lindstrom9f049032002-06-21 00:59:05 +0000731or
732.Dq rsa
733are used for version 2 of the SSH protocol.
Damien Miller85b45e02013-07-20 13:21:52 +1000734It is also possible to specify public host key files instead.
735In this case operations on the private key will be delegated
736to an
737.Xr ssh-agent 1 .
738.It Cm HostKeyAgent
739Identifies the UNIX-domain socket used to communicate
740with an agent that has access to the private host keys.
741If
742.Dq SSH_AUTH_SOCK
743is specified, the location of the socket will be read from the
744.Ev SSH_AUTH_SOCK
745environment variable.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000746.It Cm HostKeyAlgorithms
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000747Specifies the host key algorithms
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000748that the server offers.
749The default for this option is:
750.Bd -literal -offset 3n
751ecdsa-sha2-nistp256-cert-v01@openssh.com,
752ecdsa-sha2-nistp384-cert-v01@openssh.com,
753ecdsa-sha2-nistp521-cert-v01@openssh.com,
754ssh-ed25519-cert-v01@openssh.com,
755ssh-rsa-cert-v01@openssh.com,
756ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +0000757ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000758.Ed
759.Pp
760The list of available key types may also be obtained using the
761.Fl Q
762option of
763.Xr ssh 1
764with an argument of
765.Dq key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000766.It Cm IgnoreRhosts
767Specifies that
768.Pa .rhosts
769and
770.Pa .shosts
771files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000772.Cm RhostsRSAAuthentication
773or
774.Cm HostbasedAuthentication .
775.Pp
776.Pa /etc/hosts.equiv
777and
778.Pa /etc/shosts.equiv
779are still used.
780The default is
781.Dq yes .
782.It Cm IgnoreUserKnownHosts
783Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100784.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000785should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000786.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000787during
788.Cm RhostsRSAAuthentication
789or
790.Cm HostbasedAuthentication .
791The default is
792.Dq no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100793.It Cm IPQoS
794Specifies the IPv4 type-of-service or DSCP class for the connection.
795Accepted values are
796.Dq af11 ,
797.Dq af12 ,
798.Dq af13 ,
Damien Millerf6e758c2011-09-22 21:37:13 +1000799.Dq af21 ,
Damien Miller0dac6fb2010-11-20 15:19:38 +1100800.Dq af22 ,
801.Dq af23 ,
802.Dq af31 ,
803.Dq af32 ,
804.Dq af33 ,
805.Dq af41 ,
806.Dq af42 ,
807.Dq af43 ,
808.Dq cs0 ,
809.Dq cs1 ,
810.Dq cs2 ,
811.Dq cs3 ,
812.Dq cs4 ,
813.Dq cs5 ,
814.Dq cs6 ,
815.Dq cs7 ,
816.Dq ef ,
817.Dq lowdelay ,
818.Dq throughput ,
819.Dq reliability ,
820or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +1100821This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100822If one argument is specified, it is used as the packet class unconditionally.
823If two values are specified, the first is automatically selected for
824interactive sessions and the second for non-interactive sessions.
825The default is
826.Dq lowdelay
827for interactive sessions and
828.Dq throughput
829for non-interactive sessions.
Damien Millere1e480a2014-02-04 11:13:17 +1100830.It Cm KbdInteractiveAuthentication
831Specifies whether to allow keyboard-interactive authentication.
832The argument to this keyword must be
833.Dq yes
834or
835.Dq no .
836The default is to use whatever value
837.Cm ChallengeResponseAuthentication
838is set to
839(by default
840.Dq yes ) .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000841.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000842Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000843.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000844will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000845To use this option, the server needs a
846Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100847The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000848.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100849.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000850If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100851an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100852The default is
Damien Miller8448e662004-03-08 23:13:15 +1100853.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000854.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100855If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000856the password will be validated via any additional local mechanism
857such as
858.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100859The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000860.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000861.It Cm KerberosTicketCleanup
862Specifies whether to automatically destroy the user's ticket cache
863file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100864The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000865.Dq yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000866.It Cm KexAlgorithms
867Specifies the available KEX (Key Exchange) algorithms.
868Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000869Alternately if the specified value begins with a
870.Sq +
871character, then the specified methods will be appended to the default set
872instead of replacing them.
Damien Millerc1621c82014-04-20 13:22:46 +1000873The supported algorithms are:
874.Pp
875.Bl -item -compact -offset indent
876.It
877curve25519-sha256@libssh.org
878.It
879diffie-hellman-group1-sha1
880.It
881diffie-hellman-group14-sha1
882.It
883diffie-hellman-group-exchange-sha1
884.It
885diffie-hellman-group-exchange-sha256
886.It
887ecdh-sha2-nistp256
888.It
889ecdh-sha2-nistp384
890.It
891ecdh-sha2-nistp521
892.El
893.Pp
894The default is:
Damien Miller6575c3a2013-12-18 17:47:02 +1100895.Bd -literal -offset indent
896curve25519-sha256@libssh.org,
897ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
898diffie-hellman-group-exchange-sha256,
Damien Millerc1621c82014-04-20 13:22:46 +1000899diffie-hellman-group14-sha1
Damien Miller6575c3a2013-12-18 17:47:02 +1100900.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000901.Pp
902The list of available key exchange algorithms may also be obtained using the
903.Fl Q
904option of
905.Xr ssh 1
906with an argument of
907.Dq kex .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000908.It Cm KeyRegenerationInterval
909In protocol version 1, the ephemeral server key is automatically regenerated
910after this many seconds (if it has been used).
911The purpose of regeneration is to prevent
912decrypting captured sessions by later breaking into the machine and
913stealing the keys.
914The key is never stored anywhere.
915If the value is 0, the key is never regenerated.
916The default is 3600 (seconds).
917.It Cm ListenAddress
918Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100919.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000920should listen on.
921The following forms may be used:
922.Pp
923.Bl -item -offset indent -compact
924.It
925.Cm ListenAddress
926.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000927.Ar host | Ar IPv4_addr | Ar IPv6_addr
Ben Lindstrom9f049032002-06-21 00:59:05 +0000928.Sm on
929.It
930.Cm ListenAddress
931.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000932.Ar host | Ar IPv4_addr : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000933.Sm on
934.It
935.Cm ListenAddress
936.Sm off
937.Oo
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000938.Ar host | Ar IPv6_addr Oc : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000939.Sm on
940.El
941.Pp
942If
943.Ar port
944is not specified,
dtucker@openbsd.org531a57a2015-04-29 03:48:56 +0000945sshd will listen on the address and all
Ben Lindstrom9f049032002-06-21 00:59:05 +0000946.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000947options specified.
948The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000949Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000950.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000951options are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000952.It Cm LoginGraceTime
953The server disconnects after this time if the user has not
954successfully logged in.
955If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000956The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000957.It Cm LogLevel
958Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100959.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000960The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100961QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000962The default is INFO.
963DEBUG and DEBUG1 are equivalent.
964DEBUG2 and DEBUG3 each specify higher levels of debugging output.
965Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000966.It Cm MACs
967Specifies the available MAC (message authentication code) algorithms.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000968The MAC algorithm is used for data integrity protection.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000969Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000970If the specified value begins with a
971.Sq +
972character, then the specified algorithms will be appended to the default set
973instead of replacing them.
974.Pp
Damien Milleraf43a7a2012-12-12 10:46:31 +1100975The algorithms that contain
976.Dq -etm
977calculate the MAC after encryption (encrypt-then-mac).
978These are considered safer and their use recommended.
Damien Millerc1621c82014-04-20 13:22:46 +1000979The supported MACs are:
980.Pp
981.Bl -item -compact -offset indent
982.It
983hmac-md5
984.It
985hmac-md5-96
986.It
987hmac-ripemd160
988.It
989hmac-sha1
990.It
991hmac-sha1-96
992.It
993hmac-sha2-256
994.It
995hmac-sha2-512
996.It
997umac-64@openssh.com
998.It
999umac-128@openssh.com
1000.It
1001hmac-md5-etm@openssh.com
1002.It
1003hmac-md5-96-etm@openssh.com
1004.It
1005hmac-ripemd160-etm@openssh.com
1006.It
1007hmac-sha1-etm@openssh.com
1008.It
1009hmac-sha1-96-etm@openssh.com
1010.It
1011hmac-sha2-256-etm@openssh.com
1012.It
1013hmac-sha2-512-etm@openssh.com
1014.It
1015umac-64-etm@openssh.com
1016.It
1017umac-128-etm@openssh.com
1018.El
1019.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +11001020The default is:
Damien Miller22b7b492007-06-11 14:07:12 +10001021.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +11001022umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1023hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001024hmac-sha1-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +10001025umac-64@openssh.com,umac-128@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001026hmac-sha2-256,hmac-sha2-512,hmac-sha1
Damien Miller22b7b492007-06-11 14:07:12 +10001027.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001028.Pp
1029The list of available MAC algorithms may also be obtained using the
1030.Fl Q
1031option of
1032.Xr ssh 1
1033with an argument of
1034.Dq mac .
Darren Tucker45150472006-07-12 22:34:17 +10001035.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +10001036Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +10001037If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +10001038.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001039line are satisfied, the keywords on the following lines override those
1040set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +10001041.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001042line or the end of the file.
Damien Millerfc5d6752014-02-28 10:01:28 +11001043If a keyword appears in multiple
1044.Cm Match
sobrado@openbsd.org180bcb42014-08-30 16:32:25 +00001045blocks that are satisfied, only the first instance of the keyword is
Damien Millerfc5d6752014-02-28 10:01:28 +11001046applied.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001047.Pp
Damien Millerd04f3572006-07-24 13:46:50 +10001048The arguments to
Darren Tucker45150472006-07-12 22:34:17 +10001049.Cm Match
Damien Millercf31f382013-10-24 21:02:56 +11001050are one or more criteria-pattern pairs or the single token
1051.Cm All
1052which matches all criteria.
Darren Tucker45150472006-07-12 22:34:17 +10001053The available criteria are
1054.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +10001055.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +10001056.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +10001057.Cm LocalAddress ,
1058.Cm LocalPort ,
Darren Tucker45150472006-07-12 22:34:17 +10001059and
1060.Cm Address .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001061The match patterns may consist of single entries or comma-separated
1062lists and may use the wildcard and negation operators described in the
Damien Millerfecfd112013-07-18 16:11:50 +10001063PATTERNS section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +10001064.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001065.Pp
1066The patterns in an
1067.Cm Address
1068criteria may additionally contain addresses to match in CIDR
Darren Tucker6a2a4002008-06-10 23:03:04 +10001069address/masklen format, e.g.\&
Darren Tucker7a3935d2008-06-10 22:59:10 +10001070.Dq 192.0.2.0/24
1071or
1072.Dq 3ffe:ffff::/32 .
1073Note that the mask length provided must be consistent with the address -
1074it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +10001075or one with bits set in this host portion of the address.
1076For example,
Darren Tucker7a3935d2008-06-10 22:59:10 +10001077.Dq 192.0.2.0/33
1078and
Darren Tucker6a2a4002008-06-10 23:03:04 +10001079.Dq 192.0.2.0/8
Darren Tucker7a3935d2008-06-10 22:59:10 +10001080respectively.
1081.Pp
Darren Tucker45150472006-07-12 22:34:17 +10001082Only a subset of keywords may be used on the lines following a
1083.Cm Match
1084keyword.
1085Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +10001086.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +11001087.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +10001088.Cm AllowGroups ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001089.Cm AllowStreamLocalForwarding ,
Damien Miller9b439df2006-07-24 14:04:00 +10001090.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +10001091.Cm AllowUsers ,
Damien Millera6e3f012012-11-04 23:21:40 +11001092.Cm AuthenticationMethods ,
Damien Miller09d3e122012-10-31 08:58:58 +11001093.Cm AuthorizedKeysCommand ,
1094.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +11001095.Cm AuthorizedKeysFile ,
djm@openbsd.orgb6b91082015-11-13 02:57:46 +00001096.Cm AuthorizedPrincipalsCommand ,
1097.Cm AuthorizedPrincipalsCommandUser ,
Damien Millerab6de352010-06-26 09:38:45 +10001098.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +11001099.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +10001100.Cm ChrootDirectory ,
Damien Millerc24da772012-06-20 21:53:58 +10001101.Cm DenyGroups ,
1102.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +10001103.Cm ForceCommand ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001104.Cm GatewayPorts ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +00001105.Cm GSSAPIAuthentication ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001106.Cm HostbasedAcceptedKeyTypes ,
Damien Miller25434de2008-05-19 14:29:08 +10001107.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +10001108.Cm HostbasedUsesNameFromPacketOnly ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001109.Cm IPQoS ,
Darren Tucker1d75f222007-03-01 21:31:28 +11001110.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +11001111.Cm KerberosAuthentication ,
Damien Miller307c1d12008-06-16 07:56:20 +10001112.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +10001113.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +11001114.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +11001115.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +10001116.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +11001117.Cm PermitRootLogin ,
Damien Miller5ff30c62013-10-30 22:21:50 +11001118.Cm PermitTTY ,
Damien Millerab6de352010-06-26 09:38:45 +10001119.Cm PermitTunnel ,
Damien Miller72e6b5c2014-07-04 09:00:04 +10001120.Cm PermitUserRC ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001121.Cm PubkeyAcceptedKeyTypes ,
Darren Tucker1477ea12009-10-07 08:36:05 +11001122.Cm PubkeyAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001123.Cm RekeyLimit ,
1124.Cm RevokedKeys ,
1125.Cm RhostsRSAAuthentication ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +00001126.Cm RSAAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001127.Cm StreamLocalBindMask ,
1128.Cm StreamLocalBindUnlink ,
1129.Cm TrustedUserCAKeys ,
Damien Millerd1de9952006-07-24 14:05:48 +10001130.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +11001131.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +10001132and
Damien Miller0296ae82009-02-23 11:00:24 +11001133.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +10001134.It Cm MaxAuthTries
1135Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +10001136connection.
1137Once the number of failures reaches half this value,
1138additional failures are logged.
1139The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +10001140.It Cm MaxSessions
djm@openbsd.orgcac3b662016-02-05 02:37:56 +00001141Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1142sessions permitted per network connection.
1143Multiple sessions may be established by clients that support connection
1144multiplexing.
1145Setting
1146.Cm MaxSessions
1147to 1 will effectively disable session multiplexing, whereas setting it to 0
1148will prevent all shell, login and subsystem sessions while still permitting
1149forwarding.
Damien Miller7207f642008-05-19 15:34:50 +10001150The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001151.It Cm MaxStartups
1152Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001153SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001154Additional connections will be dropped until authentication succeeds or the
1155.Cm LoginGraceTime
1156expires for a connection.
Damien Miller1f583df2013-02-12 11:02:08 +11001157The default is 10:30:100.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001158.Pp
1159Alternatively, random early drop can be enabled by specifying
1160the three colon separated values
1161.Dq start:rate:full
Damien Miller208f1ed2006-03-15 11:56:03 +11001162(e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +11001163.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001164will refuse connection attempts with a probability of
1165.Dq rate/100
1166(30%)
1167if there are currently
1168.Dq start
1169(10)
1170unauthenticated connections.
1171The probability increases linearly and all connection attempts
1172are refused if the number of unauthenticated connections reaches
1173.Dq full
1174(60).
1175.It Cm PasswordAuthentication
1176Specifies whether password authentication is allowed.
1177The default is
1178.Dq yes .
1179.It Cm PermitEmptyPasswords
1180When password authentication is allowed, it specifies whether the
1181server allows login to accounts with empty password strings.
1182The default is
1183.Dq no .
Damien Miller9b439df2006-07-24 14:04:00 +10001184.It Cm PermitOpen
1185Specifies the destinations to which TCP port forwarding is permitted.
1186The forwarding specification must be one of the following forms:
1187.Pp
1188.Bl -item -offset indent -compact
1189.It
1190.Cm PermitOpen
1191.Sm off
1192.Ar host : port
1193.Sm on
1194.It
1195.Cm PermitOpen
1196.Sm off
1197.Ar IPv4_addr : port
1198.Sm on
1199.It
1200.Cm PermitOpen
1201.Sm off
1202.Ar \&[ IPv6_addr \&] : port
1203.Sm on
1204.El
1205.Pp
Damien Millera765cf42006-07-24 14:08:13 +10001206Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +10001207An argument of
1208.Dq any
1209can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +10001210An argument of
1211.Dq none
1212can be used to prohibit all forwarding requests.
Damien Miller65bc2c42006-07-24 14:04:16 +10001213By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001214.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +11001215Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +00001216.Xr ssh 1 .
1217The argument must be
1218.Dq yes ,
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001219.Dq prohibit-password ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001220.Dq without-password ,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001221.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001222or
1223.Dq no .
1224The default is
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001225.Dq prohibit-password .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001226.Pp
1227If this option is set to
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001228.Dq prohibit-password
1229or
Damien Miller5b0d63f2006-03-15 11:56:56 +11001230.Dq without-password ,
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001231password and keyboard-interactive authentication are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001232.Pp
1233If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001234.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001235root login with public key authentication will be allowed,
1236but only if the
1237.Ar command
1238option has been specified
1239(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +10001240normally not allowed).
1241All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001242.Pp
1243If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001244.Dq no ,
Darren Tuckerb3509012005-01-20 11:01:46 +11001245root is not allowed to log in.
Damien Millerd27b9472005-12-13 19:29:02 +11001246.It Cm PermitTunnel
1247Specifies whether
1248.Xr tun 4
1249device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +11001250The argument must be
1251.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +10001252.Dq point-to-point
1253(layer 3),
1254.Dq ethernet
1255(layer 2), or
Damien Miller7b58e802005-12-13 19:33:19 +11001256.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +10001257Specifying
1258.Dq yes
1259permits both
1260.Dq point-to-point
1261and
1262.Dq ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +11001263The default is
1264.Dq no .
djm@openbsd.org48dffd52014-09-09 09:45:36 +00001265.Pp
1266Independent of this setting, the permissions of the selected
1267.Xr tun 4
1268device must allow access to the user.
Damien Miller5ff30c62013-10-30 22:21:50 +11001269.It Cm PermitTTY
1270Specifies whether
Damien Miller63857c92013-10-30 22:31:06 +11001271.Xr pty 4
Damien Miller5ff30c62013-10-30 22:21:50 +11001272allocation is permitted.
1273The default is
1274.Dq yes .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001275.It Cm PermitUserEnvironment
1276Specifies whether
1277.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001278and
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001279.Cm environment=
1280options in
1281.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001282are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +11001283.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001284The default is
1285.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001286Enabling environment processing may enable users to bypass access
1287restrictions in some configurations using mechanisms such as
1288.Ev LD_PRELOAD .
Damien Miller72e6b5c2014-07-04 09:00:04 +10001289.It Cm PermitUserRC
1290Specifies whether any
1291.Pa ~/.ssh/rc
1292file is executed.
1293The default is
1294.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001295.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +00001296Specifies the file that contains the process ID of the
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001297SSH daemon, or
1298.Dq none
1299to not write one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001300The default is
1301.Pa /var/run/sshd.pid .
1302.It Cm Port
1303Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +11001304.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001305listens on.
1306The default is 22.
1307Multiple options of this type are permitted.
1308See also
1309.Cm ListenAddress .
1310.It Cm PrintLastLog
1311Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001312.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +11001313should print the date and time of the last user login when a user logs
1314in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001315The default is
1316.Dq yes .
1317.It Cm PrintMotd
1318Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001319.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001320should print
1321.Pa /etc/motd
1322when a user logs in interactively.
1323(On some systems it is also printed by the shell,
1324.Pa /etc/profile ,
1325or equivalent.)
1326The default is
1327.Dq yes .
1328.It Cm Protocol
1329Specifies the protocol versions
Damien Miller5b0d63f2006-03-15 11:56:56 +11001330.Xr sshd 8
Ben Lindstrom9c445542002-07-11 03:59:18 +00001331supports.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001332The possible values are
Damien Miller5b0d63f2006-03-15 11:56:56 +11001333.Sq 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001334and
Damien Miller5b0d63f2006-03-15 11:56:56 +11001335.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001336Multiple versions must be comma-separated.
1337The default is
Darren Tucker7a4a7652009-10-11 21:51:40 +11001338.Sq 2 .
djm@openbsd.orge7901ef2016-02-16 05:11:04 +00001339Protocol 1 suffers from a number of cryptographic weaknesses and should
1340not be used.
1341It is only offered to support legacy devices.
1342.Pp
Ben Lindstrom9c445542002-07-11 03:59:18 +00001343Note that the order of the protocol list does not indicate preference,
1344because the client selects among multiple protocol versions offered
1345by the server.
1346Specifying
1347.Dq 2,1
1348is identical to
1349.Dq 1,2 .
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001350.It Cm PubkeyAcceptedKeyTypes
1351Specifies the key types that will be accepted for public key authentication
1352as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001353Alternately if the specified value begins with a
1354.Sq +
1355character, then the specified key types will be appended to the default set
1356instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001357The default for this option is:
1358.Bd -literal -offset 3n
1359ecdsa-sha2-nistp256-cert-v01@openssh.com,
1360ecdsa-sha2-nistp384-cert-v01@openssh.com,
1361ecdsa-sha2-nistp521-cert-v01@openssh.com,
1362ssh-ed25519-cert-v01@openssh.com,
1363ssh-rsa-cert-v01@openssh.com,
1364ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +00001365ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001366.Ed
1367.Pp
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001368The
1369.Fl Q
1370option of
1371.Xr ssh 1
1372may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001373.It Cm PubkeyAuthentication
1374Specifies whether public key authentication is allowed.
1375The default is
1376.Dq yes .
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001377.It Cm RekeyLimit
1378Specifies the maximum amount of data that may be transmitted before the
1379session key is renegotiated, optionally followed a maximum amount of
1380time that may pass before the session key is renegotiated.
1381The first argument is specified in bytes and may have a suffix of
1382.Sq K ,
1383.Sq M ,
1384or
1385.Sq G
1386to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1387The default is between
1388.Sq 1G
1389and
1390.Sq 4G ,
1391depending on the cipher.
1392The optional second value is specified in seconds and may use any of the
1393units documented in the
1394.Sx TIME FORMATS
Darren Tucker64d22942013-05-16 20:31:29 +10001395section.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001396The default value for
1397.Cm RekeyLimit
1398is
1399.Dq default none ,
1400which means that rekeying is performed after the cipher's default amount
1401of data has been sent or received and no time based rekeying is done.
Damien Miller1aed65e2010-03-04 21:53:35 +11001402.It Cm RevokedKeys
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001403Specifies revoked public keys file, or
1404.Dq none
1405to not use one.
Damien Miller1aed65e2010-03-04 21:53:35 +11001406Keys listed in this file will be refused for public key authentication.
1407Note that if this file is not readable, then public key authentication will
1408be refused for all users.
Damien Millerf3747bf2013-01-18 11:44:04 +11001409Keys may be specified as a text file, listing one public key per line, or as
1410an OpenSSH Key Revocation List (KRL) as generated by
Damien Miller72abeb72013-01-20 22:33:44 +11001411.Xr ssh-keygen 1 .
Damien Millerfecfd112013-07-18 16:11:50 +10001412For more information on KRLs, see the KEY REVOCATION LISTS section in
Damien Millerf3747bf2013-01-18 11:44:04 +11001413.Xr ssh-keygen 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001414.It Cm RhostsRSAAuthentication
1415Specifies whether rhosts or /etc/hosts.equiv authentication together
1416with successful RSA host authentication is allowed.
1417The default is
1418.Dq no .
1419This option applies to protocol version 1 only.
1420.It Cm RSAAuthentication
1421Specifies whether pure RSA authentication is allowed.
1422The default is
1423.Dq yes .
1424This option applies to protocol version 1 only.
1425.It Cm ServerKeyBits
1426Defines the number of bits in the ephemeral protocol version 1 server key.
djm@openbsd.org933935c2015-07-03 03:49:45 +00001427The default and minimum value is 1024.
Damien Miller7acefbb2014-07-18 14:11:24 +10001428.It Cm StreamLocalBindMask
1429Sets the octal file creation mode mask
1430.Pq umask
1431used when creating a Unix-domain socket file for local or remote
1432port forwarding.
1433This option is only used for port forwarding to a Unix-domain socket file.
1434.Pp
1435The default value is 0177, which creates a Unix-domain socket file that is
1436readable and writable only by the owner.
1437Note that not all operating systems honor the file mode on Unix-domain
1438socket files.
1439.It Cm StreamLocalBindUnlink
1440Specifies whether to remove an existing Unix-domain socket file for local
1441or remote port forwarding before creating a new one.
1442If the socket file already exists and
1443.Cm StreamLocalBindUnlink
1444is not enabled,
1445.Nm sshd
1446will be unable to forward the port to the Unix-domain socket file.
1447This option is only used for port forwarding to a Unix-domain socket file.
1448.Pp
1449The argument must be
1450.Dq yes
1451or
1452.Dq no .
1453The default is
1454.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001455.It Cm StrictModes
1456Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001457.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001458should check file modes and ownership of the
1459user's files and home directory before accepting login.
1460This is normally desirable because novices sometimes accidentally leave their
1461directory or files world-writable.
1462The default is
1463.Dq yes .
Darren Tuckerf788a912010-01-08 17:06:47 +11001464Note that this does not apply to
1465.Cm ChrootDirectory ,
1466whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001467.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +11001468Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +10001469Arguments should be a subsystem name and a command (with optional arguments)
1470to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001471.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001472The command
1473.Xr sftp-server 8
1474implements the
1475.Dq sftp
1476file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001477.Pp
1478Alternately the name
1479.Dq internal-sftp
1480implements an in-process
1481.Dq sftp
1482server.
1483This may simplify configurations using
1484.Cm ChrootDirectory
1485to force a different filesystem root on clients.
1486.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001487By default no subsystems are defined.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001488.It Cm SyslogFacility
1489Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001490.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001491The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1492LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1493The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001494.It Cm TCPKeepAlive
1495Specifies whether the system should send TCP keepalive messages to the
1496other side.
1497If they are sent, death of the connection or crash of one
1498of the machines will be properly noticed.
1499However, this means that
1500connections will die if the route is down temporarily, and some people
1501find it annoying.
1502On the other hand, if TCP keepalives are not sent,
1503sessions may hang indefinitely on the server, leaving
1504.Dq ghost
1505users and consuming server resources.
1506.Pp
1507The default is
1508.Dq yes
1509(to send TCP keepalive messages), and the server will notice
1510if the network goes down or the client host crashes.
1511This avoids infinitely hanging sessions.
1512.Pp
1513To disable TCP keepalive messages, the value should be set to
1514.Dq no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001515.It Cm TrustedUserCAKeys
1516Specifies a file containing public keys of certificate authorities that are
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001517trusted to sign user certificates for authentication, or
1518.Dq none
1519to not use one.
Damien Miller72b33822010-03-05 07:39:01 +11001520Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001521.Ql #
1522are allowed.
1523If a certificate is presented for authentication and has its signing CA key
1524listed in this file, then it may be used for authentication for any user
1525listed in the certificate's principals list.
1526Note that certificates that lack a list of principals will not be permitted
1527for authentication using
1528.Cm TrustedUserCAKeys .
Damien Millerfecfd112013-07-18 16:11:50 +10001529For more details on certificates, see the CERTIFICATES section in
Damien Miller1aed65e2010-03-04 21:53:35 +11001530.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001531.It Cm UseDNS
1532Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001533.Xr sshd 8
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001534should look up the remote host name, and to check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001535the resolved host name for the remote IP address maps back to the
1536very same IP address.
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001537.Pp
1538If this option is set to
1539.Dq no
1540(the default) then only addresses and not host names may be used in
djm@openbsd.org0235a5f2016-03-17 17:19:43 +00001541.Pa ~/.ssh/authorized_keys
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001542.Cm from
1543and
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +00001544.Nm
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001545.Cm Match
1546.Cm Host
1547directives.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001548.It Cm UseLogin
1549Specifies whether
1550.Xr login 1
1551is used for interactive login sessions.
1552The default is
1553.Dq no .
1554Note that
1555.Xr login 1
1556is never used for remote command execution.
1557Note also, that if this is enabled,
1558.Cm X11Forwarding
1559will be disabled because
1560.Xr login 1
1561does not know how to handle
1562.Xr xauth 1
Damien Miller495dca32003-04-01 21:42:14 +10001563cookies.
1564If
Ben Lindstrom9f049032002-06-21 00:59:05 +00001565.Cm UsePrivilegeSeparation
1566is specified, it will be disabled after authentication.
Damien Miller2e193e22003-05-14 15:13:03 +10001567.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001568Enables the Pluggable Authentication Module interface.
1569If set to
1570.Dq yes
1571this will enable PAM authentication using
1572.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001573and
1574.Cm PasswordAuthentication
1575in addition to PAM account and session module processing for all
1576authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001577.Pp
1578Because PAM challenge-response authentication usually serves an equivalent
1579role to password authentication, you should disable either
1580.Cm PasswordAuthentication
1581or
1582.Cm ChallengeResponseAuthentication.
1583.Pp
1584If
1585.Cm UsePAM
1586is enabled, you will not be able to run
1587.Xr sshd 8
1588as a non-root user.
1589The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +10001590.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001591.It Cm UsePrivilegeSeparation
1592Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001593.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001594separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +10001595to deal with incoming network traffic.
1596After successful authentication, another process will be created that has
1597the privilege of the authenticated user.
1598The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +00001599escalation by containing any corruption within the unprivileged processes.
sobrado@openbsd.orgbdcb73f2015-10-07 14:45:30 +00001600The argument must be
1601.Dq yes ,
1602.Dq no ,
1603or
1604.Dq sandbox .
Damien Miller69ff1df2011-06-23 08:30:03 +10001605If
1606.Cm UsePrivilegeSeparation
1607is set to
1608.Dq sandbox
1609then the pre-authentication unprivileged process is subject to additional
1610restrictions.
sobrado@openbsd.orgbdcb73f2015-10-07 14:45:30 +00001611The default is
1612.Dq sandbox .
Damien Miller23528812012-04-22 11:24:43 +10001613.It Cm VersionAddendum
1614Optionally specifies additional text to append to the SSH protocol banner
1615sent by the server upon connection.
1616The default is
1617.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001618.It Cm X11DisplayOffset
1619Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001620.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001621X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001622This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001623The default is 10.
1624.It Cm X11Forwarding
1625Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001626The argument must be
1627.Dq yes
1628or
1629.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001630The default is
1631.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +10001632.Pp
1633When X11 forwarding is enabled, there may be additional exposure to
1634the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001635.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001636proxy display is configured to listen on the wildcard address (see
1637.Cm X11UseLocalhost
Damien Miller5b0d63f2006-03-15 11:56:56 +11001638below), though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001639Additionally, the authentication spoofing and authentication data
1640verification and substitution occur on the client side.
1641The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001642display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001643forwarding (see the warnings for
1644.Cm ForwardX11
1645in
Damien Millerf1ce5052003-06-11 22:04:39 +10001646.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001647A system administrator may have a stance in which they want to
1648protect clients that may expose themselves to attack by unwittingly
1649requesting X11 forwarding, which can warrant a
1650.Dq no
1651setting.
1652.Pp
1653Note that disabling X11 forwarding does not prevent users from
1654forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001655X11 forwarding is automatically disabled if
1656.Cm UseLogin
1657is enabled.
1658.It Cm X11UseLocalhost
1659Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001660.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001661should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001662the wildcard address.
1663By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001664sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001665hostname part of the
1666.Ev DISPLAY
1667environment variable to
1668.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001669This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001670However, some older X11 clients may not function with this
1671configuration.
1672.Cm X11UseLocalhost
1673may be set to
1674.Dq no
1675to specify that the forwarding server should be bound to the wildcard
1676address.
1677The argument must be
1678.Dq yes
1679or
1680.Dq no .
1681The default is
1682.Dq yes .
1683.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001684Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001685.Xr xauth 1
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001686program, or
1687.Dq none
1688to not use one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001689The default is
1690.Pa /usr/X11R6/bin/xauth .
1691.El
Damien Millere3beba22006-03-15 11:59:25 +11001692.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001693.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001694command-line arguments and configuration file options that specify time
1695may be expressed using a sequence of the form:
1696.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001697.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001698.Sm on
1699where
1700.Ar time
1701is a positive integer value and
1702.Ar qualifier
1703is one of the following:
1704.Pp
1705.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001706.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001707seconds
1708.It Cm s | Cm S
1709seconds
1710.It Cm m | Cm M
1711minutes
1712.It Cm h | Cm H
1713hours
1714.It Cm d | Cm D
1715days
1716.It Cm w | Cm W
1717weeks
1718.El
1719.Pp
1720Each member of the sequence is added together to calculate
1721the total time value.
1722.Pp
1723Time format examples:
1724.Pp
1725.Bl -tag -width Ds -compact -offset indent
1726.It 600
1727600 seconds (10 minutes)
1728.It 10m
172910 minutes
1730.It 1h30m
17311 hour 30 minutes (90 minutes)
1732.El
1733.Sh FILES
1734.Bl -tag -width Ds
1735.It Pa /etc/ssh/sshd_config
1736Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001737.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001738This file should be writable by root only, but it is recommended
1739(though not necessary) that it be world-readable.
1740.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001741.Sh SEE ALSO
1742.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001743.Sh AUTHORS
1744OpenSSH is a derivative of the original and free
1745ssh 1.2.12 release by Tatu Ylonen.
1746Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1747Theo de Raadt and Dug Song
1748removed many bugs, re-added newer features and
1749created OpenSSH.
1750Markus Friedl contributed the support for SSH
1751protocol versions 1.5 and 2.0.
1752Niels Provos and Markus Friedl contributed support
1753for privilege separation.