blob: b49e919105ac6c227fdaf9e473bf2fa80deb8788 [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.\"
markus@openbsd.org3a1638d2015-07-10 06:21:53 +000036.\" $OpenBSD: sshd_config.5,v 1.206 2015/07/10 06:21:53 markus Exp $
37.Dd $Mdocdate: July 10 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.
288The default is
289.Dq .ssh/authorized_keys .ssh/authorized_keys2 .
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000290.It Cm AuthorizedPrincipalsCommand
291Specifies a program to be used to generate the list of allowed
292certificate principals as per
293.Cm AuthorizedPrincipalsFile .
294The program must be owned by root, not writable by group or others and
295specified by an absolute path.
296.Pp
297Arguments to
298.Cm AuthorizedPrincipalsCommand
299may be provided using the following tokens, which will be expanded
300at runtime: %% is replaced by a literal '%', %u is replaced by the
301username being authenticated and %h is replaced by the home directory
302of the user being authenticated.
303.Pp
304The program should produce on standard output zero or
305more lines of
306.Cm AuthorizedPrincipalsFile
307output.
308If either
309.Cm AuthorizedPrincipalsCommand
310or
311.Cm AuthorizedPrincipalsFile
312is specified, then certificates offered by the client for authentication
313must contain a principal that is listed.
314By default, no AuthorizedPrincipalsCommand is run.
315.It Cm AuthorizedPrincipalsCommandUser
316Specifies the user under whose account the AuthorizedPrincipalsCommand is run.
317It is recommended to use a dedicated user that has no other role on the host
318than running authorized principals commands.
319If
320.Cm AuthorizedPrincipalsCommand
321is specified but
322.Cm AuthorizedPrincipalsCommandUser
323is not, then
324.Xr sshd 8
325will refuse to start.
Damien Miller30da3442010-05-10 11:58:03 +1000326.It Cm AuthorizedPrincipalsFile
327Specifies a file that lists principal names that are accepted for
328certificate authentication.
329When using certificates signed by a key listed in
330.Cm TrustedUserCAKeys ,
331this file lists names, one of which must appear in the certificate for it
332to be accepted for authentication.
Damien Millerd59dab82010-07-02 13:37:17 +1000333Names are listed one per line preceded by key options (as described
Damien Millerfecfd112013-07-18 16:11:50 +1000334in AUTHORIZED_KEYS FILE FORMAT in
Damien Millerd59dab82010-07-02 13:37:17 +1000335.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000336Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000337.Ql #
338are ignored.
339.Pp
340.Cm AuthorizedPrincipalsFile
341may contain tokens of the form %T which are substituted during connection
342setup.
343The following tokens are defined: %% is replaced by a literal '%',
344%h is replaced by the home directory of the user being authenticated, and
345%u is replaced by the username of that user.
346After expansion,
347.Cm AuthorizedPrincipalsFile
348is taken to be an absolute path or one relative to the user's home
349directory.
350.Pp
Damien Miller8fef9eb2012-04-22 11:25:10 +1000351The default is
352.Dq none ,
353i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000354of the user must appear in a certificate's principals list for it to be
355accepted.
356Note that
357.Cm AuthorizedPrincipalsFile
358is only used when authentication proceeds using a CA listed in
359.Cm TrustedUserCAKeys
360and is not consulted for certification authorities trusted via
361.Pa ~/.ssh/authorized_keys ,
362though the
363.Cm principals=
364key option offers a similar facility (see
365.Xr sshd 8
366for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000367.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000368The contents of the specified file are sent to the remote user before
369authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000370If the argument is
371.Dq none
372then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000373This option is only available for protocol version 2.
374By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000375.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000376Specifies whether challenge-response authentication is allowed (e.g. via
Damien Millere8c9f262014-10-03 09:24:56 +1000377PAM or through authentication styles supported in
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000378.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000379The default is
380.Dq yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100381.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100382Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100383.Xr chroot 2
384to after authentication.
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000385At session startup
386.Xr sshd 8
387checks that all components of the pathname are root-owned directories
388which are not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000389After the chroot,
390.Xr sshd 8
391changes the working directory to the user's home directory.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100392.Pp
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100393The pathname may contain the following tokens that are expanded at runtime once
Damien Millerd8cb1f12008-02-10 22:40:12 +1100394the connecting user has been authenticated: %% is replaced by a literal '%',
395%h is replaced by the home directory of the user being authenticated, and
396%u is replaced by the username of that user.
397.Pp
398The
399.Cm ChrootDirectory
400must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000401user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100402For an interactive session this requires at least a shell, typically
403.Xr sh 1 ,
404and basic
405.Pa /dev
406nodes such as
407.Xr null 4 ,
408.Xr zero 4 ,
409.Xr stdin 4 ,
410.Xr stdout 4 ,
411.Xr stderr 4 ,
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000412and
Damien Millerd8cb1f12008-02-10 22:40:12 +1100413.Xr tty 4
414devices.
415For file transfer sessions using
Darren Tuckerf92077f2009-06-21 17:56:25 +1000416.Dq sftp ,
Damien Millerd8cb1f12008-02-10 22:40:12 +1100417no additional configuration of the environment is necessary if the
Darren Tuckerf92077f2009-06-21 17:56:25 +1000418in-process sftp server is used,
Damien Miller426117b2014-07-30 12:33:20 +1000419though sessions which use logging may require
Darren Tucker00fcd712009-06-21 17:56:00 +1000420.Pa /dev/log
Damien Miller426117b2014-07-30 12:33:20 +1000421inside the chroot directory on some operating systems (see
Darren Tucker00fcd712009-06-21 17:56:00 +1000422.Xr sftp-server 8
423for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100424.Pp
jmc@openbsd.orga5a3e332015-01-22 21:00:42 +0000425For safety, it is very important that the directory hierarchy be
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000426prevented from modification by other processes on the system (especially
427those outside the jail).
428Misconfiguration can lead to unsafe environments which
429.Xr sshd 8
430cannot detect.
431.Pp
Damien Millerd8cb1f12008-02-10 22:40:12 +1100432The default is not to
433.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000434.It Cm Ciphers
435Specifies the ciphers allowed for protocol version 2.
436Multiple ciphers must be comma-separated.
Damien Miller0fde8ac2013-11-21 14:12:23 +1100437The supported ciphers are:
438.Pp
Damien Millerc1621c82014-04-20 13:22:46 +1000439.Bl -item -compact -offset indent
440.It
4413des-cbc
442.It
443aes128-cbc
444.It
445aes192-cbc
446.It
447aes256-cbc
448.It
449aes128-ctr
450.It
451aes192-ctr
452.It
453aes256-ctr
454.It
455aes128-gcm@openssh.com
456.It
457aes256-gcm@openssh.com
458.It
459arcfour
460.It
461arcfour128
462.It
463arcfour256
464.It
465blowfish-cbc
466.It
467cast128-cbc
468.It
469chacha20-poly1305@openssh.com
470.El
Damien Miller0fde8ac2013-11-21 14:12:23 +1100471.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100472The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000473.Bd -literal -offset indent
474aes128-ctr,aes192-ctr,aes256-ctr,
Damien Miller1d75abf2013-01-09 16:12:19 +1100475aes128-gcm@openssh.com,aes256-gcm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000476chacha20-poly1305@openssh.com
Ben Lindstrom9f049032002-06-21 00:59:05 +0000477.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100478.Pp
479The list of available ciphers may also be obtained using the
480.Fl Q
481option of
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000482.Xr ssh 1
483with an argument of
484.Dq cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000485.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100486Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000487sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100488.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000489receiving any messages back from the client.
490If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100491sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000492It is important to note that the use of client alive messages is very
493different from
Damien Miller12c150e2003-12-17 16:31:10 +1100494.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000495(below).
496The client alive messages are sent through the encrypted channel
497and therefore will not be spoofable.
498The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100499.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000500is spoofable.
501The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000502server depend on knowing when a connection has become inactive.
503.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000504The default value is 3.
505If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000506.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100507(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000508.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100509is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000510will be disconnected after approximately 45 seconds.
Damien Millercc3e8ba2006-03-15 12:06:55 +1100511This option applies to protocol version 2 only.
Damien Miller1594ad52005-05-26 12:12:19 +1000512.It Cm ClientAliveInterval
513Sets a timeout interval in seconds after which if no data has been received
514from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100515.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000516will send a message through the encrypted
517channel to request a response from the client.
518The default
519is 0, indicating that these messages will not be sent to the client.
520This option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000521.It Cm Compression
Damien Miller9786e6e2005-07-26 21:54:56 +1000522Specifies whether compression is allowed, or delayed until
523the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000524The argument must be
Damien Miller9786e6e2005-07-26 21:54:56 +1000525.Dq yes ,
526.Dq delayed ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000527or
528.Dq no .
529The default is
Damien Miller9786e6e2005-07-26 21:54:56 +1000530.Dq delayed .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000531.It Cm DenyGroups
532This keyword can be followed by a list of group name patterns, separated
533by spaces.
534Login is disallowed for users whose primary group or supplementary
535group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000536Only group names are valid; a numerical group ID is not recognized.
537By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100538The allow/deny directives are processed in the following order:
539.Cm DenyUsers ,
540.Cm AllowUsers ,
541.Cm DenyGroups ,
542and finally
543.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100544.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000545See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100546.Xr ssh_config 5
547for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000548.It Cm DenyUsers
549This keyword can be followed by a list of user name patterns, separated
550by spaces.
551Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000552Only user names are valid; a numerical user ID is not recognized.
553By default, login is allowed for all users.
554If the pattern takes the form USER@HOST then USER and HOST
555are separately checked, restricting logins to particular
556users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100557The allow/deny directives are processed in the following order:
558.Cm DenyUsers ,
559.Cm AllowUsers ,
560.Cm DenyGroups ,
561and finally
562.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100563.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000564See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100565.Xr ssh_config 5
566for more information on patterns.
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000567.It Cm FingerprintHash
568Specifies the hash algorithm used when logging key fingerprints.
569Valid options are:
570.Dq md5
571and
572.Dq sha256 .
573The default is
574.Dq sha256 .
Damien Millere2754432006-07-24 14:06:47 +1000575.It Cm ForceCommand
576Forces the execution of the command specified by
577.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100578ignoring any command supplied by the client and
579.Pa ~/.ssh/rc
580if present.
Damien Millere2754432006-07-24 14:06:47 +1000581The command is invoked by using the user's login shell with the -c option.
582This applies to shell, command, or subsystem execution.
583It is most useful inside a
584.Cm Match
585block.
586The command originally supplied by the client is available in the
587.Ev SSH_ORIGINAL_COMMAND
588environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100589Specifying a command of
590.Dq internal-sftp
591will force the use of an in-process sftp server that requires no support
592files when used with
593.Cm ChrootDirectory .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000594.It Cm GatewayPorts
595Specifies whether remote hosts are allowed to connect to ports
596forwarded for the client.
597By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100598.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000599binds remote port forwardings to the loopback address.
600This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000601.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100602can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100603should allow remote port forwardings to bind to non-loopback addresses, thus
604allowing other hosts to connect.
605The argument may be
606.Dq no
607to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000608.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100609to force remote port forwardings to bind to the wildcard address, or
610.Dq clientspecified
611to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000612The default is
613.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000614.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000615Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100616The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000617.Dq no .
618Note that this option applies to protocol version 2 only.
619.It Cm GSSAPICleanupCredentials
620Specifies whether to automatically destroy the user's credentials cache
621on logout.
622The default is
623.Dq yes .
624Note that this option applies to protocol version 2 only.
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000625.It Cm GSSAPIStrictAcceptorCheck
626Determines whether to be strict about the identity of the GSSAPI acceptor
627a client authenticates against.
628If set to
629.Dq yes
630then the client must authenticate against the
631.Pa host
632service on the current hostname.
633If set to
634.Dq no
635then the client may authenticate against any service key stored in the
636machine's default store.
637This facility is provided to assist with operation on multi homed machines.
638The default is
639.Dq yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000640.It Cm HostbasedAcceptedKeyTypes
641Specifies the key types that will be accepted for hostbased authentication
642as a comma-separated pattern list.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000643The default for this option is:
644.Bd -literal -offset 3n
645ecdsa-sha2-nistp256-cert-v01@openssh.com,
646ecdsa-sha2-nistp384-cert-v01@openssh.com,
647ecdsa-sha2-nistp521-cert-v01@openssh.com,
648ssh-ed25519-cert-v01@openssh.com,
649ssh-rsa-cert-v01@openssh.com,
650ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
651ssh-ed25519,ssh-rsa
652.Ed
653.Pp
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000654The
655.Fl Q
656option of
657.Xr ssh 1
658may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000659.It Cm HostbasedAuthentication
660Specifies whether rhosts or /etc/hosts.equiv authentication together
661with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100662(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000663This option is similar to
664.Cm RhostsRSAAuthentication
665and applies to protocol version 2 only.
666The default is
667.Dq no .
Damien Millerb594f382006-08-30 11:06:34 +1000668.It Cm HostbasedUsesNameFromPacketOnly
669Specifies whether or not the server will attempt to perform a reverse
670name lookup when matching the name in the
671.Pa ~/.shosts ,
672.Pa ~/.rhosts ,
673and
674.Pa /etc/hosts.equiv
675files during
676.Cm HostbasedAuthentication .
677A setting of
678.Dq yes
679means that
680.Xr sshd 8
681uses the name supplied by the client rather than
682attempting to resolve the name from the TCP connection itself.
683The default is
684.Dq no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100685.It Cm HostCertificate
686Specifies a file containing a public host certificate.
687The certificate's public key must match a private host key already specified
688by
689.Cm HostKey .
690The default behaviour of
691.Xr sshd 8
692is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000693.It Cm HostKey
694Specifies a file containing a private host key
695used by SSH.
696The default is
697.Pa /etc/ssh/ssh_host_key
698for protocol version 1, and
Damien Millereb8b60e2010-08-31 22:41:14 +1000699.Pa /etc/ssh/ssh_host_dsa_key ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100700.Pa /etc/ssh/ssh_host_ecdsa_key ,
701.Pa /etc/ssh/ssh_host_ed25519_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000702and
Damien Millereb8b60e2010-08-31 22:41:14 +1000703.Pa /etc/ssh/ssh_host_rsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000704for protocol version 2.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000705.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000706Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100707.Xr sshd 8
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000708will refuse to use a file if it is group/world-accessible
709and that the
710.Cm HostKeyAlgorithms
711option restricts which of the keys are actually used by
712.Xr sshd 8 .
713.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000714It is possible to have multiple host key files.
715.Dq rsa1
716keys are used for version 1 and
Damien Millereb8b60e2010-08-31 22:41:14 +1000717.Dq dsa ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100718.Dq ecdsa ,
719.Dq ed25519
Ben Lindstrom9f049032002-06-21 00:59:05 +0000720or
721.Dq rsa
722are used for version 2 of the SSH protocol.
Damien Miller85b45e02013-07-20 13:21:52 +1000723It is also possible to specify public host key files instead.
724In this case operations on the private key will be delegated
725to an
726.Xr ssh-agent 1 .
727.It Cm HostKeyAgent
728Identifies the UNIX-domain socket used to communicate
729with an agent that has access to the private host keys.
730If
731.Dq SSH_AUTH_SOCK
732is specified, the location of the socket will be read from the
733.Ev SSH_AUTH_SOCK
734environment variable.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000735.It Cm HostKeyAlgorithms
736Specifies the protocol version 2 host key algorithms
737that the server offers.
738The default for this option is:
739.Bd -literal -offset 3n
740ecdsa-sha2-nistp256-cert-v01@openssh.com,
741ecdsa-sha2-nistp384-cert-v01@openssh.com,
742ecdsa-sha2-nistp521-cert-v01@openssh.com,
743ssh-ed25519-cert-v01@openssh.com,
744ssh-rsa-cert-v01@openssh.com,
745ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
746ssh-ed25519,ssh-rsa
747.Ed
748.Pp
749The list of available key types may also be obtained using the
750.Fl Q
751option of
752.Xr ssh 1
753with an argument of
754.Dq key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000755.It Cm IgnoreRhosts
756Specifies that
757.Pa .rhosts
758and
759.Pa .shosts
760files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000761.Cm RhostsRSAAuthentication
762or
763.Cm HostbasedAuthentication .
764.Pp
765.Pa /etc/hosts.equiv
766and
767.Pa /etc/shosts.equiv
768are still used.
769The default is
770.Dq yes .
771.It Cm IgnoreUserKnownHosts
772Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100773.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000774should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000775.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000776during
777.Cm RhostsRSAAuthentication
778or
779.Cm HostbasedAuthentication .
780The default is
781.Dq no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100782.It Cm IPQoS
783Specifies the IPv4 type-of-service or DSCP class for the connection.
784Accepted values are
785.Dq af11 ,
786.Dq af12 ,
787.Dq af13 ,
Damien Millerf6e758c2011-09-22 21:37:13 +1000788.Dq af21 ,
Damien Miller0dac6fb2010-11-20 15:19:38 +1100789.Dq af22 ,
790.Dq af23 ,
791.Dq af31 ,
792.Dq af32 ,
793.Dq af33 ,
794.Dq af41 ,
795.Dq af42 ,
796.Dq af43 ,
797.Dq cs0 ,
798.Dq cs1 ,
799.Dq cs2 ,
800.Dq cs3 ,
801.Dq cs4 ,
802.Dq cs5 ,
803.Dq cs6 ,
804.Dq cs7 ,
805.Dq ef ,
806.Dq lowdelay ,
807.Dq throughput ,
808.Dq reliability ,
809or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +1100810This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100811If one argument is specified, it is used as the packet class unconditionally.
812If two values are specified, the first is automatically selected for
813interactive sessions and the second for non-interactive sessions.
814The default is
815.Dq lowdelay
816for interactive sessions and
817.Dq throughput
818for non-interactive sessions.
Damien Millere1e480a2014-02-04 11:13:17 +1100819.It Cm KbdInteractiveAuthentication
820Specifies whether to allow keyboard-interactive authentication.
821The argument to this keyword must be
822.Dq yes
823or
824.Dq no .
825The default is to use whatever value
826.Cm ChallengeResponseAuthentication
827is set to
828(by default
829.Dq yes ) .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000830.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000831Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000832.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000833will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000834To use this option, the server needs a
835Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100836The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000837.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100838.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000839If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100840an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100841The default is
Damien Miller8448e662004-03-08 23:13:15 +1100842.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000843.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100844If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000845the password will be validated via any additional local mechanism
846such as
847.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100848The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000849.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000850.It Cm KerberosTicketCleanup
851Specifies whether to automatically destroy the user's ticket cache
852file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100853The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000854.Dq yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000855.It Cm KexAlgorithms
856Specifies the available KEX (Key Exchange) algorithms.
857Multiple algorithms must be comma-separated.
Damien Millerc1621c82014-04-20 13:22:46 +1000858The supported algorithms are:
859.Pp
860.Bl -item -compact -offset indent
861.It
862curve25519-sha256@libssh.org
863.It
864diffie-hellman-group1-sha1
865.It
866diffie-hellman-group14-sha1
867.It
868diffie-hellman-group-exchange-sha1
869.It
870diffie-hellman-group-exchange-sha256
871.It
872ecdh-sha2-nistp256
873.It
874ecdh-sha2-nistp384
875.It
876ecdh-sha2-nistp521
877.El
878.Pp
879The default is:
Damien Miller6575c3a2013-12-18 17:47:02 +1100880.Bd -literal -offset indent
881curve25519-sha256@libssh.org,
882ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
883diffie-hellman-group-exchange-sha256,
Damien Millerc1621c82014-04-20 13:22:46 +1000884diffie-hellman-group14-sha1
Damien Miller6575c3a2013-12-18 17:47:02 +1100885.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000886.Pp
887The list of available key exchange algorithms may also be obtained using the
888.Fl Q
889option of
890.Xr ssh 1
891with an argument of
892.Dq kex .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000893.It Cm KeyRegenerationInterval
894In protocol version 1, the ephemeral server key is automatically regenerated
895after this many seconds (if it has been used).
896The purpose of regeneration is to prevent
897decrypting captured sessions by later breaking into the machine and
898stealing the keys.
899The key is never stored anywhere.
900If the value is 0, the key is never regenerated.
901The default is 3600 (seconds).
902.It Cm ListenAddress
903Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100904.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000905should listen on.
906The following forms may be used:
907.Pp
908.Bl -item -offset indent -compact
909.It
910.Cm ListenAddress
911.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000912.Ar host | Ar IPv4_addr | Ar IPv6_addr
Ben Lindstrom9f049032002-06-21 00:59:05 +0000913.Sm on
914.It
915.Cm ListenAddress
916.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000917.Ar host | Ar IPv4_addr : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000918.Sm on
919.It
920.Cm ListenAddress
921.Sm off
922.Oo
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000923.Ar host | Ar IPv6_addr Oc : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000924.Sm on
925.El
926.Pp
927If
928.Ar port
929is not specified,
dtucker@openbsd.org531a57a2015-04-29 03:48:56 +0000930sshd will listen on the address and all
Ben Lindstrom9f049032002-06-21 00:59:05 +0000931.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000932options specified.
933The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000934Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000935.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000936options are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000937.It Cm LoginGraceTime
938The server disconnects after this time if the user has not
939successfully logged in.
940If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000941The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000942.It Cm LogLevel
943Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100944.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000945The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100946QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000947The default is INFO.
948DEBUG and DEBUG1 are equivalent.
949DEBUG2 and DEBUG3 each specify higher levels of debugging output.
950Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000951.It Cm MACs
952Specifies the available MAC (message authentication code) algorithms.
953The MAC algorithm is used in protocol version 2
954for data integrity protection.
955Multiple algorithms must be comma-separated.
Damien Milleraf43a7a2012-12-12 10:46:31 +1100956The algorithms that contain
957.Dq -etm
958calculate the MAC after encryption (encrypt-then-mac).
959These are considered safer and their use recommended.
Damien Millerc1621c82014-04-20 13:22:46 +1000960The supported MACs are:
961.Pp
962.Bl -item -compact -offset indent
963.It
964hmac-md5
965.It
966hmac-md5-96
967.It
968hmac-ripemd160
969.It
970hmac-sha1
971.It
972hmac-sha1-96
973.It
974hmac-sha2-256
975.It
976hmac-sha2-512
977.It
978umac-64@openssh.com
979.It
980umac-128@openssh.com
981.It
982hmac-md5-etm@openssh.com
983.It
984hmac-md5-96-etm@openssh.com
985.It
986hmac-ripemd160-etm@openssh.com
987.It
988hmac-sha1-etm@openssh.com
989.It
990hmac-sha1-96-etm@openssh.com
991.It
992hmac-sha2-256-etm@openssh.com
993.It
994hmac-sha2-512-etm@openssh.com
995.It
996umac-64-etm@openssh.com
997.It
998umac-128-etm@openssh.com
999.El
1000.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +11001001The default is:
Damien Miller22b7b492007-06-11 14:07:12 +10001002.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +11001003umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1004hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +10001005umac-64@openssh.com,umac-128@openssh.com,
1006hmac-sha2-256,hmac-sha2-512
Damien Miller22b7b492007-06-11 14:07:12 +10001007.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001008.Pp
1009The list of available MAC algorithms may also be obtained using the
1010.Fl Q
1011option of
1012.Xr ssh 1
1013with an argument of
1014.Dq mac .
Darren Tucker45150472006-07-12 22:34:17 +10001015.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +10001016Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +10001017If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +10001018.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001019line are satisfied, the keywords on the following lines override those
1020set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +10001021.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001022line or the end of the file.
Damien Millerfc5d6752014-02-28 10:01:28 +11001023If a keyword appears in multiple
1024.Cm Match
sobrado@openbsd.org180bcb42014-08-30 16:32:25 +00001025blocks that are satisfied, only the first instance of the keyword is
Damien Millerfc5d6752014-02-28 10:01:28 +11001026applied.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001027.Pp
Damien Millerd04f3572006-07-24 13:46:50 +10001028The arguments to
Darren Tucker45150472006-07-12 22:34:17 +10001029.Cm Match
Damien Millercf31f382013-10-24 21:02:56 +11001030are one or more criteria-pattern pairs or the single token
1031.Cm All
1032which matches all criteria.
Darren Tucker45150472006-07-12 22:34:17 +10001033The available criteria are
1034.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +10001035.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +10001036.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +10001037.Cm LocalAddress ,
1038.Cm LocalPort ,
Darren Tucker45150472006-07-12 22:34:17 +10001039and
1040.Cm Address .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001041The match patterns may consist of single entries or comma-separated
1042lists and may use the wildcard and negation operators described in the
Damien Millerfecfd112013-07-18 16:11:50 +10001043PATTERNS section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +10001044.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001045.Pp
1046The patterns in an
1047.Cm Address
1048criteria may additionally contain addresses to match in CIDR
Darren Tucker6a2a4002008-06-10 23:03:04 +10001049address/masklen format, e.g.\&
Darren Tucker7a3935d2008-06-10 22:59:10 +10001050.Dq 192.0.2.0/24
1051or
1052.Dq 3ffe:ffff::/32 .
1053Note that the mask length provided must be consistent with the address -
1054it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +10001055or one with bits set in this host portion of the address.
1056For example,
Darren Tucker7a3935d2008-06-10 22:59:10 +10001057.Dq 192.0.2.0/33
1058and
Darren Tucker6a2a4002008-06-10 23:03:04 +10001059.Dq 192.0.2.0/8
Darren Tucker7a3935d2008-06-10 22:59:10 +10001060respectively.
1061.Pp
Darren Tucker45150472006-07-12 22:34:17 +10001062Only a subset of keywords may be used on the lines following a
1063.Cm Match
1064keyword.
1065Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +10001066.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +11001067.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +10001068.Cm AllowGroups ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001069.Cm AllowStreamLocalForwarding ,
Damien Miller9b439df2006-07-24 14:04:00 +10001070.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +10001071.Cm AllowUsers ,
Damien Millera6e3f012012-11-04 23:21:40 +11001072.Cm AuthenticationMethods ,
Damien Miller09d3e122012-10-31 08:58:58 +11001073.Cm AuthorizedKeysCommand ,
1074.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +11001075.Cm AuthorizedKeysFile ,
Damien Millerab6de352010-06-26 09:38:45 +10001076.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +11001077.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +10001078.Cm ChrootDirectory ,
Damien Millerc24da772012-06-20 21:53:58 +10001079.Cm DenyGroups ,
1080.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +10001081.Cm ForceCommand ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001082.Cm GatewayPorts ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +00001083.Cm GSSAPIAuthentication ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001084.Cm HostbasedAcceptedKeyTypes ,
Damien Miller25434de2008-05-19 14:29:08 +10001085.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +10001086.Cm HostbasedUsesNameFromPacketOnly ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001087.Cm IPQoS ,
Darren Tucker1d75f222007-03-01 21:31:28 +11001088.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +11001089.Cm KerberosAuthentication ,
Damien Miller307c1d12008-06-16 07:56:20 +10001090.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +10001091.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +11001092.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +11001093.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +10001094.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +11001095.Cm PermitRootLogin ,
Damien Miller5ff30c62013-10-30 22:21:50 +11001096.Cm PermitTTY ,
Damien Millerab6de352010-06-26 09:38:45 +10001097.Cm PermitTunnel ,
Damien Miller72e6b5c2014-07-04 09:00:04 +10001098.Cm PermitUserRC ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001099.Cm PubkeyAcceptedKeyTypes ,
Darren Tucker1477ea12009-10-07 08:36:05 +11001100.Cm PubkeyAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001101.Cm RekeyLimit ,
1102.Cm RevokedKeys ,
1103.Cm RhostsRSAAuthentication ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +00001104.Cm RSAAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001105.Cm StreamLocalBindMask ,
1106.Cm StreamLocalBindUnlink ,
1107.Cm TrustedUserCAKeys ,
Damien Millerd1de9952006-07-24 14:05:48 +10001108.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +11001109.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +10001110and
Damien Miller0296ae82009-02-23 11:00:24 +11001111.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +10001112.It Cm MaxAuthTries
1113Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +10001114connection.
1115Once the number of failures reaches half this value,
1116additional failures are logged.
1117The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +10001118.It Cm MaxSessions
1119Specifies the maximum number of open sessions permitted per network connection.
1120The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001121.It Cm MaxStartups
1122Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001123SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001124Additional connections will be dropped until authentication succeeds or the
1125.Cm LoginGraceTime
1126expires for a connection.
Damien Miller1f583df2013-02-12 11:02:08 +11001127The default is 10:30:100.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001128.Pp
1129Alternatively, random early drop can be enabled by specifying
1130the three colon separated values
1131.Dq start:rate:full
Damien Miller208f1ed2006-03-15 11:56:03 +11001132(e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +11001133.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001134will refuse connection attempts with a probability of
1135.Dq rate/100
1136(30%)
1137if there are currently
1138.Dq start
1139(10)
1140unauthenticated connections.
1141The probability increases linearly and all connection attempts
1142are refused if the number of unauthenticated connections reaches
1143.Dq full
1144(60).
1145.It Cm PasswordAuthentication
1146Specifies whether password authentication is allowed.
1147The default is
1148.Dq yes .
1149.It Cm PermitEmptyPasswords
1150When password authentication is allowed, it specifies whether the
1151server allows login to accounts with empty password strings.
1152The default is
1153.Dq no .
Damien Miller9b439df2006-07-24 14:04:00 +10001154.It Cm PermitOpen
1155Specifies the destinations to which TCP port forwarding is permitted.
1156The forwarding specification must be one of the following forms:
1157.Pp
1158.Bl -item -offset indent -compact
1159.It
1160.Cm PermitOpen
1161.Sm off
1162.Ar host : port
1163.Sm on
1164.It
1165.Cm PermitOpen
1166.Sm off
1167.Ar IPv4_addr : port
1168.Sm on
1169.It
1170.Cm PermitOpen
1171.Sm off
1172.Ar \&[ IPv6_addr \&] : port
1173.Sm on
1174.El
1175.Pp
Damien Millera765cf42006-07-24 14:08:13 +10001176Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +10001177An argument of
1178.Dq any
1179can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +10001180An argument of
1181.Dq none
1182can be used to prohibit all forwarding requests.
Damien Miller65bc2c42006-07-24 14:04:16 +10001183By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001184.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +11001185Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +00001186.Xr ssh 1 .
1187The argument must be
1188.Dq yes ,
1189.Dq without-password ,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001190.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001191or
1192.Dq no .
1193The default is
djm@openbsd.org88a7c592015-04-27 21:42:48 +00001194.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001195.Pp
1196If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001197.Dq without-password ,
Darren Tucker9dca0992005-02-01 19:16:45 +11001198password authentication is disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001199.Pp
1200If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001201.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001202root login with public key authentication will be allowed,
1203but only if the
1204.Ar command
1205option has been specified
1206(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +10001207normally not allowed).
1208All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001209.Pp
1210If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001211.Dq no ,
Darren Tuckerb3509012005-01-20 11:01:46 +11001212root is not allowed to log in.
Damien Millerd27b9472005-12-13 19:29:02 +11001213.It Cm PermitTunnel
1214Specifies whether
1215.Xr tun 4
1216device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +11001217The argument must be
1218.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +10001219.Dq point-to-point
1220(layer 3),
1221.Dq ethernet
1222(layer 2), or
Damien Miller7b58e802005-12-13 19:33:19 +11001223.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +10001224Specifying
1225.Dq yes
1226permits both
1227.Dq point-to-point
1228and
1229.Dq ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +11001230The default is
1231.Dq no .
djm@openbsd.org48dffd52014-09-09 09:45:36 +00001232.Pp
1233Independent of this setting, the permissions of the selected
1234.Xr tun 4
1235device must allow access to the user.
Damien Miller5ff30c62013-10-30 22:21:50 +11001236.It Cm PermitTTY
1237Specifies whether
Damien Miller63857c92013-10-30 22:31:06 +11001238.Xr pty 4
Damien Miller5ff30c62013-10-30 22:21:50 +11001239allocation is permitted.
1240The default is
1241.Dq yes .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001242.It Cm PermitUserEnvironment
1243Specifies whether
1244.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001245and
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001246.Cm environment=
1247options in
1248.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001249are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +11001250.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001251The default is
1252.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001253Enabling environment processing may enable users to bypass access
1254restrictions in some configurations using mechanisms such as
1255.Ev LD_PRELOAD .
Damien Miller72e6b5c2014-07-04 09:00:04 +10001256.It Cm PermitUserRC
1257Specifies whether any
1258.Pa ~/.ssh/rc
1259file is executed.
1260The default is
1261.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001262.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +00001263Specifies the file that contains the process ID of the
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001264SSH daemon, or
1265.Dq none
1266to not write one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001267The default is
1268.Pa /var/run/sshd.pid .
1269.It Cm Port
1270Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +11001271.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001272listens on.
1273The default is 22.
1274Multiple options of this type are permitted.
1275See also
1276.Cm ListenAddress .
1277.It Cm PrintLastLog
1278Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001279.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +11001280should print the date and time of the last user login when a user logs
1281in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001282The default is
1283.Dq yes .
1284.It Cm PrintMotd
1285Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001286.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001287should print
1288.Pa /etc/motd
1289when a user logs in interactively.
1290(On some systems it is also printed by the shell,
1291.Pa /etc/profile ,
1292or equivalent.)
1293The default is
1294.Dq yes .
1295.It Cm Protocol
1296Specifies the protocol versions
Damien Miller5b0d63f2006-03-15 11:56:56 +11001297.Xr sshd 8
Ben Lindstrom9c445542002-07-11 03:59:18 +00001298supports.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001299The possible values are
Damien Miller5b0d63f2006-03-15 11:56:56 +11001300.Sq 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001301and
Damien Miller5b0d63f2006-03-15 11:56:56 +11001302.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001303Multiple versions must be comma-separated.
1304The default is
Darren Tucker7a4a7652009-10-11 21:51:40 +11001305.Sq 2 .
Ben Lindstrom9c445542002-07-11 03:59:18 +00001306Note that the order of the protocol list does not indicate preference,
1307because the client selects among multiple protocol versions offered
1308by the server.
1309Specifying
1310.Dq 2,1
1311is identical to
1312.Dq 1,2 .
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001313.It Cm PubkeyAcceptedKeyTypes
1314Specifies the key types that will be accepted for public key authentication
1315as a comma-separated pattern list.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001316The default for this option is:
1317.Bd -literal -offset 3n
1318ecdsa-sha2-nistp256-cert-v01@openssh.com,
1319ecdsa-sha2-nistp384-cert-v01@openssh.com,
1320ecdsa-sha2-nistp521-cert-v01@openssh.com,
1321ssh-ed25519-cert-v01@openssh.com,
1322ssh-rsa-cert-v01@openssh.com,
1323ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
1324ssh-ed25519,ssh-rsa
1325.Ed
1326.Pp
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001327The
1328.Fl Q
1329option of
1330.Xr ssh 1
1331may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001332.It Cm PubkeyAuthentication
1333Specifies whether public key authentication is allowed.
1334The default is
1335.Dq yes .
1336Note that this option applies to protocol version 2 only.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001337.It Cm RekeyLimit
1338Specifies the maximum amount of data that may be transmitted before the
1339session key is renegotiated, optionally followed a maximum amount of
1340time that may pass before the session key is renegotiated.
1341The first argument is specified in bytes and may have a suffix of
1342.Sq K ,
1343.Sq M ,
1344or
1345.Sq G
1346to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1347The default is between
1348.Sq 1G
1349and
1350.Sq 4G ,
1351depending on the cipher.
1352The optional second value is specified in seconds and may use any of the
1353units documented in the
1354.Sx TIME FORMATS
Darren Tucker64d22942013-05-16 20:31:29 +10001355section.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001356The default value for
1357.Cm RekeyLimit
1358is
1359.Dq default none ,
1360which means that rekeying is performed after the cipher's default amount
1361of data has been sent or received and no time based rekeying is done.
1362This option applies to protocol version 2 only.
Damien Miller1aed65e2010-03-04 21:53:35 +11001363.It Cm RevokedKeys
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001364Specifies revoked public keys file, or
1365.Dq none
1366to not use one.
Damien Miller1aed65e2010-03-04 21:53:35 +11001367Keys listed in this file will be refused for public key authentication.
1368Note that if this file is not readable, then public key authentication will
1369be refused for all users.
Damien Millerf3747bf2013-01-18 11:44:04 +11001370Keys may be specified as a text file, listing one public key per line, or as
1371an OpenSSH Key Revocation List (KRL) as generated by
Damien Miller72abeb72013-01-20 22:33:44 +11001372.Xr ssh-keygen 1 .
Damien Millerfecfd112013-07-18 16:11:50 +10001373For more information on KRLs, see the KEY REVOCATION LISTS section in
Damien Millerf3747bf2013-01-18 11:44:04 +11001374.Xr ssh-keygen 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001375.It Cm RhostsRSAAuthentication
1376Specifies whether rhosts or /etc/hosts.equiv authentication together
1377with successful RSA host authentication is allowed.
1378The default is
1379.Dq no .
1380This option applies to protocol version 1 only.
1381.It Cm RSAAuthentication
1382Specifies whether pure RSA authentication is allowed.
1383The default is
1384.Dq yes .
1385This option applies to protocol version 1 only.
1386.It Cm ServerKeyBits
1387Defines the number of bits in the ephemeral protocol version 1 server key.
djm@openbsd.org933935c2015-07-03 03:49:45 +00001388The default and minimum value is 1024.
Damien Miller7acefbb2014-07-18 14:11:24 +10001389.It Cm StreamLocalBindMask
1390Sets the octal file creation mode mask
1391.Pq umask
1392used when creating a Unix-domain socket file for local or remote
1393port forwarding.
1394This option is only used for port forwarding to a Unix-domain socket file.
1395.Pp
1396The default value is 0177, which creates a Unix-domain socket file that is
1397readable and writable only by the owner.
1398Note that not all operating systems honor the file mode on Unix-domain
1399socket files.
1400.It Cm StreamLocalBindUnlink
1401Specifies whether to remove an existing Unix-domain socket file for local
1402or remote port forwarding before creating a new one.
1403If the socket file already exists and
1404.Cm StreamLocalBindUnlink
1405is not enabled,
1406.Nm sshd
1407will be unable to forward the port to the Unix-domain socket file.
1408This option is only used for port forwarding to a Unix-domain socket file.
1409.Pp
1410The argument must be
1411.Dq yes
1412or
1413.Dq no .
1414The default is
1415.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001416.It Cm StrictModes
1417Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001418.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001419should check file modes and ownership of the
1420user's files and home directory before accepting login.
1421This is normally desirable because novices sometimes accidentally leave their
1422directory or files world-writable.
1423The default is
1424.Dq yes .
Darren Tuckerf788a912010-01-08 17:06:47 +11001425Note that this does not apply to
1426.Cm ChrootDirectory ,
1427whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001428.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +11001429Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +10001430Arguments should be a subsystem name and a command (with optional arguments)
1431to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001432.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001433The command
1434.Xr sftp-server 8
1435implements the
1436.Dq sftp
1437file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001438.Pp
1439Alternately the name
1440.Dq internal-sftp
1441implements an in-process
1442.Dq sftp
1443server.
1444This may simplify configurations using
1445.Cm ChrootDirectory
1446to force a different filesystem root on clients.
1447.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001448By default no subsystems are defined.
1449Note that this option applies to protocol version 2 only.
1450.It Cm SyslogFacility
1451Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001452.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001453The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1454LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1455The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001456.It Cm TCPKeepAlive
1457Specifies whether the system should send TCP keepalive messages to the
1458other side.
1459If they are sent, death of the connection or crash of one
1460of the machines will be properly noticed.
1461However, this means that
1462connections will die if the route is down temporarily, and some people
1463find it annoying.
1464On the other hand, if TCP keepalives are not sent,
1465sessions may hang indefinitely on the server, leaving
1466.Dq ghost
1467users and consuming server resources.
1468.Pp
1469The default is
1470.Dq yes
1471(to send TCP keepalive messages), and the server will notice
1472if the network goes down or the client host crashes.
1473This avoids infinitely hanging sessions.
1474.Pp
1475To disable TCP keepalive messages, the value should be set to
1476.Dq no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001477.It Cm TrustedUserCAKeys
1478Specifies a file containing public keys of certificate authorities that are
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001479trusted to sign user certificates for authentication, or
1480.Dq none
1481to not use one.
Damien Miller72b33822010-03-05 07:39:01 +11001482Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001483.Ql #
1484are allowed.
1485If a certificate is presented for authentication and has its signing CA key
1486listed in this file, then it may be used for authentication for any user
1487listed in the certificate's principals list.
1488Note that certificates that lack a list of principals will not be permitted
1489for authentication using
1490.Cm TrustedUserCAKeys .
Damien Millerfecfd112013-07-18 16:11:50 +10001491For more details on certificates, see the CERTIFICATES section in
Damien Miller1aed65e2010-03-04 21:53:35 +11001492.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001493.It Cm UseDNS
1494Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001495.Xr sshd 8
Darren Tucker83d5a982005-03-31 21:33:50 +10001496should look up the remote host name and check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001497the resolved host name for the remote IP address maps back to the
1498very same IP address.
1499The default is
deraadt@openbsd.org3cd51032015-02-02 01:57:44 +00001500.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001501.It Cm UseLogin
1502Specifies whether
1503.Xr login 1
1504is used for interactive login sessions.
1505The default is
1506.Dq no .
1507Note that
1508.Xr login 1
1509is never used for remote command execution.
1510Note also, that if this is enabled,
1511.Cm X11Forwarding
1512will be disabled because
1513.Xr login 1
1514does not know how to handle
1515.Xr xauth 1
Damien Miller495dca32003-04-01 21:42:14 +10001516cookies.
1517If
Ben Lindstrom9f049032002-06-21 00:59:05 +00001518.Cm UsePrivilegeSeparation
1519is specified, it will be disabled after authentication.
Damien Miller2e193e22003-05-14 15:13:03 +10001520.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001521Enables the Pluggable Authentication Module interface.
1522If set to
1523.Dq yes
1524this will enable PAM authentication using
1525.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001526and
1527.Cm PasswordAuthentication
1528in addition to PAM account and session module processing for all
1529authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001530.Pp
1531Because PAM challenge-response authentication usually serves an equivalent
1532role to password authentication, you should disable either
1533.Cm PasswordAuthentication
1534or
1535.Cm ChallengeResponseAuthentication.
1536.Pp
1537If
1538.Cm UsePAM
1539is enabled, you will not be able to run
1540.Xr sshd 8
1541as a non-root user.
1542The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +10001543.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001544.It Cm UsePrivilegeSeparation
1545Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001546.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001547separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +10001548to deal with incoming network traffic.
1549After successful authentication, another process will be created that has
1550the privilege of the authenticated user.
1551The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +00001552escalation by containing any corruption within the unprivileged processes.
1553The default is
1554.Dq yes .
Damien Miller69ff1df2011-06-23 08:30:03 +10001555If
1556.Cm UsePrivilegeSeparation
1557is set to
1558.Dq sandbox
1559then the pre-authentication unprivileged process is subject to additional
1560restrictions.
Damien Miller23528812012-04-22 11:24:43 +10001561.It Cm VersionAddendum
1562Optionally specifies additional text to append to the SSH protocol banner
1563sent by the server upon connection.
1564The default is
1565.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001566.It Cm X11DisplayOffset
1567Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001568.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001569X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001570This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001571The default is 10.
1572.It Cm X11Forwarding
1573Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001574The argument must be
1575.Dq yes
1576or
1577.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001578The default is
1579.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +10001580.Pp
1581When X11 forwarding is enabled, there may be additional exposure to
1582the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001583.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001584proxy display is configured to listen on the wildcard address (see
1585.Cm X11UseLocalhost
Damien Miller5b0d63f2006-03-15 11:56:56 +11001586below), though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001587Additionally, the authentication spoofing and authentication data
1588verification and substitution occur on the client side.
1589The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001590display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001591forwarding (see the warnings for
1592.Cm ForwardX11
1593in
Damien Millerf1ce5052003-06-11 22:04:39 +10001594.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001595A system administrator may have a stance in which they want to
1596protect clients that may expose themselves to attack by unwittingly
1597requesting X11 forwarding, which can warrant a
1598.Dq no
1599setting.
1600.Pp
1601Note that disabling X11 forwarding does not prevent users from
1602forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001603X11 forwarding is automatically disabled if
1604.Cm UseLogin
1605is enabled.
1606.It Cm X11UseLocalhost
1607Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001608.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001609should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001610the wildcard address.
1611By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001612sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001613hostname part of the
1614.Ev DISPLAY
1615environment variable to
1616.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001617This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001618However, some older X11 clients may not function with this
1619configuration.
1620.Cm X11UseLocalhost
1621may be set to
1622.Dq no
1623to specify that the forwarding server should be bound to the wildcard
1624address.
1625The argument must be
1626.Dq yes
1627or
1628.Dq no .
1629The default is
1630.Dq yes .
1631.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001632Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001633.Xr xauth 1
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001634program, or
1635.Dq none
1636to not use one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001637The default is
1638.Pa /usr/X11R6/bin/xauth .
1639.El
Damien Millere3beba22006-03-15 11:59:25 +11001640.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001641.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001642command-line arguments and configuration file options that specify time
1643may be expressed using a sequence of the form:
1644.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001645.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001646.Sm on
1647where
1648.Ar time
1649is a positive integer value and
1650.Ar qualifier
1651is one of the following:
1652.Pp
1653.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001654.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001655seconds
1656.It Cm s | Cm S
1657seconds
1658.It Cm m | Cm M
1659minutes
1660.It Cm h | Cm H
1661hours
1662.It Cm d | Cm D
1663days
1664.It Cm w | Cm W
1665weeks
1666.El
1667.Pp
1668Each member of the sequence is added together to calculate
1669the total time value.
1670.Pp
1671Time format examples:
1672.Pp
1673.Bl -tag -width Ds -compact -offset indent
1674.It 600
1675600 seconds (10 minutes)
1676.It 10m
167710 minutes
1678.It 1h30m
16791 hour 30 minutes (90 minutes)
1680.El
1681.Sh FILES
1682.Bl -tag -width Ds
1683.It Pa /etc/ssh/sshd_config
1684Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001685.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001686This file should be writable by root only, but it is recommended
1687(though not necessary) that it be world-readable.
1688.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001689.Sh SEE ALSO
1690.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001691.Sh AUTHORS
1692OpenSSH is a derivative of the original and free
1693ssh 1.2.12 release by Tatu Ylonen.
1694Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1695Theo de Raadt and Dug Song
1696removed many bugs, re-added newer features and
1697created OpenSSH.
1698Markus Friedl contributed the support for SSH
1699protocol versions 1.5 and 2.0.
1700Niels Provos and Markus Friedl contributed support
1701for privilege separation.