blob: d2ab28136dffecda56057f0d1633e293cbe113ed [file] [log] [blame]
Ben Lindstrom9f049032002-06-21 00:59:05 +00001.\"
2.\" Author: Tatu Ylonen <ylo@cs.hut.fi>
3.\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
4.\" All rights reserved
5.\"
6.\" As far as I am concerned, the code I have written for this software
7.\" can be used freely for any purpose. Any derived versions of this
8.\" software must be clearly marked as such, and if the derived work is
9.\" incompatible with the protocol description in the RFC file, it must be
10.\" called by a name other than "ssh" or "Secure Shell".
11.\"
12.\" Copyright (c) 1999,2000 Markus Friedl. All rights reserved.
13.\" Copyright (c) 1999 Aaron Campbell. All rights reserved.
14.\" Copyright (c) 1999 Theo de Raadt. All rights reserved.
15.\"
16.\" Redistribution and use in source and binary forms, with or without
17.\" modification, are permitted provided that the following conditions
18.\" are met:
19.\" 1. Redistributions of source code must retain the above copyright
20.\" notice, this list of conditions and the following disclaimer.
21.\" 2. Redistributions in binary form must reproduce the above copyright
22.\" notice, this list of conditions and the following disclaimer in the
23.\" documentation and/or other materials provided with the distribution.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
26.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
27.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
28.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
29.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
30.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
31.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
32.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
34.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35.\"
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +000036.\" $OpenBSD: sshd_config.5,v 1.185 2014/12/22 07:51:30 djm Exp $
37.Dd $Mdocdate: December 22 2014 $
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
215method is listed more than one,
216.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.orgd663bea2014-12-11 05:25:06 +0000247If no user is specified then
248.Cm AuthorizedKeysCommand
249is ignored.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000250.It Cm AuthorizedKeysFile
251Specifies the file that contains the public keys that can be used
252for user authentication.
Damien Miller6018a362010-07-02 13:35:19 +1000253The format is described in the
Damien Millerfecfd112013-07-18 16:11:50 +1000254AUTHORIZED_KEYS FILE FORMAT
Damien Miller6018a362010-07-02 13:35:19 +1000255section of
256.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000257.Cm AuthorizedKeysFile
258may contain tokens of the form %T which are substituted during connection
Damien Miller5b0d63f2006-03-15 11:56:56 +1100259setup.
Damien Millerfbf486b2003-05-23 18:44:23 +1000260The following tokens are defined: %% is replaced by a literal '%',
Damien Miller5b0d63f2006-03-15 11:56:56 +1100261%h is replaced by the home directory of the user being authenticated, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000262%u is replaced by the username of that user.
263After expansion,
264.Cm AuthorizedKeysFile
265is taken to be an absolute path or one relative to the user's home
266directory.
Damien Millerb9132fc2011-05-29 21:41:40 +1000267Multiple files may be listed, separated by whitespace.
268The default is
269.Dq .ssh/authorized_keys .ssh/authorized_keys2 .
Damien Miller30da3442010-05-10 11:58:03 +1000270.It Cm AuthorizedPrincipalsFile
271Specifies a file that lists principal names that are accepted for
272certificate authentication.
273When using certificates signed by a key listed in
274.Cm TrustedUserCAKeys ,
275this file lists names, one of which must appear in the certificate for it
276to be accepted for authentication.
Damien Millerd59dab82010-07-02 13:37:17 +1000277Names are listed one per line preceded by key options (as described
Damien Millerfecfd112013-07-18 16:11:50 +1000278in AUTHORIZED_KEYS FILE FORMAT in
Damien Millerd59dab82010-07-02 13:37:17 +1000279.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000280Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000281.Ql #
282are ignored.
283.Pp
284.Cm AuthorizedPrincipalsFile
285may contain tokens of the form %T which are substituted during connection
286setup.
287The following tokens are defined: %% is replaced by a literal '%',
288%h is replaced by the home directory of the user being authenticated, and
289%u is replaced by the username of that user.
290After expansion,
291.Cm AuthorizedPrincipalsFile
292is taken to be an absolute path or one relative to the user's home
293directory.
294.Pp
Damien Miller8fef9eb2012-04-22 11:25:10 +1000295The default is
296.Dq none ,
297i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000298of the user must appear in a certificate's principals list for it to be
299accepted.
300Note that
301.Cm AuthorizedPrincipalsFile
302is only used when authentication proceeds using a CA listed in
303.Cm TrustedUserCAKeys
304and is not consulted for certification authorities trusted via
305.Pa ~/.ssh/authorized_keys ,
306though the
307.Cm principals=
308key option offers a similar facility (see
309.Xr sshd 8
310for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000311.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000312The contents of the specified file are sent to the remote user before
313authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000314If the argument is
315.Dq none
316then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000317This option is only available for protocol version 2.
318By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000319.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000320Specifies whether challenge-response authentication is allowed (e.g. via
Damien Millere8c9f262014-10-03 09:24:56 +1000321PAM or through authentication styles supported in
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000322.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000323The default is
324.Dq yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100325.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100326Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100327.Xr chroot 2
328to after authentication.
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100329All components of the pathname must be root-owned directories that are
Damien Millerd8cb1f12008-02-10 22:40:12 +1100330not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000331After the chroot,
332.Xr sshd 8
333changes the working directory to the user's home directory.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100334.Pp
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100335The pathname may contain the following tokens that are expanded at runtime once
Damien Millerd8cb1f12008-02-10 22:40:12 +1100336the connecting user has been authenticated: %% is replaced by a literal '%',
337%h is replaced by the home directory of the user being authenticated, and
338%u is replaced by the username of that user.
339.Pp
340The
341.Cm ChrootDirectory
342must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000343user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100344For an interactive session this requires at least a shell, typically
345.Xr sh 1 ,
346and basic
347.Pa /dev
348nodes such as
349.Xr null 4 ,
350.Xr zero 4 ,
351.Xr stdin 4 ,
352.Xr stdout 4 ,
353.Xr stderr 4 ,
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000354and
Damien Millerd8cb1f12008-02-10 22:40:12 +1100355.Xr tty 4
356devices.
357For file transfer sessions using
Darren Tuckerf92077f2009-06-21 17:56:25 +1000358.Dq sftp ,
Damien Millerd8cb1f12008-02-10 22:40:12 +1100359no additional configuration of the environment is necessary if the
Darren Tuckerf92077f2009-06-21 17:56:25 +1000360in-process sftp server is used,
Damien Miller426117b2014-07-30 12:33:20 +1000361though sessions which use logging may require
Darren Tucker00fcd712009-06-21 17:56:00 +1000362.Pa /dev/log
Damien Miller426117b2014-07-30 12:33:20 +1000363inside the chroot directory on some operating systems (see
Darren Tucker00fcd712009-06-21 17:56:00 +1000364.Xr sftp-server 8
365for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100366.Pp
367The default is not to
368.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000369.It Cm Ciphers
370Specifies the ciphers allowed for protocol version 2.
371Multiple ciphers must be comma-separated.
Damien Miller0fde8ac2013-11-21 14:12:23 +1100372The supported ciphers are:
373.Pp
Damien Millerc1621c82014-04-20 13:22:46 +1000374.Bl -item -compact -offset indent
375.It
3763des-cbc
377.It
378aes128-cbc
379.It
380aes192-cbc
381.It
382aes256-cbc
383.It
384aes128-ctr
385.It
386aes192-ctr
387.It
388aes256-ctr
389.It
390aes128-gcm@openssh.com
391.It
392aes256-gcm@openssh.com
393.It
394arcfour
395.It
396arcfour128
397.It
398arcfour256
399.It
400blowfish-cbc
401.It
402cast128-cbc
403.It
404chacha20-poly1305@openssh.com
405.El
Damien Miller0fde8ac2013-11-21 14:12:23 +1100406.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100407The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000408.Bd -literal -offset indent
409aes128-ctr,aes192-ctr,aes256-ctr,
Damien Miller1d75abf2013-01-09 16:12:19 +1100410aes128-gcm@openssh.com,aes256-gcm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000411chacha20-poly1305@openssh.com
Ben Lindstrom9f049032002-06-21 00:59:05 +0000412.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100413.Pp
414The list of available ciphers may also be obtained using the
415.Fl Q
416option of
417.Xr ssh 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000418.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100419Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000420sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100421.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000422receiving any messages back from the client.
423If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100424sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000425It is important to note that the use of client alive messages is very
426different from
Damien Miller12c150e2003-12-17 16:31:10 +1100427.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000428(below).
429The client alive messages are sent through the encrypted channel
430and therefore will not be spoofable.
431The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100432.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000433is spoofable.
434The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000435server depend on knowing when a connection has become inactive.
436.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000437The default value is 3.
438If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000439.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100440(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000441.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100442is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000443will be disconnected after approximately 45 seconds.
Damien Millercc3e8ba2006-03-15 12:06:55 +1100444This option applies to protocol version 2 only.
Damien Miller1594ad52005-05-26 12:12:19 +1000445.It Cm ClientAliveInterval
446Sets a timeout interval in seconds after which if no data has been received
447from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100448.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000449will send a message through the encrypted
450channel to request a response from the client.
451The default
452is 0, indicating that these messages will not be sent to the client.
453This option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000454.It Cm Compression
Damien Miller9786e6e2005-07-26 21:54:56 +1000455Specifies whether compression is allowed, or delayed until
456the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000457The argument must be
Damien Miller9786e6e2005-07-26 21:54:56 +1000458.Dq yes ,
459.Dq delayed ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000460or
461.Dq no .
462The default is
Damien Miller9786e6e2005-07-26 21:54:56 +1000463.Dq delayed .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000464.It Cm DenyGroups
465This keyword can be followed by a list of group name patterns, separated
466by spaces.
467Login is disallowed for users whose primary group or supplementary
468group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000469Only group names are valid; a numerical group ID is not recognized.
470By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100471The allow/deny directives are processed in the following order:
472.Cm DenyUsers ,
473.Cm AllowUsers ,
474.Cm DenyGroups ,
475and finally
476.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100477.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000478See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100479.Xr ssh_config 5
480for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000481.It Cm DenyUsers
482This keyword can be followed by a list of user name patterns, separated
483by spaces.
484Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000485Only user names are valid; a numerical user ID is not recognized.
486By default, login is allowed for all users.
487If the pattern takes the form USER@HOST then USER and HOST
488are separately checked, restricting logins to particular
489users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100490The allow/deny directives are processed in the following order:
491.Cm DenyUsers ,
492.Cm AllowUsers ,
493.Cm DenyGroups ,
494and finally
495.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100496.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000497See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100498.Xr ssh_config 5
499for more information on patterns.
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000500.It Cm FingerprintHash
501Specifies the hash algorithm used when logging key fingerprints.
502Valid options are:
503.Dq md5
504and
505.Dq sha256 .
506The default is
507.Dq sha256 .
Damien Millere2754432006-07-24 14:06:47 +1000508.It Cm ForceCommand
509Forces the execution of the command specified by
510.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100511ignoring any command supplied by the client and
512.Pa ~/.ssh/rc
513if present.
Damien Millere2754432006-07-24 14:06:47 +1000514The command is invoked by using the user's login shell with the -c option.
515This applies to shell, command, or subsystem execution.
516It is most useful inside a
517.Cm Match
518block.
519The command originally supplied by the client is available in the
520.Ev SSH_ORIGINAL_COMMAND
521environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100522Specifying a command of
523.Dq internal-sftp
524will force the use of an in-process sftp server that requires no support
525files when used with
526.Cm ChrootDirectory .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000527.It Cm GatewayPorts
528Specifies whether remote hosts are allowed to connect to ports
529forwarded for the client.
530By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100531.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000532binds remote port forwardings to the loopback address.
533This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000534.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100535can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100536should allow remote port forwardings to bind to non-loopback addresses, thus
537allowing other hosts to connect.
538The argument may be
539.Dq no
540to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000541.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100542to force remote port forwardings to bind to the wildcard address, or
543.Dq clientspecified
544to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000545The default is
546.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000547.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000548Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100549The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000550.Dq no .
551Note that this option applies to protocol version 2 only.
552.It Cm GSSAPICleanupCredentials
553Specifies whether to automatically destroy the user's credentials cache
554on logout.
555The default is
556.Dq yes .
557Note that this option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000558.It Cm HostbasedAuthentication
559Specifies whether rhosts or /etc/hosts.equiv authentication together
560with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100561(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000562This option is similar to
563.Cm RhostsRSAAuthentication
564and applies to protocol version 2 only.
565The default is
566.Dq no .
Damien Millerb594f382006-08-30 11:06:34 +1000567.It Cm HostbasedUsesNameFromPacketOnly
568Specifies whether or not the server will attempt to perform a reverse
569name lookup when matching the name in the
570.Pa ~/.shosts ,
571.Pa ~/.rhosts ,
572and
573.Pa /etc/hosts.equiv
574files during
575.Cm HostbasedAuthentication .
576A setting of
577.Dq yes
578means that
579.Xr sshd 8
580uses the name supplied by the client rather than
581attempting to resolve the name from the TCP connection itself.
582The default is
583.Dq no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100584.It Cm HostCertificate
585Specifies a file containing a public host certificate.
586The certificate's public key must match a private host key already specified
587by
588.Cm HostKey .
589The default behaviour of
590.Xr sshd 8
591is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000592.It Cm HostKey
593Specifies a file containing a private host key
594used by SSH.
595The default is
596.Pa /etc/ssh/ssh_host_key
597for protocol version 1, and
Damien Millereb8b60e2010-08-31 22:41:14 +1000598.Pa /etc/ssh/ssh_host_dsa_key ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100599.Pa /etc/ssh/ssh_host_ecdsa_key ,
600.Pa /etc/ssh/ssh_host_ed25519_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000601and
Damien Millereb8b60e2010-08-31 22:41:14 +1000602.Pa /etc/ssh/ssh_host_rsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000603for protocol version 2.
604Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100605.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000606will refuse to use a file if it is group/world-accessible.
607It is possible to have multiple host key files.
608.Dq rsa1
609keys are used for version 1 and
Damien Millereb8b60e2010-08-31 22:41:14 +1000610.Dq dsa ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100611.Dq ecdsa ,
612.Dq ed25519
Ben Lindstrom9f049032002-06-21 00:59:05 +0000613or
614.Dq rsa
615are used for version 2 of the SSH protocol.
Damien Miller85b45e02013-07-20 13:21:52 +1000616It is also possible to specify public host key files instead.
617In this case operations on the private key will be delegated
618to an
619.Xr ssh-agent 1 .
620.It Cm HostKeyAgent
621Identifies the UNIX-domain socket used to communicate
622with an agent that has access to the private host keys.
623If
624.Dq SSH_AUTH_SOCK
625is specified, the location of the socket will be read from the
626.Ev SSH_AUTH_SOCK
627environment variable.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000628.It Cm IgnoreRhosts
629Specifies that
630.Pa .rhosts
631and
632.Pa .shosts
633files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000634.Cm RhostsRSAAuthentication
635or
636.Cm HostbasedAuthentication .
637.Pp
638.Pa /etc/hosts.equiv
639and
640.Pa /etc/shosts.equiv
641are still used.
642The default is
643.Dq yes .
644.It Cm IgnoreUserKnownHosts
645Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100646.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000647should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000648.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000649during
650.Cm RhostsRSAAuthentication
651or
652.Cm HostbasedAuthentication .
653The default is
654.Dq no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100655.It Cm IPQoS
656Specifies the IPv4 type-of-service or DSCP class for the connection.
657Accepted values are
658.Dq af11 ,
659.Dq af12 ,
660.Dq af13 ,
Damien Millerf6e758c2011-09-22 21:37:13 +1000661.Dq af21 ,
Damien Miller0dac6fb2010-11-20 15:19:38 +1100662.Dq af22 ,
663.Dq af23 ,
664.Dq af31 ,
665.Dq af32 ,
666.Dq af33 ,
667.Dq af41 ,
668.Dq af42 ,
669.Dq af43 ,
670.Dq cs0 ,
671.Dq cs1 ,
672.Dq cs2 ,
673.Dq cs3 ,
674.Dq cs4 ,
675.Dq cs5 ,
676.Dq cs6 ,
677.Dq cs7 ,
678.Dq ef ,
679.Dq lowdelay ,
680.Dq throughput ,
681.Dq reliability ,
682or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +1100683This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100684If one argument is specified, it is used as the packet class unconditionally.
685If two values are specified, the first is automatically selected for
686interactive sessions and the second for non-interactive sessions.
687The default is
688.Dq lowdelay
689for interactive sessions and
690.Dq throughput
691for non-interactive sessions.
Damien Millere1e480a2014-02-04 11:13:17 +1100692.It Cm KbdInteractiveAuthentication
693Specifies whether to allow keyboard-interactive authentication.
694The argument to this keyword must be
695.Dq yes
696or
697.Dq no .
698The default is to use whatever value
699.Cm ChallengeResponseAuthentication
700is set to
701(by default
702.Dq yes ) .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000703.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000704Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000705.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000706will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000707To use this option, the server needs a
708Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100709The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000710.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100711.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000712If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100713an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100714The default is
Damien Miller8448e662004-03-08 23:13:15 +1100715.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000716.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100717If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000718the password will be validated via any additional local mechanism
719such as
720.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100721The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000722.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000723.It Cm KerberosTicketCleanup
724Specifies whether to automatically destroy the user's ticket cache
725file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100726The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000727.Dq yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000728.It Cm KexAlgorithms
729Specifies the available KEX (Key Exchange) algorithms.
730Multiple algorithms must be comma-separated.
Damien Millerc1621c82014-04-20 13:22:46 +1000731The supported algorithms are:
732.Pp
733.Bl -item -compact -offset indent
734.It
735curve25519-sha256@libssh.org
736.It
737diffie-hellman-group1-sha1
738.It
739diffie-hellman-group14-sha1
740.It
741diffie-hellman-group-exchange-sha1
742.It
743diffie-hellman-group-exchange-sha256
744.It
745ecdh-sha2-nistp256
746.It
747ecdh-sha2-nistp384
748.It
749ecdh-sha2-nistp521
750.El
751.Pp
752The default is:
Damien Miller6575c3a2013-12-18 17:47:02 +1100753.Bd -literal -offset indent
754curve25519-sha256@libssh.org,
755ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
756diffie-hellman-group-exchange-sha256,
Damien Millerc1621c82014-04-20 13:22:46 +1000757diffie-hellman-group14-sha1
Damien Miller6575c3a2013-12-18 17:47:02 +1100758.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +0000759.It Cm KeyRegenerationInterval
760In protocol version 1, the ephemeral server key is automatically regenerated
761after this many seconds (if it has been used).
762The purpose of regeneration is to prevent
763decrypting captured sessions by later breaking into the machine and
764stealing the keys.
765The key is never stored anywhere.
766If the value is 0, the key is never regenerated.
767The default is 3600 (seconds).
768.It Cm ListenAddress
769Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100770.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000771should listen on.
772The following forms may be used:
773.Pp
774.Bl -item -offset indent -compact
775.It
776.Cm ListenAddress
777.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000778.Ar host | Ar IPv4_addr | Ar IPv6_addr
Ben Lindstrom9f049032002-06-21 00:59:05 +0000779.Sm on
780.It
781.Cm ListenAddress
782.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000783.Ar host | Ar IPv4_addr : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000784.Sm on
785.It
786.Cm ListenAddress
787.Sm off
788.Oo
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000789.Ar host | Ar IPv6_addr Oc : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000790.Sm on
791.El
792.Pp
793If
794.Ar port
795is not specified,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100796sshd will listen on the address and all prior
Ben Lindstrom9f049032002-06-21 00:59:05 +0000797.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000798options specified.
799The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000800Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000801.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000802options are permitted.
803Additionally, any
Ben Lindstrom9f049032002-06-21 00:59:05 +0000804.Cm Port
Damien Miller5b0d63f2006-03-15 11:56:56 +1100805options must precede this option for non-port qualified addresses.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000806.It Cm LoginGraceTime
807The server disconnects after this time if the user has not
808successfully logged in.
809If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000810The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000811.It Cm LogLevel
812Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100813.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000814The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100815QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000816The default is INFO.
817DEBUG and DEBUG1 are equivalent.
818DEBUG2 and DEBUG3 each specify higher levels of debugging output.
819Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000820.It Cm MACs
821Specifies the available MAC (message authentication code) algorithms.
822The MAC algorithm is used in protocol version 2
823for data integrity protection.
824Multiple algorithms must be comma-separated.
Damien Milleraf43a7a2012-12-12 10:46:31 +1100825The algorithms that contain
826.Dq -etm
827calculate the MAC after encryption (encrypt-then-mac).
828These are considered safer and their use recommended.
Damien Millerc1621c82014-04-20 13:22:46 +1000829The supported MACs are:
830.Pp
831.Bl -item -compact -offset indent
832.It
833hmac-md5
834.It
835hmac-md5-96
836.It
837hmac-ripemd160
838.It
839hmac-sha1
840.It
841hmac-sha1-96
842.It
843hmac-sha2-256
844.It
845hmac-sha2-512
846.It
847umac-64@openssh.com
848.It
849umac-128@openssh.com
850.It
851hmac-md5-etm@openssh.com
852.It
853hmac-md5-96-etm@openssh.com
854.It
855hmac-ripemd160-etm@openssh.com
856.It
857hmac-sha1-etm@openssh.com
858.It
859hmac-sha1-96-etm@openssh.com
860.It
861hmac-sha2-256-etm@openssh.com
862.It
863hmac-sha2-512-etm@openssh.com
864.It
865umac-64-etm@openssh.com
866.It
867umac-128-etm@openssh.com
868.El
869.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100870The default is:
Damien Miller22b7b492007-06-11 14:07:12 +1000871.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +1100872umac-64-etm@openssh.com,umac-128-etm@openssh.com,
873hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000874umac-64@openssh.com,umac-128@openssh.com,
875hmac-sha2-256,hmac-sha2-512
Damien Miller22b7b492007-06-11 14:07:12 +1000876.Ed
Darren Tucker45150472006-07-12 22:34:17 +1000877.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +1000878Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +1000879If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +1000880.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000881line are satisfied, the keywords on the following lines override those
882set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +1000883.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000884line or the end of the file.
Damien Millerfc5d6752014-02-28 10:01:28 +1100885If a keyword appears in multiple
886.Cm Match
sobrado@openbsd.org180bcb42014-08-30 16:32:25 +0000887blocks that are satisfied, only the first instance of the keyword is
Damien Millerfc5d6752014-02-28 10:01:28 +1100888applied.
Darren Tucker7a3935d2008-06-10 22:59:10 +1000889.Pp
Damien Millerd04f3572006-07-24 13:46:50 +1000890The arguments to
Darren Tucker45150472006-07-12 22:34:17 +1000891.Cm Match
Damien Millercf31f382013-10-24 21:02:56 +1100892are one or more criteria-pattern pairs or the single token
893.Cm All
894which matches all criteria.
Darren Tucker45150472006-07-12 22:34:17 +1000895The available criteria are
896.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +1000897.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +1000898.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +1000899.Cm LocalAddress ,
900.Cm LocalPort ,
Darren Tucker45150472006-07-12 22:34:17 +1000901and
902.Cm Address .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000903The match patterns may consist of single entries or comma-separated
904lists and may use the wildcard and negation operators described in the
Damien Millerfecfd112013-07-18 16:11:50 +1000905PATTERNS section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +1000906.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000907.Pp
908The patterns in an
909.Cm Address
910criteria may additionally contain addresses to match in CIDR
Darren Tucker6a2a4002008-06-10 23:03:04 +1000911address/masklen format, e.g.\&
Darren Tucker7a3935d2008-06-10 22:59:10 +1000912.Dq 192.0.2.0/24
913or
914.Dq 3ffe:ffff::/32 .
915Note that the mask length provided must be consistent with the address -
916it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +1000917or one with bits set in this host portion of the address.
918For example,
Darren Tucker7a3935d2008-06-10 22:59:10 +1000919.Dq 192.0.2.0/33
920and
Darren Tucker6a2a4002008-06-10 23:03:04 +1000921.Dq 192.0.2.0/8
Darren Tucker7a3935d2008-06-10 22:59:10 +1000922respectively.
923.Pp
Darren Tucker45150472006-07-12 22:34:17 +1000924Only a subset of keywords may be used on the lines following a
925.Cm Match
926keyword.
927Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +1000928.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +1100929.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +1000930.Cm AllowGroups ,
Damien Miller9b439df2006-07-24 14:04:00 +1000931.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +1000932.Cm AllowUsers ,
Damien Millera6e3f012012-11-04 23:21:40 +1100933.Cm AuthenticationMethods ,
Damien Miller09d3e122012-10-31 08:58:58 +1100934.Cm AuthorizedKeysCommand ,
935.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +1100936.Cm AuthorizedKeysFile ,
Damien Millerab6de352010-06-26 09:38:45 +1000937.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +1100938.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +1000939.Cm ChrootDirectory ,
Damien Millerc24da772012-06-20 21:53:58 +1000940.Cm DenyGroups ,
941.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +1000942.Cm ForceCommand ,
Damien Millerc24da772012-06-20 21:53:58 +1000943.Cm GatewayPorts ,
Damien Millerf8268502012-06-20 21:54:15 +1000944.Cm GSSAPIAuthentication ,
Damien Miller25434de2008-05-19 14:29:08 +1000945.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +1000946.Cm HostbasedUsesNameFromPacketOnly ,
Darren Tucker1d75f222007-03-01 21:31:28 +1100947.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +1100948.Cm KerberosAuthentication ,
Damien Miller307c1d12008-06-16 07:56:20 +1000949.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +1000950.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +1100951.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +1100952.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +1000953.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +1100954.Cm PermitRootLogin ,
Damien Miller5ff30c62013-10-30 22:21:50 +1100955.Cm PermitTTY ,
Damien Millerab6de352010-06-26 09:38:45 +1000956.Cm PermitTunnel ,
Damien Miller72e6b5c2014-07-04 09:00:04 +1000957.Cm PermitUserRC ,
Darren Tucker1477ea12009-10-07 08:36:05 +1100958.Cm PubkeyAuthentication ,
Darren Tucker5f96f3b2013-05-16 20:29:28 +1000959.Cm RekeyLimit ,
Damien Millerc24da772012-06-20 21:53:58 +1000960.Cm RhostsRSAAuthentication ,
Damien Millerf8268502012-06-20 21:54:15 +1000961.Cm RSAAuthentication ,
Damien Millerd1de9952006-07-24 14:05:48 +1000962.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +1100963.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +1000964and
Damien Miller0296ae82009-02-23 11:00:24 +1100965.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +1000966.It Cm MaxAuthTries
967Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +1000968connection.
969Once the number of failures reaches half this value,
970additional failures are logged.
971The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +1000972.It Cm MaxSessions
973Specifies the maximum number of open sessions permitted per network connection.
974The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000975.It Cm MaxStartups
976Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +1100977SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000978Additional connections will be dropped until authentication succeeds or the
979.Cm LoginGraceTime
980expires for a connection.
Damien Miller1f583df2013-02-12 11:02:08 +1100981The default is 10:30:100.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000982.Pp
983Alternatively, random early drop can be enabled by specifying
984the three colon separated values
985.Dq start:rate:full
Damien Miller208f1ed2006-03-15 11:56:03 +1100986(e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +1100987.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000988will refuse connection attempts with a probability of
989.Dq rate/100
990(30%)
991if there are currently
992.Dq start
993(10)
994unauthenticated connections.
995The probability increases linearly and all connection attempts
996are refused if the number of unauthenticated connections reaches
997.Dq full
998(60).
999.It Cm PasswordAuthentication
1000Specifies whether password authentication is allowed.
1001The default is
1002.Dq yes .
1003.It Cm PermitEmptyPasswords
1004When password authentication is allowed, it specifies whether the
1005server allows login to accounts with empty password strings.
1006The default is
1007.Dq no .
Damien Miller9b439df2006-07-24 14:04:00 +10001008.It Cm PermitOpen
1009Specifies the destinations to which TCP port forwarding is permitted.
1010The forwarding specification must be one of the following forms:
1011.Pp
1012.Bl -item -offset indent -compact
1013.It
1014.Cm PermitOpen
1015.Sm off
1016.Ar host : port
1017.Sm on
1018.It
1019.Cm PermitOpen
1020.Sm off
1021.Ar IPv4_addr : port
1022.Sm on
1023.It
1024.Cm PermitOpen
1025.Sm off
1026.Ar \&[ IPv6_addr \&] : port
1027.Sm on
1028.El
1029.Pp
Damien Millera765cf42006-07-24 14:08:13 +10001030Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +10001031An argument of
1032.Dq any
1033can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +10001034An argument of
1035.Dq none
1036can be used to prohibit all forwarding requests.
Damien Miller65bc2c42006-07-24 14:04:16 +10001037By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001038.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +11001039Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +00001040.Xr ssh 1 .
1041The argument must be
1042.Dq yes ,
1043.Dq without-password ,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001044.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001045or
1046.Dq no .
1047The default is
1048.Dq yes .
1049.Pp
1050If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001051.Dq without-password ,
Darren Tucker9dca0992005-02-01 19:16:45 +11001052password authentication is disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001053.Pp
1054If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001055.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001056root login with public key authentication will be allowed,
1057but only if the
1058.Ar command
1059option has been specified
1060(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +10001061normally not allowed).
1062All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001063.Pp
1064If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001065.Dq no ,
Darren Tuckerb3509012005-01-20 11:01:46 +11001066root is not allowed to log in.
Damien Millerd27b9472005-12-13 19:29:02 +11001067.It Cm PermitTunnel
1068Specifies whether
1069.Xr tun 4
1070device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +11001071The argument must be
1072.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +10001073.Dq point-to-point
1074(layer 3),
1075.Dq ethernet
1076(layer 2), or
Damien Miller7b58e802005-12-13 19:33:19 +11001077.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +10001078Specifying
1079.Dq yes
1080permits both
1081.Dq point-to-point
1082and
1083.Dq ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +11001084The default is
1085.Dq no .
djm@openbsd.org48dffd52014-09-09 09:45:36 +00001086.Pp
1087Independent of this setting, the permissions of the selected
1088.Xr tun 4
1089device must allow access to the user.
Damien Miller5ff30c62013-10-30 22:21:50 +11001090.It Cm PermitTTY
1091Specifies whether
Damien Miller63857c92013-10-30 22:31:06 +11001092.Xr pty 4
Damien Miller5ff30c62013-10-30 22:21:50 +11001093allocation is permitted.
1094The default is
1095.Dq yes .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001096.It Cm PermitUserEnvironment
1097Specifies whether
1098.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001099and
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001100.Cm environment=
1101options in
1102.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001103are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +11001104.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001105The default is
1106.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001107Enabling environment processing may enable users to bypass access
1108restrictions in some configurations using mechanisms such as
1109.Ev LD_PRELOAD .
Damien Miller72e6b5c2014-07-04 09:00:04 +10001110.It Cm PermitUserRC
1111Specifies whether any
1112.Pa ~/.ssh/rc
1113file is executed.
1114The default is
1115.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001116.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +00001117Specifies the file that contains the process ID of the
Damien Millerf4f22b52006-03-15 11:57:25 +11001118SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001119The default is
1120.Pa /var/run/sshd.pid .
1121.It Cm Port
1122Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +11001123.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001124listens on.
1125The default is 22.
1126Multiple options of this type are permitted.
1127See also
1128.Cm ListenAddress .
1129.It Cm PrintLastLog
1130Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001131.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +11001132should print the date and time of the last user login when a user logs
1133in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001134The default is
1135.Dq yes .
1136.It Cm PrintMotd
1137Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001138.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001139should print
1140.Pa /etc/motd
1141when a user logs in interactively.
1142(On some systems it is also printed by the shell,
1143.Pa /etc/profile ,
1144or equivalent.)
1145The default is
1146.Dq yes .
1147.It Cm Protocol
1148Specifies the protocol versions
Damien Miller5b0d63f2006-03-15 11:56:56 +11001149.Xr sshd 8
Ben Lindstrom9c445542002-07-11 03:59:18 +00001150supports.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001151The possible values are
Damien Miller5b0d63f2006-03-15 11:56:56 +11001152.Sq 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001153and
Damien Miller5b0d63f2006-03-15 11:56:56 +11001154.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001155Multiple versions must be comma-separated.
1156The default is
Darren Tucker7a4a7652009-10-11 21:51:40 +11001157.Sq 2 .
Ben Lindstrom9c445542002-07-11 03:59:18 +00001158Note that the order of the protocol list does not indicate preference,
1159because the client selects among multiple protocol versions offered
1160by the server.
1161Specifying
1162.Dq 2,1
1163is identical to
1164.Dq 1,2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001165.It Cm PubkeyAuthentication
1166Specifies whether public key authentication is allowed.
1167The default is
1168.Dq yes .
1169Note that this option applies to protocol version 2 only.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001170.It Cm RekeyLimit
1171Specifies the maximum amount of data that may be transmitted before the
1172session key is renegotiated, optionally followed a maximum amount of
1173time that may pass before the session key is renegotiated.
1174The first argument is specified in bytes and may have a suffix of
1175.Sq K ,
1176.Sq M ,
1177or
1178.Sq G
1179to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1180The default is between
1181.Sq 1G
1182and
1183.Sq 4G ,
1184depending on the cipher.
1185The optional second value is specified in seconds and may use any of the
1186units documented in the
1187.Sx TIME FORMATS
Darren Tucker64d22942013-05-16 20:31:29 +10001188section.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001189The default value for
1190.Cm RekeyLimit
1191is
1192.Dq default none ,
1193which means that rekeying is performed after the cipher's default amount
1194of data has been sent or received and no time based rekeying is done.
1195This option applies to protocol version 2 only.
Damien Miller1aed65e2010-03-04 21:53:35 +11001196.It Cm RevokedKeys
Damien Millerf3747bf2013-01-18 11:44:04 +11001197Specifies revoked public keys.
Damien Miller1aed65e2010-03-04 21:53:35 +11001198Keys listed in this file will be refused for public key authentication.
1199Note that if this file is not readable, then public key authentication will
1200be refused for all users.
Damien Millerf3747bf2013-01-18 11:44:04 +11001201Keys may be specified as a text file, listing one public key per line, or as
1202an OpenSSH Key Revocation List (KRL) as generated by
Damien Miller72abeb72013-01-20 22:33:44 +11001203.Xr ssh-keygen 1 .
Damien Millerfecfd112013-07-18 16:11:50 +10001204For more information on KRLs, see the KEY REVOCATION LISTS section in
Damien Millerf3747bf2013-01-18 11:44:04 +11001205.Xr ssh-keygen 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001206.It Cm RhostsRSAAuthentication
1207Specifies whether rhosts or /etc/hosts.equiv authentication together
1208with successful RSA host authentication is allowed.
1209The default is
1210.Dq no .
1211This option applies to protocol version 1 only.
1212.It Cm RSAAuthentication
1213Specifies whether pure RSA authentication is allowed.
1214The default is
1215.Dq yes .
1216This option applies to protocol version 1 only.
1217.It Cm ServerKeyBits
1218Defines the number of bits in the ephemeral protocol version 1 server key.
Darren Tucker7499b0c2008-07-02 22:35:43 +10001219The minimum value is 512, and the default is 1024.
Damien Miller7acefbb2014-07-18 14:11:24 +10001220.It Cm StreamLocalBindMask
1221Sets the octal file creation mode mask
1222.Pq umask
1223used when creating a Unix-domain socket file for local or remote
1224port forwarding.
1225This option is only used for port forwarding to a Unix-domain socket file.
1226.Pp
1227The default value is 0177, which creates a Unix-domain socket file that is
1228readable and writable only by the owner.
1229Note that not all operating systems honor the file mode on Unix-domain
1230socket files.
1231.It Cm StreamLocalBindUnlink
1232Specifies whether to remove an existing Unix-domain socket file for local
1233or remote port forwarding before creating a new one.
1234If the socket file already exists and
1235.Cm StreamLocalBindUnlink
1236is not enabled,
1237.Nm sshd
1238will be unable to forward the port to the Unix-domain socket file.
1239This option is only used for port forwarding to a Unix-domain socket file.
1240.Pp
1241The argument must be
1242.Dq yes
1243or
1244.Dq no .
1245The default is
1246.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001247.It Cm StrictModes
1248Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001249.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001250should check file modes and ownership of the
1251user's files and home directory before accepting login.
1252This is normally desirable because novices sometimes accidentally leave their
1253directory or files world-writable.
1254The default is
1255.Dq yes .
Darren Tuckerf788a912010-01-08 17:06:47 +11001256Note that this does not apply to
1257.Cm ChrootDirectory ,
1258whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001259.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +11001260Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +10001261Arguments should be a subsystem name and a command (with optional arguments)
1262to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001263.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001264The command
1265.Xr sftp-server 8
1266implements the
1267.Dq sftp
1268file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001269.Pp
1270Alternately the name
1271.Dq internal-sftp
1272implements an in-process
1273.Dq sftp
1274server.
1275This may simplify configurations using
1276.Cm ChrootDirectory
1277to force a different filesystem root on clients.
1278.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001279By default no subsystems are defined.
1280Note that this option applies to protocol version 2 only.
1281.It Cm SyslogFacility
1282Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001283.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001284The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1285LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1286The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001287.It Cm TCPKeepAlive
1288Specifies whether the system should send TCP keepalive messages to the
1289other side.
1290If they are sent, death of the connection or crash of one
1291of the machines will be properly noticed.
1292However, this means that
1293connections will die if the route is down temporarily, and some people
1294find it annoying.
1295On the other hand, if TCP keepalives are not sent,
1296sessions may hang indefinitely on the server, leaving
1297.Dq ghost
1298users and consuming server resources.
1299.Pp
1300The default is
1301.Dq yes
1302(to send TCP keepalive messages), and the server will notice
1303if the network goes down or the client host crashes.
1304This avoids infinitely hanging sessions.
1305.Pp
1306To disable TCP keepalive messages, the value should be set to
1307.Dq no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001308.It Cm TrustedUserCAKeys
1309Specifies a file containing public keys of certificate authorities that are
Damien Millerc6db99e2010-03-05 10:41:45 +11001310trusted to sign user certificates for authentication.
Damien Miller72b33822010-03-05 07:39:01 +11001311Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001312.Ql #
1313are allowed.
1314If a certificate is presented for authentication and has its signing CA key
1315listed in this file, then it may be used for authentication for any user
1316listed in the certificate's principals list.
1317Note that certificates that lack a list of principals will not be permitted
1318for authentication using
1319.Cm TrustedUserCAKeys .
Damien Millerfecfd112013-07-18 16:11:50 +10001320For more details on certificates, see the CERTIFICATES section in
Damien Miller1aed65e2010-03-04 21:53:35 +11001321.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001322.It Cm UseDNS
1323Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001324.Xr sshd 8
Darren Tucker83d5a982005-03-31 21:33:50 +10001325should look up the remote host name and check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001326the resolved host name for the remote IP address maps back to the
1327very same IP address.
1328The default is
1329.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001330.It Cm UseLogin
1331Specifies whether
1332.Xr login 1
1333is used for interactive login sessions.
1334The default is
1335.Dq no .
1336Note that
1337.Xr login 1
1338is never used for remote command execution.
1339Note also, that if this is enabled,
1340.Cm X11Forwarding
1341will be disabled because
1342.Xr login 1
1343does not know how to handle
1344.Xr xauth 1
Damien Miller495dca32003-04-01 21:42:14 +10001345cookies.
1346If
Ben Lindstrom9f049032002-06-21 00:59:05 +00001347.Cm UsePrivilegeSeparation
1348is specified, it will be disabled after authentication.
Damien Miller2e193e22003-05-14 15:13:03 +10001349.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001350Enables the Pluggable Authentication Module interface.
1351If set to
1352.Dq yes
1353this will enable PAM authentication using
1354.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001355and
1356.Cm PasswordAuthentication
1357in addition to PAM account and session module processing for all
1358authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001359.Pp
1360Because PAM challenge-response authentication usually serves an equivalent
1361role to password authentication, you should disable either
1362.Cm PasswordAuthentication
1363or
1364.Cm ChallengeResponseAuthentication.
1365.Pp
1366If
1367.Cm UsePAM
1368is enabled, you will not be able to run
1369.Xr sshd 8
1370as a non-root user.
1371The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +10001372.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001373.It Cm UsePrivilegeSeparation
1374Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001375.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001376separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +10001377to deal with incoming network traffic.
1378After successful authentication, another process will be created that has
1379the privilege of the authenticated user.
1380The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +00001381escalation by containing any corruption within the unprivileged processes.
1382The default is
1383.Dq yes .
Damien Miller69ff1df2011-06-23 08:30:03 +10001384If
1385.Cm UsePrivilegeSeparation
1386is set to
1387.Dq sandbox
1388then the pre-authentication unprivileged process is subject to additional
1389restrictions.
Damien Miller23528812012-04-22 11:24:43 +10001390.It Cm VersionAddendum
1391Optionally specifies additional text to append to the SSH protocol banner
1392sent by the server upon connection.
1393The default is
1394.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001395.It Cm X11DisplayOffset
1396Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001397.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001398X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001399This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001400The default is 10.
1401.It Cm X11Forwarding
1402Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001403The argument must be
1404.Dq yes
1405or
1406.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001407The default is
1408.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +10001409.Pp
1410When X11 forwarding is enabled, there may be additional exposure to
1411the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001412.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001413proxy display is configured to listen on the wildcard address (see
1414.Cm X11UseLocalhost
Damien Miller5b0d63f2006-03-15 11:56:56 +11001415below), though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001416Additionally, the authentication spoofing and authentication data
1417verification and substitution occur on the client side.
1418The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001419display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001420forwarding (see the warnings for
1421.Cm ForwardX11
1422in
Damien Millerf1ce5052003-06-11 22:04:39 +10001423.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001424A system administrator may have a stance in which they want to
1425protect clients that may expose themselves to attack by unwittingly
1426requesting X11 forwarding, which can warrant a
1427.Dq no
1428setting.
1429.Pp
1430Note that disabling X11 forwarding does not prevent users from
1431forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001432X11 forwarding is automatically disabled if
1433.Cm UseLogin
1434is enabled.
1435.It Cm X11UseLocalhost
1436Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001437.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001438should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001439the wildcard address.
1440By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001441sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001442hostname part of the
1443.Ev DISPLAY
1444environment variable to
1445.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001446This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001447However, some older X11 clients may not function with this
1448configuration.
1449.Cm X11UseLocalhost
1450may be set to
1451.Dq no
1452to specify that the forwarding server should be bound to the wildcard
1453address.
1454The argument must be
1455.Dq yes
1456or
1457.Dq no .
1458The default is
1459.Dq yes .
1460.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001461Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001462.Xr xauth 1
1463program.
1464The default is
1465.Pa /usr/X11R6/bin/xauth .
1466.El
Damien Millere3beba22006-03-15 11:59:25 +11001467.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001468.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001469command-line arguments and configuration file options that specify time
1470may be expressed using a sequence of the form:
1471.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001472.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001473.Sm on
1474where
1475.Ar time
1476is a positive integer value and
1477.Ar qualifier
1478is one of the following:
1479.Pp
1480.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001481.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001482seconds
1483.It Cm s | Cm S
1484seconds
1485.It Cm m | Cm M
1486minutes
1487.It Cm h | Cm H
1488hours
1489.It Cm d | Cm D
1490days
1491.It Cm w | Cm W
1492weeks
1493.El
1494.Pp
1495Each member of the sequence is added together to calculate
1496the total time value.
1497.Pp
1498Time format examples:
1499.Pp
1500.Bl -tag -width Ds -compact -offset indent
1501.It 600
1502600 seconds (10 minutes)
1503.It 10m
150410 minutes
1505.It 1h30m
15061 hour 30 minutes (90 minutes)
1507.El
1508.Sh FILES
1509.Bl -tag -width Ds
1510.It Pa /etc/ssh/sshd_config
1511Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001512.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001513This file should be writable by root only, but it is recommended
1514(though not necessary) that it be world-readable.
1515.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001516.Sh SEE ALSO
1517.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001518.Sh AUTHORS
1519OpenSSH is a derivative of the original and free
1520ssh 1.2.12 release by Tatu Ylonen.
1521Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1522Theo de Raadt and Dug Song
1523removed many bugs, re-added newer features and
1524created OpenSSH.
1525Markus Friedl contributed the support for SSH
1526protocol versions 1.5 and 2.0.
1527Niels Provos and Markus Friedl contributed support
1528for privilege separation.