blob: 3b809c28d3436310ea3a724fd67c9f45c13dfa88 [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.\"
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +000036.\" $OpenBSD: sshd_config.5,v 1.190 2015/01/22 20:24:41 deraadt Exp $
37.Dd $Mdocdate: January 22 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.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100073Note that environment passing is only supported for protocol 2.
Darren Tucker46bc0752004-05-02 22:11:30 +100074Variables are specified by name, which may contain the wildcard characters
Damien Miller208f1ed2006-03-15 11:56:03 +110075.Ql *
Darren Tucker46bc0752004-05-02 22:11:30 +100076and
77.Ql \&? .
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100078Multiple environment variables may be separated by whitespace or spread
Darren Tucker46bc0752004-05-02 22:11:30 +100079across multiple
80.Cm AcceptEnv
81directives.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100082Be warned that some environment variables could be used to bypass restricted
Darren Tucker46bc0752004-05-02 22:11:30 +100083user environments.
84For this reason, care should be taken in the use of this directive.
85The default is not to accept any environment variables.
Darren Tucker0f383232005-01-20 10:57:56 +110086.It Cm AddressFamily
87Specifies which address family should be used by
Damien Millerf4f22b52006-03-15 11:57:25 +110088.Xr sshd 8 .
Darren Tucker0f383232005-01-20 10:57:56 +110089Valid arguments are
90.Dq any ,
91.Dq inet
Damien Miller5b0d63f2006-03-15 11:56:56 +110092(use IPv4 only), or
Darren Tucker0f383232005-01-20 10:57:56 +110093.Dq inet6
94(use IPv6 only).
95The default is
96.Dq any .
Damien Millere9890192008-05-19 14:59:02 +100097.It Cm AllowAgentForwarding
98Specifies whether
99.Xr ssh-agent 1
100forwarding is permitted.
101The default is
102.Dq yes .
103Note that disabling agent forwarding does not improve security
104unless users are also denied shell access, as they can always install
105their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000106.It Cm AllowGroups
107This keyword can be followed by a list of group name patterns, separated
108by spaces.
109If specified, login is allowed only for users whose primary
110group or supplementary group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000111Only group names are valid; a numerical group ID is not recognized.
112By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100113The allow/deny directives are processed in the following order:
114.Cm DenyUsers ,
115.Cm AllowUsers ,
116.Cm DenyGroups ,
117and finally
118.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100119.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000120See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100121.Xr ssh_config 5
122for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000123.It Cm AllowTcpForwarding
124Specifies whether TCP forwarding is permitted.
Damien Milleraa5b3f82012-12-03 09:50:54 +1100125The available options are
126.Dq yes
127or
128.Dq all
129to allow TCP forwarding,
130.Dq no
131to prevent all TCP forwarding,
132.Dq local
133to allow local (from the perspective of
Darren Tuckerf9333d52012-12-07 13:06:13 +1100134.Xr ssh 1 )
135forwarding only or
Damien Milleraa5b3f82012-12-03 09:50:54 +1100136.Dq remote
137to allow remote forwarding only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000138The default is
139.Dq yes .
140Note that disabling TCP forwarding does not improve security unless
141users are also denied shell access, as they can always install their
142own forwarders.
Damien Miller7acefbb2014-07-18 14:11:24 +1000143.It Cm AllowStreamLocalForwarding
144Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
145The available options are
146.Dq yes
147or
148.Dq all
149to allow StreamLocal forwarding,
150.Dq no
151to prevent all StreamLocal forwarding,
152.Dq local
153to allow local (from the perspective of
154.Xr ssh 1 )
155forwarding only or
156.Dq remote
157to allow remote forwarding only.
158The default is
159.Dq yes .
160Note that disabling StreamLocal forwarding does not improve security unless
161users are also denied shell access, as they can always install their
162own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000163.It Cm AllowUsers
164This keyword can be followed by a list of user name patterns, separated
165by spaces.
Damien Miller5a93add2003-01-24 11:34:52 +1100166If specified, login is allowed only for user names that
Ben Lindstrom9f049032002-06-21 00:59:05 +0000167match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000168Only user names are valid; a numerical user ID is not recognized.
169By default, login is allowed for all users.
170If the pattern takes the form USER@HOST then USER and HOST
171are separately checked, restricting logins to particular
172users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100173The allow/deny directives are processed in the following order:
174.Cm DenyUsers ,
175.Cm AllowUsers ,
176.Cm DenyGroups ,
177and finally
178.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100179.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000180See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100181.Xr ssh_config 5
182for more information on patterns.
Damien Millera6e3f012012-11-04 23:21:40 +1100183.It Cm AuthenticationMethods
184Specifies the authentication methods that must be successfully completed
185for a user to be granted access.
186This option must be followed by one or more comma-separated lists of
187authentication method names.
188Successful authentication requires completion of every method in at least
189one of these lists.
190.Pp
191For example, an argument of
192.Dq publickey,password publickey,keyboard-interactive
193would require the user to complete public key authentication, followed by
194either password or keyboard interactive authentication.
195Only methods that are next in one or more lists are offered at each stage,
196so for this example, it would not be possible to attempt password or
197keyboard-interactive authentication before public key.
198.Pp
Damien Miller91a55f22013-04-23 15:18:10 +1000199For keyboard interactive authentication it is also possible to
200restrict authentication to a specific device by appending a
201colon followed by the device identifier
202.Dq bsdauth ,
203.Dq pam ,
204or
205.Dq skey ,
206depending on the server configuration.
207For example,
208.Dq keyboard-interactive:bsdauth
209would restrict keyboard interactive authentication to the
210.Dq bsdauth
211device.
212.Pp
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000213If the
214.Dq publickey
jmc@openbsd.org449e11b2014-12-22 08:24:17 +0000215method is listed more than once,
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000216.Xr sshd 8
217verifies that keys that have been used successfully are not reused for
218subsequent authentications.
219For example, an
220.Cm AuthenticationMethods
221of
222.Dq publickey,publickey
223will require successful authentication using two different public keys.
224.Pp
Damien Millera6e3f012012-11-04 23:21:40 +1100225This option is only available for SSH protocol 2 and will yield a fatal
226error if enabled if protocol 1 is also enabled.
227Note that each authentication method listed should also be explicitly enabled
228in the configuration.
229The default is not to require multiple authentication; successful completion
230of a single authentication method is sufficient.
Damien Miller09d3e122012-10-31 08:58:58 +1100231.It Cm AuthorizedKeysCommand
Damien Millerf33580e2012-11-04 22:22:52 +1100232Specifies a program to be used to look up the user's public keys.
Damien Miller467b00c2013-04-23 15:23:07 +1000233The program must be owned by root and not writable by group or others.
234It will be invoked with a single argument of the username
Damien Miller09d3e122012-10-31 08:58:58 +1100235being authenticated, and should produce on standard output zero or
Damien Millerfecfd112013-07-18 16:11:50 +1000236more lines of authorized_keys output (see AUTHORIZED_KEYS in
Damien Millerf33580e2012-11-04 22:22:52 +1100237.Xr sshd 8 ) .
Damien Miller09d3e122012-10-31 08:58:58 +1100238If a key supplied by AuthorizedKeysCommand does not successfully authenticate
239and authorize the user then public key authentication continues using the usual
240.Cm AuthorizedKeysFile
241files.
242By default, no AuthorizedKeysCommand is run.
243.It Cm AuthorizedKeysCommandUser
244Specifies the user under whose account the AuthorizedKeysCommand is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100245It is recommended to use a dedicated user that has no other role on the host
246than running authorized keys commands.
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000247If
djm@openbsd.orgd663bea2014-12-11 05:25:06 +0000248.Cm AuthorizedKeysCommand
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000249is specified but
250.Cm AuthorizedKeysCommandUser
251is not, then
252.Xr sshd 8
253will refuse to start.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000254.It Cm AuthorizedKeysFile
255Specifies the file that contains the public keys that can be used
256for user authentication.
Damien Miller6018a362010-07-02 13:35:19 +1000257The format is described in the
Damien Millerfecfd112013-07-18 16:11:50 +1000258AUTHORIZED_KEYS FILE FORMAT
Damien Miller6018a362010-07-02 13:35:19 +1000259section of
260.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000261.Cm AuthorizedKeysFile
262may contain tokens of the form %T which are substituted during connection
Damien Miller5b0d63f2006-03-15 11:56:56 +1100263setup.
Damien Millerfbf486b2003-05-23 18:44:23 +1000264The following tokens are defined: %% is replaced by a literal '%',
Damien Miller5b0d63f2006-03-15 11:56:56 +1100265%h is replaced by the home directory of the user being authenticated, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000266%u is replaced by the username of that user.
267After expansion,
268.Cm AuthorizedKeysFile
269is taken to be an absolute path or one relative to the user's home
270directory.
Damien Millerb9132fc2011-05-29 21:41:40 +1000271Multiple files may be listed, separated by whitespace.
272The default is
273.Dq .ssh/authorized_keys .ssh/authorized_keys2 .
Damien Miller30da3442010-05-10 11:58:03 +1000274.It Cm AuthorizedPrincipalsFile
275Specifies a file that lists principal names that are accepted for
276certificate authentication.
277When using certificates signed by a key listed in
278.Cm TrustedUserCAKeys ,
279this file lists names, one of which must appear in the certificate for it
280to be accepted for authentication.
Damien Millerd59dab82010-07-02 13:37:17 +1000281Names are listed one per line preceded by key options (as described
Damien Millerfecfd112013-07-18 16:11:50 +1000282in AUTHORIZED_KEYS FILE FORMAT in
Damien Millerd59dab82010-07-02 13:37:17 +1000283.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000284Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000285.Ql #
286are ignored.
287.Pp
288.Cm AuthorizedPrincipalsFile
289may contain tokens of the form %T which are substituted during connection
290setup.
291The following tokens are defined: %% is replaced by a literal '%',
292%h is replaced by the home directory of the user being authenticated, and
293%u is replaced by the username of that user.
294After expansion,
295.Cm AuthorizedPrincipalsFile
296is taken to be an absolute path or one relative to the user's home
297directory.
298.Pp
Damien Miller8fef9eb2012-04-22 11:25:10 +1000299The default is
300.Dq none ,
301i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000302of the user must appear in a certificate's principals list for it to be
303accepted.
304Note that
305.Cm AuthorizedPrincipalsFile
306is only used when authentication proceeds using a CA listed in
307.Cm TrustedUserCAKeys
308and is not consulted for certification authorities trusted via
309.Pa ~/.ssh/authorized_keys ,
310though the
311.Cm principals=
312key option offers a similar facility (see
313.Xr sshd 8
314for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000315.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000316The contents of the specified file are sent to the remote user before
317authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000318If the argument is
319.Dq none
320then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000321This option is only available for protocol version 2.
322By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000323.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000324Specifies whether challenge-response authentication is allowed (e.g. via
Damien Millere8c9f262014-10-03 09:24:56 +1000325PAM or through authentication styles supported in
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000326.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000327The default is
328.Dq yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100329.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100330Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100331.Xr chroot 2
332to after authentication.
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000333At session startup
334.Xr sshd 8
335checks that all components of the pathname are root-owned directories
336which are not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000337After the chroot,
338.Xr sshd 8
339changes the working directory to the user's home directory.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100340.Pp
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100341The pathname may contain the following tokens that are expanded at runtime once
Damien Millerd8cb1f12008-02-10 22:40:12 +1100342the connecting user has been authenticated: %% is replaced by a literal '%',
343%h is replaced by the home directory of the user being authenticated, and
344%u is replaced by the username of that user.
345.Pp
346The
347.Cm ChrootDirectory
348must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000349user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100350For an interactive session this requires at least a shell, typically
351.Xr sh 1 ,
352and basic
353.Pa /dev
354nodes such as
355.Xr null 4 ,
356.Xr zero 4 ,
357.Xr stdin 4 ,
358.Xr stdout 4 ,
359.Xr stderr 4 ,
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000360and
Damien Millerd8cb1f12008-02-10 22:40:12 +1100361.Xr tty 4
362devices.
363For file transfer sessions using
Darren Tuckerf92077f2009-06-21 17:56:25 +1000364.Dq sftp ,
Damien Millerd8cb1f12008-02-10 22:40:12 +1100365no additional configuration of the environment is necessary if the
Darren Tuckerf92077f2009-06-21 17:56:25 +1000366in-process sftp server is used,
Damien Miller426117b2014-07-30 12:33:20 +1000367though sessions which use logging may require
Darren Tucker00fcd712009-06-21 17:56:00 +1000368.Pa /dev/log
Damien Miller426117b2014-07-30 12:33:20 +1000369inside the chroot directory on some operating systems (see
Darren Tucker00fcd712009-06-21 17:56:00 +1000370.Xr sftp-server 8
371for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100372.Pp
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000373For safety, it is very important that the directory heirarchy be
374prevented from modification by other processes on the system (especially
375those outside the jail).
376Misconfiguration can lead to unsafe environments which
377.Xr sshd 8
378cannot detect.
379.Pp
Damien Millerd8cb1f12008-02-10 22:40:12 +1100380The default is not to
381.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000382.It Cm Ciphers
383Specifies the ciphers allowed for protocol version 2.
384Multiple ciphers must be comma-separated.
Damien Miller0fde8ac2013-11-21 14:12:23 +1100385The supported ciphers are:
386.Pp
Damien Millerc1621c82014-04-20 13:22:46 +1000387.Bl -item -compact -offset indent
388.It
3893des-cbc
390.It
391aes128-cbc
392.It
393aes192-cbc
394.It
395aes256-cbc
396.It
397aes128-ctr
398.It
399aes192-ctr
400.It
401aes256-ctr
402.It
403aes128-gcm@openssh.com
404.It
405aes256-gcm@openssh.com
406.It
407arcfour
408.It
409arcfour128
410.It
411arcfour256
412.It
413blowfish-cbc
414.It
415cast128-cbc
416.It
417chacha20-poly1305@openssh.com
418.El
Damien Miller0fde8ac2013-11-21 14:12:23 +1100419.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100420The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000421.Bd -literal -offset indent
422aes128-ctr,aes192-ctr,aes256-ctr,
Damien Miller1d75abf2013-01-09 16:12:19 +1100423aes128-gcm@openssh.com,aes256-gcm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000424chacha20-poly1305@openssh.com
Ben Lindstrom9f049032002-06-21 00:59:05 +0000425.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100426.Pp
427The list of available ciphers may also be obtained using the
428.Fl Q
429option of
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000430.Xr ssh 1
431with an argument of
432.Dq cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000433.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100434Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000435sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100436.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000437receiving any messages back from the client.
438If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100439sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000440It is important to note that the use of client alive messages is very
441different from
Damien Miller12c150e2003-12-17 16:31:10 +1100442.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000443(below).
444The client alive messages are sent through the encrypted channel
445and therefore will not be spoofable.
446The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100447.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000448is spoofable.
449The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000450server depend on knowing when a connection has become inactive.
451.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000452The default value is 3.
453If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000454.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100455(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000456.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100457is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000458will be disconnected after approximately 45 seconds.
Damien Millercc3e8ba2006-03-15 12:06:55 +1100459This option applies to protocol version 2 only.
Damien Miller1594ad52005-05-26 12:12:19 +1000460.It Cm ClientAliveInterval
461Sets a timeout interval in seconds after which if no data has been received
462from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100463.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000464will send a message through the encrypted
465channel to request a response from the client.
466The default
467is 0, indicating that these messages will not be sent to the client.
468This option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000469.It Cm Compression
Damien Miller9786e6e2005-07-26 21:54:56 +1000470Specifies whether compression is allowed, or delayed until
471the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000472The argument must be
Damien Miller9786e6e2005-07-26 21:54:56 +1000473.Dq yes ,
474.Dq delayed ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000475or
476.Dq no .
477The default is
Damien Miller9786e6e2005-07-26 21:54:56 +1000478.Dq delayed .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000479.It Cm DenyGroups
480This keyword can be followed by a list of group name patterns, separated
481by spaces.
482Login is disallowed for users whose primary group or supplementary
483group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000484Only group names are valid; a numerical group ID is not recognized.
485By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100486The allow/deny directives are processed in the following order:
487.Cm DenyUsers ,
488.Cm AllowUsers ,
489.Cm DenyGroups ,
490and finally
491.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100492.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000493See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100494.Xr ssh_config 5
495for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000496.It Cm DenyUsers
497This keyword can be followed by a list of user name patterns, separated
498by spaces.
499Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000500Only user names are valid; a numerical user ID is not recognized.
501By default, login is allowed for all users.
502If the pattern takes the form USER@HOST then USER and HOST
503are separately checked, restricting logins to particular
504users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100505The allow/deny directives are processed in the following order:
506.Cm DenyUsers ,
507.Cm AllowUsers ,
508.Cm DenyGroups ,
509and finally
510.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100511.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000512See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100513.Xr ssh_config 5
514for more information on patterns.
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000515.It Cm FingerprintHash
516Specifies the hash algorithm used when logging key fingerprints.
517Valid options are:
518.Dq md5
519and
520.Dq sha256 .
521The default is
522.Dq sha256 .
Damien Millere2754432006-07-24 14:06:47 +1000523.It Cm ForceCommand
524Forces the execution of the command specified by
525.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100526ignoring any command supplied by the client and
527.Pa ~/.ssh/rc
528if present.
Damien Millere2754432006-07-24 14:06:47 +1000529The command is invoked by using the user's login shell with the -c option.
530This applies to shell, command, or subsystem execution.
531It is most useful inside a
532.Cm Match
533block.
534The command originally supplied by the client is available in the
535.Ev SSH_ORIGINAL_COMMAND
536environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100537Specifying a command of
538.Dq internal-sftp
539will force the use of an in-process sftp server that requires no support
540files when used with
541.Cm ChrootDirectory .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000542.It Cm GatewayPorts
543Specifies whether remote hosts are allowed to connect to ports
544forwarded for the client.
545By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100546.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000547binds remote port forwardings to the loopback address.
548This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000549.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100550can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100551should allow remote port forwardings to bind to non-loopback addresses, thus
552allowing other hosts to connect.
553The argument may be
554.Dq no
555to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000556.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100557to force remote port forwardings to bind to the wildcard address, or
558.Dq clientspecified
559to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000560The default is
561.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000562.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000563Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100564The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000565.Dq no .
566Note that this option applies to protocol version 2 only.
567.It Cm GSSAPICleanupCredentials
568Specifies whether to automatically destroy the user's credentials cache
569on logout.
570The default is
571.Dq yes .
572Note that this option applies to protocol version 2 only.
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000573.It Cm HostbasedAcceptedKeyTypes
574Specifies the key types that will be accepted for hostbased authentication
575as a comma-separated pattern list.
576The default
577.Dq *
578will allow all key types.
579The
580.Fl Q
581option of
582.Xr ssh 1
583may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000584.It Cm HostbasedAuthentication
585Specifies whether rhosts or /etc/hosts.equiv authentication together
586with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100587(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000588This option is similar to
589.Cm RhostsRSAAuthentication
590and applies to protocol version 2 only.
591The default is
592.Dq no .
Damien Millerb594f382006-08-30 11:06:34 +1000593.It Cm HostbasedUsesNameFromPacketOnly
594Specifies whether or not the server will attempt to perform a reverse
595name lookup when matching the name in the
596.Pa ~/.shosts ,
597.Pa ~/.rhosts ,
598and
599.Pa /etc/hosts.equiv
600files during
601.Cm HostbasedAuthentication .
602A setting of
603.Dq yes
604means that
605.Xr sshd 8
606uses the name supplied by the client rather than
607attempting to resolve the name from the TCP connection itself.
608The default is
609.Dq no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100610.It Cm HostCertificate
611Specifies a file containing a public host certificate.
612The certificate's public key must match a private host key already specified
613by
614.Cm HostKey .
615The default behaviour of
616.Xr sshd 8
617is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000618.It Cm HostKey
619Specifies a file containing a private host key
620used by SSH.
621The default is
622.Pa /etc/ssh/ssh_host_key
623for protocol version 1, and
Damien Millereb8b60e2010-08-31 22:41:14 +1000624.Pa /etc/ssh/ssh_host_dsa_key ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100625.Pa /etc/ssh/ssh_host_ecdsa_key ,
626.Pa /etc/ssh/ssh_host_ed25519_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000627and
Damien Millereb8b60e2010-08-31 22:41:14 +1000628.Pa /etc/ssh/ssh_host_rsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000629for protocol version 2.
630Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100631.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000632will refuse to use a file if it is group/world-accessible.
633It is possible to have multiple host key files.
634.Dq rsa1
635keys are used for version 1 and
Damien Millereb8b60e2010-08-31 22:41:14 +1000636.Dq dsa ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100637.Dq ecdsa ,
638.Dq ed25519
Ben Lindstrom9f049032002-06-21 00:59:05 +0000639or
640.Dq rsa
641are used for version 2 of the SSH protocol.
Damien Miller85b45e02013-07-20 13:21:52 +1000642It is also possible to specify public host key files instead.
643In this case operations on the private key will be delegated
644to an
645.Xr ssh-agent 1 .
646.It Cm HostKeyAgent
647Identifies the UNIX-domain socket used to communicate
648with an agent that has access to the private host keys.
649If
650.Dq SSH_AUTH_SOCK
651is specified, the location of the socket will be read from the
652.Ev SSH_AUTH_SOCK
653environment variable.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000654.It Cm IgnoreRhosts
655Specifies that
656.Pa .rhosts
657and
658.Pa .shosts
659files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000660.Cm RhostsRSAAuthentication
661or
662.Cm HostbasedAuthentication .
663.Pp
664.Pa /etc/hosts.equiv
665and
666.Pa /etc/shosts.equiv
667are still used.
668The default is
669.Dq yes .
670.It Cm IgnoreUserKnownHosts
671Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100672.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000673should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000674.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000675during
676.Cm RhostsRSAAuthentication
677or
678.Cm HostbasedAuthentication .
679The default is
680.Dq no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100681.It Cm IPQoS
682Specifies the IPv4 type-of-service or DSCP class for the connection.
683Accepted values are
684.Dq af11 ,
685.Dq af12 ,
686.Dq af13 ,
Damien Millerf6e758c2011-09-22 21:37:13 +1000687.Dq af21 ,
Damien Miller0dac6fb2010-11-20 15:19:38 +1100688.Dq af22 ,
689.Dq af23 ,
690.Dq af31 ,
691.Dq af32 ,
692.Dq af33 ,
693.Dq af41 ,
694.Dq af42 ,
695.Dq af43 ,
696.Dq cs0 ,
697.Dq cs1 ,
698.Dq cs2 ,
699.Dq cs3 ,
700.Dq cs4 ,
701.Dq cs5 ,
702.Dq cs6 ,
703.Dq cs7 ,
704.Dq ef ,
705.Dq lowdelay ,
706.Dq throughput ,
707.Dq reliability ,
708or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +1100709This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100710If one argument is specified, it is used as the packet class unconditionally.
711If two values are specified, the first is automatically selected for
712interactive sessions and the second for non-interactive sessions.
713The default is
714.Dq lowdelay
715for interactive sessions and
716.Dq throughput
717for non-interactive sessions.
Damien Millere1e480a2014-02-04 11:13:17 +1100718.It Cm KbdInteractiveAuthentication
719Specifies whether to allow keyboard-interactive authentication.
720The argument to this keyword must be
721.Dq yes
722or
723.Dq no .
724The default is to use whatever value
725.Cm ChallengeResponseAuthentication
726is set to
727(by default
728.Dq yes ) .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000729.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000730Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000731.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000732will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000733To use this option, the server needs a
734Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100735The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000736.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100737.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000738If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100739an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100740The default is
Damien Miller8448e662004-03-08 23:13:15 +1100741.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000742.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100743If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000744the password will be validated via any additional local mechanism
745such as
746.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100747The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000748.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000749.It Cm KerberosTicketCleanup
750Specifies whether to automatically destroy the user's ticket cache
751file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100752The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000753.Dq yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000754.It Cm KexAlgorithms
755Specifies the available KEX (Key Exchange) algorithms.
756Multiple algorithms must be comma-separated.
Damien Millerc1621c82014-04-20 13:22:46 +1000757The supported algorithms are:
758.Pp
759.Bl -item -compact -offset indent
760.It
761curve25519-sha256@libssh.org
762.It
763diffie-hellman-group1-sha1
764.It
765diffie-hellman-group14-sha1
766.It
767diffie-hellman-group-exchange-sha1
768.It
769diffie-hellman-group-exchange-sha256
770.It
771ecdh-sha2-nistp256
772.It
773ecdh-sha2-nistp384
774.It
775ecdh-sha2-nistp521
776.El
777.Pp
778The default is:
Damien Miller6575c3a2013-12-18 17:47:02 +1100779.Bd -literal -offset indent
780curve25519-sha256@libssh.org,
781ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
782diffie-hellman-group-exchange-sha256,
Damien Millerc1621c82014-04-20 13:22:46 +1000783diffie-hellman-group14-sha1
Damien Miller6575c3a2013-12-18 17:47:02 +1100784.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000785.Pp
786The list of available key exchange algorithms may also be obtained using the
787.Fl Q
788option of
789.Xr ssh 1
790with an argument of
791.Dq kex .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000792.It Cm KeyRegenerationInterval
793In protocol version 1, the ephemeral server key is automatically regenerated
794after this many seconds (if it has been used).
795The purpose of regeneration is to prevent
796decrypting captured sessions by later breaking into the machine and
797stealing the keys.
798The key is never stored anywhere.
799If the value is 0, the key is never regenerated.
800The default is 3600 (seconds).
801.It Cm ListenAddress
802Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100803.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000804should listen on.
805The following forms may be used:
806.Pp
807.Bl -item -offset indent -compact
808.It
809.Cm ListenAddress
810.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000811.Ar host | Ar IPv4_addr | Ar IPv6_addr
Ben Lindstrom9f049032002-06-21 00:59:05 +0000812.Sm on
813.It
814.Cm ListenAddress
815.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000816.Ar host | Ar IPv4_addr : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000817.Sm on
818.It
819.Cm ListenAddress
820.Sm off
821.Oo
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000822.Ar host | Ar IPv6_addr Oc : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000823.Sm on
824.El
825.Pp
826If
827.Ar port
828is not specified,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100829sshd will listen on the address and all prior
Ben Lindstrom9f049032002-06-21 00:59:05 +0000830.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000831options specified.
832The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000833Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000834.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000835options are permitted.
836Additionally, any
Ben Lindstrom9f049032002-06-21 00:59:05 +0000837.Cm Port
Damien Miller5b0d63f2006-03-15 11:56:56 +1100838options must precede this option for non-port qualified addresses.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000839.It Cm LoginGraceTime
840The server disconnects after this time if the user has not
841successfully logged in.
842If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000843The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000844.It Cm LogLevel
845Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100846.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000847The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100848QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000849The default is INFO.
850DEBUG and DEBUG1 are equivalent.
851DEBUG2 and DEBUG3 each specify higher levels of debugging output.
852Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000853.It Cm MACs
854Specifies the available MAC (message authentication code) algorithms.
855The MAC algorithm is used in protocol version 2
856for data integrity protection.
857Multiple algorithms must be comma-separated.
Damien Milleraf43a7a2012-12-12 10:46:31 +1100858The algorithms that contain
859.Dq -etm
860calculate the MAC after encryption (encrypt-then-mac).
861These are considered safer and their use recommended.
Damien Millerc1621c82014-04-20 13:22:46 +1000862The supported MACs are:
863.Pp
864.Bl -item -compact -offset indent
865.It
866hmac-md5
867.It
868hmac-md5-96
869.It
870hmac-ripemd160
871.It
872hmac-sha1
873.It
874hmac-sha1-96
875.It
876hmac-sha2-256
877.It
878hmac-sha2-512
879.It
880umac-64@openssh.com
881.It
882umac-128@openssh.com
883.It
884hmac-md5-etm@openssh.com
885.It
886hmac-md5-96-etm@openssh.com
887.It
888hmac-ripemd160-etm@openssh.com
889.It
890hmac-sha1-etm@openssh.com
891.It
892hmac-sha1-96-etm@openssh.com
893.It
894hmac-sha2-256-etm@openssh.com
895.It
896hmac-sha2-512-etm@openssh.com
897.It
898umac-64-etm@openssh.com
899.It
900umac-128-etm@openssh.com
901.El
902.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100903The default is:
Damien Miller22b7b492007-06-11 14:07:12 +1000904.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +1100905umac-64-etm@openssh.com,umac-128-etm@openssh.com,
906hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000907umac-64@openssh.com,umac-128@openssh.com,
908hmac-sha2-256,hmac-sha2-512
Damien Miller22b7b492007-06-11 14:07:12 +1000909.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000910.Pp
911The list of available MAC algorithms may also be obtained using the
912.Fl Q
913option of
914.Xr ssh 1
915with an argument of
916.Dq mac .
Darren Tucker45150472006-07-12 22:34:17 +1000917.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +1000918Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +1000919If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +1000920.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000921line are satisfied, the keywords on the following lines override those
922set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +1000923.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000924line or the end of the file.
Damien Millerfc5d6752014-02-28 10:01:28 +1100925If a keyword appears in multiple
926.Cm Match
sobrado@openbsd.org180bcb42014-08-30 16:32:25 +0000927blocks that are satisfied, only the first instance of the keyword is
Damien Millerfc5d6752014-02-28 10:01:28 +1100928applied.
Darren Tucker7a3935d2008-06-10 22:59:10 +1000929.Pp
Damien Millerd04f3572006-07-24 13:46:50 +1000930The arguments to
Darren Tucker45150472006-07-12 22:34:17 +1000931.Cm Match
Damien Millercf31f382013-10-24 21:02:56 +1100932are one or more criteria-pattern pairs or the single token
933.Cm All
934which matches all criteria.
Darren Tucker45150472006-07-12 22:34:17 +1000935The available criteria are
936.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +1000937.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +1000938.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +1000939.Cm LocalAddress ,
940.Cm LocalPort ,
Darren Tucker45150472006-07-12 22:34:17 +1000941and
942.Cm Address .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000943The match patterns may consist of single entries or comma-separated
944lists and may use the wildcard and negation operators described in the
Damien Millerfecfd112013-07-18 16:11:50 +1000945PATTERNS section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +1000946.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000947.Pp
948The patterns in an
949.Cm Address
950criteria may additionally contain addresses to match in CIDR
Darren Tucker6a2a4002008-06-10 23:03:04 +1000951address/masklen format, e.g.\&
Darren Tucker7a3935d2008-06-10 22:59:10 +1000952.Dq 192.0.2.0/24
953or
954.Dq 3ffe:ffff::/32 .
955Note that the mask length provided must be consistent with the address -
956it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +1000957or one with bits set in this host portion of the address.
958For example,
Darren Tucker7a3935d2008-06-10 22:59:10 +1000959.Dq 192.0.2.0/33
960and
Darren Tucker6a2a4002008-06-10 23:03:04 +1000961.Dq 192.0.2.0/8
Darren Tucker7a3935d2008-06-10 22:59:10 +1000962respectively.
963.Pp
Darren Tucker45150472006-07-12 22:34:17 +1000964Only a subset of keywords may be used on the lines following a
965.Cm Match
966keyword.
967Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +1000968.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +1100969.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +1000970.Cm AllowGroups ,
Damien Miller9b439df2006-07-24 14:04:00 +1000971.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +1000972.Cm AllowUsers ,
Damien Millera6e3f012012-11-04 23:21:40 +1100973.Cm AuthenticationMethods ,
Damien Miller09d3e122012-10-31 08:58:58 +1100974.Cm AuthorizedKeysCommand ,
975.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +1100976.Cm AuthorizedKeysFile ,
Damien Millerab6de352010-06-26 09:38:45 +1000977.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +1100978.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +1000979.Cm ChrootDirectory ,
Damien Millerc24da772012-06-20 21:53:58 +1000980.Cm DenyGroups ,
981.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +1000982.Cm ForceCommand ,
Damien Millerc24da772012-06-20 21:53:58 +1000983.Cm GatewayPorts ,
Damien Millerf8268502012-06-20 21:54:15 +1000984.Cm GSSAPIAuthentication ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000985.Cm HostbasedAcceptedKeyTypes ,
Damien Miller25434de2008-05-19 14:29:08 +1000986.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +1000987.Cm HostbasedUsesNameFromPacketOnly ,
Darren Tucker1d75f222007-03-01 21:31:28 +1100988.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +1100989.Cm KerberosAuthentication ,
Damien Miller307c1d12008-06-16 07:56:20 +1000990.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +1000991.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +1100992.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +1100993.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +1000994.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +1100995.Cm PermitRootLogin ,
Damien Miller5ff30c62013-10-30 22:21:50 +1100996.Cm PermitTTY ,
Damien Millerab6de352010-06-26 09:38:45 +1000997.Cm PermitTunnel ,
Damien Miller72e6b5c2014-07-04 09:00:04 +1000998.Cm PermitUserRC ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000999.Cm PubkeyAcceptedKeyTypes ,
Darren Tucker1477ea12009-10-07 08:36:05 +11001000.Cm PubkeyAuthentication ,
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001001.Cm RekeyLimit ,
Damien Millerc24da772012-06-20 21:53:58 +10001002.Cm RhostsRSAAuthentication ,
Damien Millerf8268502012-06-20 21:54:15 +10001003.Cm RSAAuthentication ,
Damien Millerd1de9952006-07-24 14:05:48 +10001004.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +11001005.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +10001006and
Damien Miller0296ae82009-02-23 11:00:24 +11001007.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +10001008.It Cm MaxAuthTries
1009Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +10001010connection.
1011Once the number of failures reaches half this value,
1012additional failures are logged.
1013The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +10001014.It Cm MaxSessions
1015Specifies the maximum number of open sessions permitted per network connection.
1016The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001017.It Cm MaxStartups
1018Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001019SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001020Additional connections will be dropped until authentication succeeds or the
1021.Cm LoginGraceTime
1022expires for a connection.
Damien Miller1f583df2013-02-12 11:02:08 +11001023The default is 10:30:100.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001024.Pp
1025Alternatively, random early drop can be enabled by specifying
1026the three colon separated values
1027.Dq start:rate:full
Damien Miller208f1ed2006-03-15 11:56:03 +11001028(e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +11001029.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001030will refuse connection attempts with a probability of
1031.Dq rate/100
1032(30%)
1033if there are currently
1034.Dq start
1035(10)
1036unauthenticated connections.
1037The probability increases linearly and all connection attempts
1038are refused if the number of unauthenticated connections reaches
1039.Dq full
1040(60).
1041.It Cm PasswordAuthentication
1042Specifies whether password authentication is allowed.
1043The default is
1044.Dq yes .
1045.It Cm PermitEmptyPasswords
1046When password authentication is allowed, it specifies whether the
1047server allows login to accounts with empty password strings.
1048The default is
1049.Dq no .
Damien Miller9b439df2006-07-24 14:04:00 +10001050.It Cm PermitOpen
1051Specifies the destinations to which TCP port forwarding is permitted.
1052The forwarding specification must be one of the following forms:
1053.Pp
1054.Bl -item -offset indent -compact
1055.It
1056.Cm PermitOpen
1057.Sm off
1058.Ar host : port
1059.Sm on
1060.It
1061.Cm PermitOpen
1062.Sm off
1063.Ar IPv4_addr : port
1064.Sm on
1065.It
1066.Cm PermitOpen
1067.Sm off
1068.Ar \&[ IPv6_addr \&] : port
1069.Sm on
1070.El
1071.Pp
Damien Millera765cf42006-07-24 14:08:13 +10001072Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +10001073An argument of
1074.Dq any
1075can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +10001076An argument of
1077.Dq none
1078can be used to prohibit all forwarding requests.
Damien Miller65bc2c42006-07-24 14:04:16 +10001079By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001080.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +11001081Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +00001082.Xr ssh 1 .
1083The argument must be
1084.Dq yes ,
1085.Dq without-password ,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001086.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001087or
1088.Dq no .
1089The default is
1090.Dq yes .
1091.Pp
1092If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001093.Dq without-password ,
Darren Tucker9dca0992005-02-01 19:16:45 +11001094password authentication is disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001095.Pp
1096If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001097.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001098root login with public key authentication will be allowed,
1099but only if the
1100.Ar command
1101option has been specified
1102(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +10001103normally not allowed).
1104All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001105.Pp
1106If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001107.Dq no ,
Darren Tuckerb3509012005-01-20 11:01:46 +11001108root is not allowed to log in.
Damien Millerd27b9472005-12-13 19:29:02 +11001109.It Cm PermitTunnel
1110Specifies whether
1111.Xr tun 4
1112device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +11001113The argument must be
1114.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +10001115.Dq point-to-point
1116(layer 3),
1117.Dq ethernet
1118(layer 2), or
Damien Miller7b58e802005-12-13 19:33:19 +11001119.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +10001120Specifying
1121.Dq yes
1122permits both
1123.Dq point-to-point
1124and
1125.Dq ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +11001126The default is
1127.Dq no .
djm@openbsd.org48dffd52014-09-09 09:45:36 +00001128.Pp
1129Independent of this setting, the permissions of the selected
1130.Xr tun 4
1131device must allow access to the user.
Damien Miller5ff30c62013-10-30 22:21:50 +11001132.It Cm PermitTTY
1133Specifies whether
Damien Miller63857c92013-10-30 22:31:06 +11001134.Xr pty 4
Damien Miller5ff30c62013-10-30 22:21:50 +11001135allocation is permitted.
1136The default is
1137.Dq yes .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001138.It Cm PermitUserEnvironment
1139Specifies whether
1140.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001141and
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001142.Cm environment=
1143options in
1144.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001145are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +11001146.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001147The default is
1148.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001149Enabling environment processing may enable users to bypass access
1150restrictions in some configurations using mechanisms such as
1151.Ev LD_PRELOAD .
Damien Miller72e6b5c2014-07-04 09:00:04 +10001152.It Cm PermitUserRC
1153Specifies whether any
1154.Pa ~/.ssh/rc
1155file is executed.
1156The default is
1157.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001158.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +00001159Specifies the file that contains the process ID of the
Damien Millerf4f22b52006-03-15 11:57:25 +11001160SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001161The default is
1162.Pa /var/run/sshd.pid .
1163.It Cm Port
1164Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +11001165.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001166listens on.
1167The default is 22.
1168Multiple options of this type are permitted.
1169See also
1170.Cm ListenAddress .
1171.It Cm PrintLastLog
1172Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001173.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +11001174should print the date and time of the last user login when a user logs
1175in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001176The default is
1177.Dq yes .
1178.It Cm PrintMotd
1179Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001180.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001181should print
1182.Pa /etc/motd
1183when a user logs in interactively.
1184(On some systems it is also printed by the shell,
1185.Pa /etc/profile ,
1186or equivalent.)
1187The default is
1188.Dq yes .
1189.It Cm Protocol
1190Specifies the protocol versions
Damien Miller5b0d63f2006-03-15 11:56:56 +11001191.Xr sshd 8
Ben Lindstrom9c445542002-07-11 03:59:18 +00001192supports.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001193The possible values are
Damien Miller5b0d63f2006-03-15 11:56:56 +11001194.Sq 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001195and
Damien Miller5b0d63f2006-03-15 11:56:56 +11001196.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001197Multiple versions must be comma-separated.
1198The default is
Darren Tucker7a4a7652009-10-11 21:51:40 +11001199.Sq 2 .
Ben Lindstrom9c445542002-07-11 03:59:18 +00001200Note that the order of the protocol list does not indicate preference,
1201because the client selects among multiple protocol versions offered
1202by the server.
1203Specifying
1204.Dq 2,1
1205is identical to
1206.Dq 1,2 .
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001207.It Cm PubkeyAcceptedKeyTypes
1208Specifies the key types that will be accepted for public key authentication
1209as a comma-separated pattern list.
1210The default
1211.Dq *
1212will allow all key types.
1213The
1214.Fl Q
1215option of
1216.Xr ssh 1
1217may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001218.It Cm PubkeyAuthentication
1219Specifies whether public key authentication is allowed.
1220The default is
1221.Dq yes .
1222Note that this option applies to protocol version 2 only.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001223.It Cm RekeyLimit
1224Specifies the maximum amount of data that may be transmitted before the
1225session key is renegotiated, optionally followed a maximum amount of
1226time that may pass before the session key is renegotiated.
1227The first argument is specified in bytes and may have a suffix of
1228.Sq K ,
1229.Sq M ,
1230or
1231.Sq G
1232to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1233The default is between
1234.Sq 1G
1235and
1236.Sq 4G ,
1237depending on the cipher.
1238The optional second value is specified in seconds and may use any of the
1239units documented in the
1240.Sx TIME FORMATS
Darren Tucker64d22942013-05-16 20:31:29 +10001241section.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001242The default value for
1243.Cm RekeyLimit
1244is
1245.Dq default none ,
1246which means that rekeying is performed after the cipher's default amount
1247of data has been sent or received and no time based rekeying is done.
1248This option applies to protocol version 2 only.
Damien Miller1aed65e2010-03-04 21:53:35 +11001249.It Cm RevokedKeys
Damien Millerf3747bf2013-01-18 11:44:04 +11001250Specifies revoked public keys.
Damien Miller1aed65e2010-03-04 21:53:35 +11001251Keys listed in this file will be refused for public key authentication.
1252Note that if this file is not readable, then public key authentication will
1253be refused for all users.
Damien Millerf3747bf2013-01-18 11:44:04 +11001254Keys may be specified as a text file, listing one public key per line, or as
1255an OpenSSH Key Revocation List (KRL) as generated by
Damien Miller72abeb72013-01-20 22:33:44 +11001256.Xr ssh-keygen 1 .
Damien Millerfecfd112013-07-18 16:11:50 +10001257For more information on KRLs, see the KEY REVOCATION LISTS section in
Damien Millerf3747bf2013-01-18 11:44:04 +11001258.Xr ssh-keygen 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001259.It Cm RhostsRSAAuthentication
1260Specifies whether rhosts or /etc/hosts.equiv authentication together
1261with successful RSA host authentication is allowed.
1262The default is
1263.Dq no .
1264This option applies to protocol version 1 only.
1265.It Cm RSAAuthentication
1266Specifies whether pure RSA authentication is allowed.
1267The default is
1268.Dq yes .
1269This option applies to protocol version 1 only.
1270.It Cm ServerKeyBits
1271Defines the number of bits in the ephemeral protocol version 1 server key.
Darren Tucker7499b0c2008-07-02 22:35:43 +10001272The minimum value is 512, and the default is 1024.
Damien Miller7acefbb2014-07-18 14:11:24 +10001273.It Cm StreamLocalBindMask
1274Sets the octal file creation mode mask
1275.Pq umask
1276used when creating a Unix-domain socket file for local or remote
1277port forwarding.
1278This option is only used for port forwarding to a Unix-domain socket file.
1279.Pp
1280The default value is 0177, which creates a Unix-domain socket file that is
1281readable and writable only by the owner.
1282Note that not all operating systems honor the file mode on Unix-domain
1283socket files.
1284.It Cm StreamLocalBindUnlink
1285Specifies whether to remove an existing Unix-domain socket file for local
1286or remote port forwarding before creating a new one.
1287If the socket file already exists and
1288.Cm StreamLocalBindUnlink
1289is not enabled,
1290.Nm sshd
1291will be unable to forward the port to the Unix-domain socket file.
1292This option is only used for port forwarding to a Unix-domain socket file.
1293.Pp
1294The argument must be
1295.Dq yes
1296or
1297.Dq no .
1298The default is
1299.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001300.It Cm StrictModes
1301Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001302.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001303should check file modes and ownership of the
1304user's files and home directory before accepting login.
1305This is normally desirable because novices sometimes accidentally leave their
1306directory or files world-writable.
1307The default is
1308.Dq yes .
Darren Tuckerf788a912010-01-08 17:06:47 +11001309Note that this does not apply to
1310.Cm ChrootDirectory ,
1311whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001312.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +11001313Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +10001314Arguments should be a subsystem name and a command (with optional arguments)
1315to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001316.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001317The command
1318.Xr sftp-server 8
1319implements the
1320.Dq sftp
1321file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001322.Pp
1323Alternately the name
1324.Dq internal-sftp
1325implements an in-process
1326.Dq sftp
1327server.
1328This may simplify configurations using
1329.Cm ChrootDirectory
1330to force a different filesystem root on clients.
1331.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001332By default no subsystems are defined.
1333Note that this option applies to protocol version 2 only.
1334.It Cm SyslogFacility
1335Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001336.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001337The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1338LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1339The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001340.It Cm TCPKeepAlive
1341Specifies whether the system should send TCP keepalive messages to the
1342other side.
1343If they are sent, death of the connection or crash of one
1344of the machines will be properly noticed.
1345However, this means that
1346connections will die if the route is down temporarily, and some people
1347find it annoying.
1348On the other hand, if TCP keepalives are not sent,
1349sessions may hang indefinitely on the server, leaving
1350.Dq ghost
1351users and consuming server resources.
1352.Pp
1353The default is
1354.Dq yes
1355(to send TCP keepalive messages), and the server will notice
1356if the network goes down or the client host crashes.
1357This avoids infinitely hanging sessions.
1358.Pp
1359To disable TCP keepalive messages, the value should be set to
1360.Dq no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001361.It Cm TrustedUserCAKeys
1362Specifies a file containing public keys of certificate authorities that are
Damien Millerc6db99e2010-03-05 10:41:45 +11001363trusted to sign user certificates for authentication.
Damien Miller72b33822010-03-05 07:39:01 +11001364Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001365.Ql #
1366are allowed.
1367If a certificate is presented for authentication and has its signing CA key
1368listed in this file, then it may be used for authentication for any user
1369listed in the certificate's principals list.
1370Note that certificates that lack a list of principals will not be permitted
1371for authentication using
1372.Cm TrustedUserCAKeys .
Damien Millerfecfd112013-07-18 16:11:50 +10001373For more details on certificates, see the CERTIFICATES section in
Damien Miller1aed65e2010-03-04 21:53:35 +11001374.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001375.It Cm UseDNS
1376Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001377.Xr sshd 8
Darren Tucker83d5a982005-03-31 21:33:50 +10001378should look up the remote host name and check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001379the resolved host name for the remote IP address maps back to the
1380very same IP address.
1381The default is
1382.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001383.It Cm UseLogin
1384Specifies whether
1385.Xr login 1
1386is used for interactive login sessions.
1387The default is
1388.Dq no .
1389Note that
1390.Xr login 1
1391is never used for remote command execution.
1392Note also, that if this is enabled,
1393.Cm X11Forwarding
1394will be disabled because
1395.Xr login 1
1396does not know how to handle
1397.Xr xauth 1
Damien Miller495dca32003-04-01 21:42:14 +10001398cookies.
1399If
Ben Lindstrom9f049032002-06-21 00:59:05 +00001400.Cm UsePrivilegeSeparation
1401is specified, it will be disabled after authentication.
Damien Miller2e193e22003-05-14 15:13:03 +10001402.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001403Enables the Pluggable Authentication Module interface.
1404If set to
1405.Dq yes
1406this will enable PAM authentication using
1407.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001408and
1409.Cm PasswordAuthentication
1410in addition to PAM account and session module processing for all
1411authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001412.Pp
1413Because PAM challenge-response authentication usually serves an equivalent
1414role to password authentication, you should disable either
1415.Cm PasswordAuthentication
1416or
1417.Cm ChallengeResponseAuthentication.
1418.Pp
1419If
1420.Cm UsePAM
1421is enabled, you will not be able to run
1422.Xr sshd 8
1423as a non-root user.
1424The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +10001425.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001426.It Cm UsePrivilegeSeparation
1427Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001428.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001429separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +10001430to deal with incoming network traffic.
1431After successful authentication, another process will be created that has
1432the privilege of the authenticated user.
1433The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +00001434escalation by containing any corruption within the unprivileged processes.
1435The default is
1436.Dq yes .
Damien Miller69ff1df2011-06-23 08:30:03 +10001437If
1438.Cm UsePrivilegeSeparation
1439is set to
1440.Dq sandbox
1441then the pre-authentication unprivileged process is subject to additional
1442restrictions.
Damien Miller23528812012-04-22 11:24:43 +10001443.It Cm VersionAddendum
1444Optionally specifies additional text to append to the SSH protocol banner
1445sent by the server upon connection.
1446The default is
1447.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001448.It Cm X11DisplayOffset
1449Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001450.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001451X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001452This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001453The default is 10.
1454.It Cm X11Forwarding
1455Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001456The argument must be
1457.Dq yes
1458or
1459.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001460The default is
1461.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +10001462.Pp
1463When X11 forwarding is enabled, there may be additional exposure to
1464the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001465.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001466proxy display is configured to listen on the wildcard address (see
1467.Cm X11UseLocalhost
Damien Miller5b0d63f2006-03-15 11:56:56 +11001468below), though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001469Additionally, the authentication spoofing and authentication data
1470verification and substitution occur on the client side.
1471The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001472display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001473forwarding (see the warnings for
1474.Cm ForwardX11
1475in
Damien Millerf1ce5052003-06-11 22:04:39 +10001476.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001477A system administrator may have a stance in which they want to
1478protect clients that may expose themselves to attack by unwittingly
1479requesting X11 forwarding, which can warrant a
1480.Dq no
1481setting.
1482.Pp
1483Note that disabling X11 forwarding does not prevent users from
1484forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001485X11 forwarding is automatically disabled if
1486.Cm UseLogin
1487is enabled.
1488.It Cm X11UseLocalhost
1489Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001490.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001491should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001492the wildcard address.
1493By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001494sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001495hostname part of the
1496.Ev DISPLAY
1497environment variable to
1498.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001499This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001500However, some older X11 clients may not function with this
1501configuration.
1502.Cm X11UseLocalhost
1503may be set to
1504.Dq no
1505to specify that the forwarding server should be bound to the wildcard
1506address.
1507The argument must be
1508.Dq yes
1509or
1510.Dq no .
1511The default is
1512.Dq yes .
1513.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001514Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001515.Xr xauth 1
1516program.
1517The default is
1518.Pa /usr/X11R6/bin/xauth .
1519.El
Damien Millere3beba22006-03-15 11:59:25 +11001520.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001521.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001522command-line arguments and configuration file options that specify time
1523may be expressed using a sequence of the form:
1524.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001525.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001526.Sm on
1527where
1528.Ar time
1529is a positive integer value and
1530.Ar qualifier
1531is one of the following:
1532.Pp
1533.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001534.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001535seconds
1536.It Cm s | Cm S
1537seconds
1538.It Cm m | Cm M
1539minutes
1540.It Cm h | Cm H
1541hours
1542.It Cm d | Cm D
1543days
1544.It Cm w | Cm W
1545weeks
1546.El
1547.Pp
1548Each member of the sequence is added together to calculate
1549the total time value.
1550.Pp
1551Time format examples:
1552.Pp
1553.Bl -tag -width Ds -compact -offset indent
1554.It 600
1555600 seconds (10 minutes)
1556.It 10m
155710 minutes
1558.It 1h30m
15591 hour 30 minutes (90 minutes)
1560.El
1561.Sh FILES
1562.Bl -tag -width Ds
1563.It Pa /etc/ssh/sshd_config
1564Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001565.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001566This file should be writable by root only, but it is recommended
1567(though not necessary) that it be world-readable.
1568.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001569.Sh SEE ALSO
1570.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001571.Sh AUTHORS
1572OpenSSH is a derivative of the original and free
1573ssh 1.2.12 release by Tatu Ylonen.
1574Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1575Theo de Raadt and Dug Song
1576removed many bugs, re-added newer features and
1577created OpenSSH.
1578Markus Friedl contributed the support for SSH
1579protocol versions 1.5 and 2.0.
1580Niels Provos and Markus Friedl contributed support
1581for privilege separation.