blob: 05f3374fbb9905dcf1822bc4795fbef500a1ca46 [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.\"
Damien Millera6e3f012012-11-04 23:21:40 +110036.\" $OpenBSD: sshd_config.5,v 1.149 2012/11/04 11:09:15 djm Exp $
Damien Millerd0d10992012-11-04 22:23:14 +110037.Dd $Mdocdate: November 4 2012 $
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
120See
121.Sx PATTERNS
122in
123.Xr ssh_config 5
124for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000125.It Cm AllowTcpForwarding
126Specifies whether TCP forwarding is permitted.
127The default is
128.Dq yes .
129Note that disabling TCP forwarding does not improve security unless
130users are also denied shell access, as they can always install their
131own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000132.It Cm AllowUsers
133This keyword can be followed by a list of user name patterns, separated
134by spaces.
Damien Miller5a93add2003-01-24 11:34:52 +1100135If specified, login is allowed only for user names that
Ben Lindstrom9f049032002-06-21 00:59:05 +0000136match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000137Only user names are valid; a numerical user ID is not recognized.
138By default, login is allowed for all users.
139If the pattern takes the form USER@HOST then USER and HOST
140are separately checked, restricting logins to particular
141users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100142The allow/deny directives are processed in the following order:
143.Cm DenyUsers ,
144.Cm AllowUsers ,
145.Cm DenyGroups ,
146and finally
147.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100148.Pp
149See
150.Sx PATTERNS
151in
152.Xr ssh_config 5
153for more information on patterns.
Damien Millera6e3f012012-11-04 23:21:40 +1100154.It Cm AuthenticationMethods
155Specifies the authentication methods that must be successfully completed
156for a user to be granted access.
157This option must be followed by one or more comma-separated lists of
158authentication method names.
159Successful authentication requires completion of every method in at least
160one of these lists.
161.Pp
162For example, an argument of
163.Dq publickey,password publickey,keyboard-interactive
164would require the user to complete public key authentication, followed by
165either password or keyboard interactive authentication.
166Only methods that are next in one or more lists are offered at each stage,
167so for this example, it would not be possible to attempt password or
168keyboard-interactive authentication before public key.
169.Pp
170This option is only available for SSH protocol 2 and will yield a fatal
171error if enabled if protocol 1 is also enabled.
172Note that each authentication method listed should also be explicitly enabled
173in the configuration.
174The default is not to require multiple authentication; successful completion
175of a single authentication method is sufficient.
Damien Miller09d3e122012-10-31 08:58:58 +1100176.It Cm AuthorizedKeysCommand
Damien Millerf33580e2012-11-04 22:22:52 +1100177Specifies a program to be used to look up the user's public keys.
Damien Miller09d3e122012-10-31 08:58:58 +1100178The program will be invoked with a single argument of the username
179being authenticated, and should produce on standard output zero or
Damien Millerf33580e2012-11-04 22:22:52 +1100180more lines of authorized_keys output (see
181.Sx AUTHORIZED_KEYS
182in
183.Xr sshd 8 ) .
Damien Miller09d3e122012-10-31 08:58:58 +1100184If a key supplied by AuthorizedKeysCommand does not successfully authenticate
185and authorize the user then public key authentication continues using the usual
186.Cm AuthorizedKeysFile
187files.
188By default, no AuthorizedKeysCommand is run.
189.It Cm AuthorizedKeysCommandUser
190Specifies the user under whose account the AuthorizedKeysCommand is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100191It is recommended to use a dedicated user that has no other role on the host
192than running authorized keys commands.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000193.It Cm AuthorizedKeysFile
194Specifies the file that contains the public keys that can be used
195for user authentication.
Damien Miller6018a362010-07-02 13:35:19 +1000196The format is described in the
197.Sx AUTHORIZED_KEYS FILE FORMAT
198section of
199.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000200.Cm AuthorizedKeysFile
201may contain tokens of the form %T which are substituted during connection
Damien Miller5b0d63f2006-03-15 11:56:56 +1100202setup.
Damien Millerfbf486b2003-05-23 18:44:23 +1000203The following tokens are defined: %% is replaced by a literal '%',
Damien Miller5b0d63f2006-03-15 11:56:56 +1100204%h is replaced by the home directory of the user being authenticated, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000205%u is replaced by the username of that user.
206After expansion,
207.Cm AuthorizedKeysFile
208is taken to be an absolute path or one relative to the user's home
209directory.
Damien Millerb9132fc2011-05-29 21:41:40 +1000210Multiple files may be listed, separated by whitespace.
211The default is
212.Dq .ssh/authorized_keys .ssh/authorized_keys2 .
Damien Miller30da3442010-05-10 11:58:03 +1000213.It Cm AuthorizedPrincipalsFile
214Specifies a file that lists principal names that are accepted for
215certificate authentication.
216When using certificates signed by a key listed in
217.Cm TrustedUserCAKeys ,
218this file lists names, one of which must appear in the certificate for it
219to be accepted for authentication.
Damien Millerd59dab82010-07-02 13:37:17 +1000220Names are listed one per line preceded by key options (as described
Damien Miller6018a362010-07-02 13:35:19 +1000221in
222.Sx AUTHORIZED_KEYS FILE FORMAT
223in
Damien Millerd59dab82010-07-02 13:37:17 +1000224.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000225Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000226.Ql #
227are ignored.
228.Pp
229.Cm AuthorizedPrincipalsFile
230may contain tokens of the form %T which are substituted during connection
231setup.
232The following tokens are defined: %% is replaced by a literal '%',
233%h is replaced by the home directory of the user being authenticated, and
234%u is replaced by the username of that user.
235After expansion,
236.Cm AuthorizedPrincipalsFile
237is taken to be an absolute path or one relative to the user's home
238directory.
239.Pp
Damien Miller8fef9eb2012-04-22 11:25:10 +1000240The default is
241.Dq none ,
242i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000243of the user must appear in a certificate's principals list for it to be
244accepted.
245Note that
246.Cm AuthorizedPrincipalsFile
247is only used when authentication proceeds using a CA listed in
248.Cm TrustedUserCAKeys
249and is not consulted for certification authorities trusted via
250.Pa ~/.ssh/authorized_keys ,
251though the
252.Cm principals=
253key option offers a similar facility (see
254.Xr sshd 8
255for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000256.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000257The contents of the specified file are sent to the remote user before
258authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000259If the argument is
260.Dq none
261then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000262This option is only available for protocol version 2.
263By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000264.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000265Specifies whether challenge-response authentication is allowed (e.g. via
266PAM or though authentication styles supported in
267.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000268The default is
269.Dq yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100270.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100271Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100272.Xr chroot 2
273to after authentication.
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100274All components of the pathname must be root-owned directories that are
Damien Millerd8cb1f12008-02-10 22:40:12 +1100275not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000276After the chroot,
277.Xr sshd 8
278changes the working directory to the user's home directory.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100279.Pp
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100280The pathname may contain the following tokens that are expanded at runtime once
Damien Millerd8cb1f12008-02-10 22:40:12 +1100281the connecting user has been authenticated: %% is replaced by a literal '%',
282%h is replaced by the home directory of the user being authenticated, and
283%u is replaced by the username of that user.
284.Pp
285The
286.Cm ChrootDirectory
287must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000288user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100289For an interactive session this requires at least a shell, typically
290.Xr sh 1 ,
291and basic
292.Pa /dev
293nodes such as
294.Xr null 4 ,
295.Xr zero 4 ,
296.Xr stdin 4 ,
297.Xr stdout 4 ,
298.Xr stderr 4 ,
299.Xr arandom 4
300and
301.Xr tty 4
302devices.
303For file transfer sessions using
Darren Tuckerf92077f2009-06-21 17:56:25 +1000304.Dq sftp ,
Damien Millerd8cb1f12008-02-10 22:40:12 +1100305no additional configuration of the environment is necessary if the
Darren Tuckerf92077f2009-06-21 17:56:25 +1000306in-process sftp server is used,
307though sessions which use logging do require
Darren Tucker00fcd712009-06-21 17:56:00 +1000308.Pa /dev/log
309inside the chroot directory (see
310.Xr sftp-server 8
311for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100312.Pp
313The default is not to
314.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000315.It Cm Ciphers
316Specifies the ciphers allowed for protocol version 2.
317Multiple ciphers must be comma-separated.
Damien Miller05202ff2004-06-15 10:30:39 +1000318The supported ciphers are
319.Dq 3des-cbc ,
320.Dq aes128-cbc ,
321.Dq aes192-cbc ,
322.Dq aes256-cbc ,
323.Dq aes128-ctr ,
324.Dq aes192-ctr ,
325.Dq aes256-ctr ,
Damien Miller3710f272005-05-26 12:19:17 +1000326.Dq arcfour128 ,
327.Dq arcfour256 ,
Damien Miller05202ff2004-06-15 10:30:39 +1000328.Dq arcfour ,
329.Dq blowfish-cbc ,
330and
331.Dq cast128-cbc .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100332The default is:
333.Bd -literal -offset 3n
Damien Miller9aa72ba2009-01-28 16:34:00 +1100334aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,
335aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,
336aes256-cbc,arcfour
Ben Lindstrom9f049032002-06-21 00:59:05 +0000337.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +0000338.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100339Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000340sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100341.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000342receiving any messages back from the client.
343If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100344sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000345It is important to note that the use of client alive messages is very
346different from
Damien Miller12c150e2003-12-17 16:31:10 +1100347.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000348(below).
349The client alive messages are sent through the encrypted channel
350and therefore will not be spoofable.
351The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100352.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000353is spoofable.
354The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000355server depend on knowing when a connection has become inactive.
356.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000357The default value is 3.
358If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000359.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100360(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000361.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100362is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000363will be disconnected after approximately 45 seconds.
Damien Millercc3e8ba2006-03-15 12:06:55 +1100364This option applies to protocol version 2 only.
Damien Miller1594ad52005-05-26 12:12:19 +1000365.It Cm ClientAliveInterval
366Sets a timeout interval in seconds after which if no data has been received
367from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100368.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000369will send a message through the encrypted
370channel to request a response from the client.
371The default
372is 0, indicating that these messages will not be sent to the client.
373This option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000374.It Cm Compression
Damien Miller9786e6e2005-07-26 21:54:56 +1000375Specifies whether compression is allowed, or delayed until
376the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000377The argument must be
Damien Miller9786e6e2005-07-26 21:54:56 +1000378.Dq yes ,
379.Dq delayed ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000380or
381.Dq no .
382The default is
Damien Miller9786e6e2005-07-26 21:54:56 +1000383.Dq delayed .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000384.It Cm DenyGroups
385This keyword can be followed by a list of group name patterns, separated
386by spaces.
387Login is disallowed for users whose primary group or supplementary
388group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000389Only group names are valid; a numerical group ID is not recognized.
390By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100391The allow/deny directives are processed in the following order:
392.Cm DenyUsers ,
393.Cm AllowUsers ,
394.Cm DenyGroups ,
395and finally
396.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100397.Pp
398See
399.Sx PATTERNS
400in
401.Xr ssh_config 5
402for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000403.It Cm DenyUsers
404This keyword can be followed by a list of user name patterns, separated
405by spaces.
406Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000407Only user names are valid; a numerical user ID is not recognized.
408By default, login is allowed for all users.
409If the pattern takes the form USER@HOST then USER and HOST
410are separately checked, restricting logins to particular
411users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100412The allow/deny directives are processed in the following order:
413.Cm DenyUsers ,
414.Cm AllowUsers ,
415.Cm DenyGroups ,
416and finally
417.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100418.Pp
419See
420.Sx PATTERNS
421in
422.Xr ssh_config 5
423for more information on patterns.
Damien Millere2754432006-07-24 14:06:47 +1000424.It Cm ForceCommand
425Forces the execution of the command specified by
426.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100427ignoring any command supplied by the client and
428.Pa ~/.ssh/rc
429if present.
Damien Millere2754432006-07-24 14:06:47 +1000430The command is invoked by using the user's login shell with the -c option.
431This applies to shell, command, or subsystem execution.
432It is most useful inside a
433.Cm Match
434block.
435The command originally supplied by the client is available in the
436.Ev SSH_ORIGINAL_COMMAND
437environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100438Specifying a command of
439.Dq internal-sftp
440will force the use of an in-process sftp server that requires no support
441files when used with
442.Cm ChrootDirectory .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000443.It Cm GatewayPorts
444Specifies whether remote hosts are allowed to connect to ports
445forwarded for the client.
446By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100447.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000448binds remote port forwardings to the loopback address.
449This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000450.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100451can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100452should allow remote port forwardings to bind to non-loopback addresses, thus
453allowing other hosts to connect.
454The argument may be
455.Dq no
456to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000457.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100458to force remote port forwardings to bind to the wildcard address, or
459.Dq clientspecified
460to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000461The default is
462.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000463.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000464Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100465The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000466.Dq no .
467Note that this option applies to protocol version 2 only.
468.It Cm GSSAPICleanupCredentials
469Specifies whether to automatically destroy the user's credentials cache
470on logout.
471The default is
472.Dq yes .
473Note that this option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000474.It Cm HostbasedAuthentication
475Specifies whether rhosts or /etc/hosts.equiv authentication together
476with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100477(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000478This option is similar to
479.Cm RhostsRSAAuthentication
480and applies to protocol version 2 only.
481The default is
482.Dq no .
Damien Millerb594f382006-08-30 11:06:34 +1000483.It Cm HostbasedUsesNameFromPacketOnly
484Specifies whether or not the server will attempt to perform a reverse
485name lookup when matching the name in the
486.Pa ~/.shosts ,
487.Pa ~/.rhosts ,
488and
489.Pa /etc/hosts.equiv
490files during
491.Cm HostbasedAuthentication .
492A setting of
493.Dq yes
494means that
495.Xr sshd 8
496uses the name supplied by the client rather than
497attempting to resolve the name from the TCP connection itself.
498The default is
499.Dq no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100500.It Cm HostCertificate
501Specifies a file containing a public host certificate.
502The certificate's public key must match a private host key already specified
503by
504.Cm HostKey .
505The default behaviour of
506.Xr sshd 8
507is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000508.It Cm HostKey
509Specifies a file containing a private host key
510used by SSH.
511The default is
512.Pa /etc/ssh/ssh_host_key
513for protocol version 1, and
Damien Millereb8b60e2010-08-31 22:41:14 +1000514.Pa /etc/ssh/ssh_host_dsa_key ,
515.Pa /etc/ssh/ssh_host_ecdsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000516and
Damien Millereb8b60e2010-08-31 22:41:14 +1000517.Pa /etc/ssh/ssh_host_rsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000518for protocol version 2.
519Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100520.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000521will refuse to use a file if it is group/world-accessible.
522It is possible to have multiple host key files.
523.Dq rsa1
524keys are used for version 1 and
Damien Millereb8b60e2010-08-31 22:41:14 +1000525.Dq dsa ,
526.Dq ecdsa
Ben Lindstrom9f049032002-06-21 00:59:05 +0000527or
528.Dq rsa
529are used for version 2 of the SSH protocol.
530.It Cm IgnoreRhosts
531Specifies that
532.Pa .rhosts
533and
534.Pa .shosts
535files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000536.Cm RhostsRSAAuthentication
537or
538.Cm HostbasedAuthentication .
539.Pp
540.Pa /etc/hosts.equiv
541and
542.Pa /etc/shosts.equiv
543are still used.
544The default is
545.Dq yes .
546.It Cm IgnoreUserKnownHosts
547Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100548.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000549should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000550.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000551during
552.Cm RhostsRSAAuthentication
553or
554.Cm HostbasedAuthentication .
555The default is
556.Dq no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100557.It Cm IPQoS
558Specifies the IPv4 type-of-service or DSCP class for the connection.
559Accepted values are
560.Dq af11 ,
561.Dq af12 ,
562.Dq af13 ,
Damien Millerf6e758c2011-09-22 21:37:13 +1000563.Dq af21 ,
Damien Miller0dac6fb2010-11-20 15:19:38 +1100564.Dq af22 ,
565.Dq af23 ,
566.Dq af31 ,
567.Dq af32 ,
568.Dq af33 ,
569.Dq af41 ,
570.Dq af42 ,
571.Dq af43 ,
572.Dq cs0 ,
573.Dq cs1 ,
574.Dq cs2 ,
575.Dq cs3 ,
576.Dq cs4 ,
577.Dq cs5 ,
578.Dq cs6 ,
579.Dq cs7 ,
580.Dq ef ,
581.Dq lowdelay ,
582.Dq throughput ,
583.Dq reliability ,
584or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +1100585This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100586If one argument is specified, it is used as the packet class unconditionally.
587If two values are specified, the first is automatically selected for
588interactive sessions and the second for non-interactive sessions.
589The default is
590.Dq lowdelay
591for interactive sessions and
592.Dq throughput
593for non-interactive sessions.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000594.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000595Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000596.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000597will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000598To use this option, the server needs a
599Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100600The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000601.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100602.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000603If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100604an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100605The default is
Damien Miller8448e662004-03-08 23:13:15 +1100606.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000607.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100608If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000609the password will be validated via any additional local mechanism
610such as
611.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100612The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000613.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000614.It Cm KerberosTicketCleanup
615Specifies whether to automatically destroy the user's ticket cache
616file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100617The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000618.Dq yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000619.It Cm KexAlgorithms
620Specifies the available KEX (Key Exchange) algorithms.
621Multiple algorithms must be comma-separated.
622The default is
623.Dq ecdh-sha2-nistp256 ,
624.Dq ecdh-sha2-nistp384 ,
625.Dq ecdh-sha2-nistp521 ,
Damien Miller0a184732010-11-20 15:21:03 +1100626.Dq diffie-hellman-group-exchange-sha256 ,
Damien Millerd5f62bf2010-09-24 22:11:14 +1000627.Dq diffie-hellman-group-exchange-sha1 ,
628.Dq diffie-hellman-group14-sha1 ,
629.Dq diffie-hellman-group1-sha1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000630.It Cm KeyRegenerationInterval
631In protocol version 1, the ephemeral server key is automatically regenerated
632after this many seconds (if it has been used).
633The purpose of regeneration is to prevent
634decrypting captured sessions by later breaking into the machine and
635stealing the keys.
636The key is never stored anywhere.
637If the value is 0, the key is never regenerated.
638The default is 3600 (seconds).
639.It Cm ListenAddress
640Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100641.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000642should listen on.
643The following forms may be used:
644.Pp
645.Bl -item -offset indent -compact
646.It
647.Cm ListenAddress
648.Sm off
649.Ar host No | Ar IPv4_addr No | Ar IPv6_addr
650.Sm on
651.It
652.Cm ListenAddress
653.Sm off
654.Ar host No | Ar IPv4_addr No : Ar port
655.Sm on
656.It
657.Cm ListenAddress
658.Sm off
659.Oo
660.Ar host No | Ar IPv6_addr Oc : Ar port
661.Sm on
662.El
663.Pp
664If
665.Ar port
666is not specified,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100667sshd will listen on the address and all prior
Ben Lindstrom9f049032002-06-21 00:59:05 +0000668.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000669options specified.
670The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000671Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000672.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000673options are permitted.
674Additionally, any
Ben Lindstrom9f049032002-06-21 00:59:05 +0000675.Cm Port
Damien Miller5b0d63f2006-03-15 11:56:56 +1100676options must precede this option for non-port qualified addresses.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000677.It Cm LoginGraceTime
678The server disconnects after this time if the user has not
679successfully logged in.
680If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000681The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000682.It Cm LogLevel
683Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100684.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000685The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100686QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000687The default is INFO.
688DEBUG and DEBUG1 are equivalent.
689DEBUG2 and DEBUG3 each specify higher levels of debugging output.
690Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000691.It Cm MACs
692Specifies the available MAC (message authentication code) algorithms.
693The MAC algorithm is used in protocol version 2
694for data integrity protection.
695Multiple algorithms must be comma-separated.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100696The default is:
Damien Miller22b7b492007-06-11 14:07:12 +1000697.Bd -literal -offset indent
Darren Tucker427e4092012-10-05 11:02:39 +1000698hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,
Darren Tuckerecbf14a2012-07-02 18:53:37 +1000699hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,
700hmac-sha1-96,hmac-md5-96
Damien Miller22b7b492007-06-11 14:07:12 +1000701.Ed
Darren Tucker45150472006-07-12 22:34:17 +1000702.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +1000703Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +1000704If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +1000705.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000706line are satisfied, the keywords on the following lines override those
707set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +1000708.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000709line or the end of the file.
Darren Tucker7a3935d2008-06-10 22:59:10 +1000710.Pp
Damien Millerd04f3572006-07-24 13:46:50 +1000711The arguments to
Darren Tucker45150472006-07-12 22:34:17 +1000712.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000713are one or more criteria-pattern pairs.
Darren Tucker45150472006-07-12 22:34:17 +1000714The available criteria are
715.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +1000716.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +1000717.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +1000718.Cm LocalAddress ,
719.Cm LocalPort ,
Darren Tucker45150472006-07-12 22:34:17 +1000720and
721.Cm Address .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000722The match patterns may consist of single entries or comma-separated
723lists and may use the wildcard and negation operators described in the
Darren Tuckerb06cc4a2008-06-10 22:59:53 +1000724.Sx PATTERNS
Darren Tucker7a3935d2008-06-10 22:59:10 +1000725section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +1000726.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000727.Pp
728The patterns in an
729.Cm Address
730criteria may additionally contain addresses to match in CIDR
Darren Tucker6a2a4002008-06-10 23:03:04 +1000731address/masklen format, e.g.\&
Darren Tucker7a3935d2008-06-10 22:59:10 +1000732.Dq 192.0.2.0/24
733or
734.Dq 3ffe:ffff::/32 .
735Note that the mask length provided must be consistent with the address -
736it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +1000737or one with bits set in this host portion of the address.
738For example,
Darren Tucker7a3935d2008-06-10 22:59:10 +1000739.Dq 192.0.2.0/33
740and
Darren Tucker6a2a4002008-06-10 23:03:04 +1000741.Dq 192.0.2.0/8
Darren Tucker7a3935d2008-06-10 22:59:10 +1000742respectively.
743.Pp
Darren Tucker45150472006-07-12 22:34:17 +1000744Only a subset of keywords may be used on the lines following a
745.Cm Match
746keyword.
747Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +1000748.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +1100749.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +1000750.Cm AllowGroups ,
Damien Miller9b439df2006-07-24 14:04:00 +1000751.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +1000752.Cm AllowUsers ,
Damien Millera6e3f012012-11-04 23:21:40 +1100753.Cm AuthenticationMethods ,
Damien Miller09d3e122012-10-31 08:58:58 +1100754.Cm AuthorizedKeysCommand ,
755.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +1100756.Cm AuthorizedKeysFile ,
Damien Millerab6de352010-06-26 09:38:45 +1000757.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +1100758.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +1000759.Cm ChrootDirectory ,
Damien Millerc24da772012-06-20 21:53:58 +1000760.Cm DenyGroups ,
761.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +1000762.Cm ForceCommand ,
Damien Millerc24da772012-06-20 21:53:58 +1000763.Cm GatewayPorts ,
Damien Millerf8268502012-06-20 21:54:15 +1000764.Cm GSSAPIAuthentication ,
Damien Miller25434de2008-05-19 14:29:08 +1000765.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +1000766.Cm HostbasedUsesNameFromPacketOnly ,
Darren Tucker1d75f222007-03-01 21:31:28 +1100767.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +1100768.Cm KerberosAuthentication ,
Damien Miller307c1d12008-06-16 07:56:20 +1000769.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +1000770.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +1100771.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +1100772.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +1000773.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +1100774.Cm PermitRootLogin ,
Damien Millerab6de352010-06-26 09:38:45 +1000775.Cm PermitTunnel ,
Darren Tucker1477ea12009-10-07 08:36:05 +1100776.Cm PubkeyAuthentication ,
Damien Millerc24da772012-06-20 21:53:58 +1000777.Cm RhostsRSAAuthentication ,
Damien Millerf8268502012-06-20 21:54:15 +1000778.Cm RSAAuthentication ,
Damien Millerd1de9952006-07-24 14:05:48 +1000779.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +1100780.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +1000781and
Damien Miller0296ae82009-02-23 11:00:24 +1100782.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +1000783.It Cm MaxAuthTries
784Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +1000785connection.
786Once the number of failures reaches half this value,
787additional failures are logged.
788The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +1000789.It Cm MaxSessions
790Specifies the maximum number of open sessions permitted per network connection.
791The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000792.It Cm MaxStartups
793Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +1100794SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000795Additional connections will be dropped until authentication succeeds or the
796.Cm LoginGraceTime
797expires for a connection.
798The default is 10.
799.Pp
800Alternatively, random early drop can be enabled by specifying
801the three colon separated values
802.Dq start:rate:full
Damien Miller208f1ed2006-03-15 11:56:03 +1100803(e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +1100804.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000805will refuse connection attempts with a probability of
806.Dq rate/100
807(30%)
808if there are currently
809.Dq start
810(10)
811unauthenticated connections.
812The probability increases linearly and all connection attempts
813are refused if the number of unauthenticated connections reaches
814.Dq full
815(60).
816.It Cm PasswordAuthentication
817Specifies whether password authentication is allowed.
818The default is
819.Dq yes .
820.It Cm PermitEmptyPasswords
821When password authentication is allowed, it specifies whether the
822server allows login to accounts with empty password strings.
823The default is
824.Dq no .
Damien Miller9b439df2006-07-24 14:04:00 +1000825.It Cm PermitOpen
826Specifies the destinations to which TCP port forwarding is permitted.
827The forwarding specification must be one of the following forms:
828.Pp
829.Bl -item -offset indent -compact
830.It
831.Cm PermitOpen
832.Sm off
833.Ar host : port
834.Sm on
835.It
836.Cm PermitOpen
837.Sm off
838.Ar IPv4_addr : port
839.Sm on
840.It
841.Cm PermitOpen
842.Sm off
843.Ar \&[ IPv6_addr \&] : port
844.Sm on
845.El
846.Pp
Damien Millera765cf42006-07-24 14:08:13 +1000847Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +1000848An argument of
849.Dq any
850can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +1000851An argument of
852.Dq none
853can be used to prohibit all forwarding requests.
Damien Miller65bc2c42006-07-24 14:04:16 +1000854By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000855.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +1100856Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +0000857.Xr ssh 1 .
858The argument must be
859.Dq yes ,
860.Dq without-password ,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100861.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000862or
863.Dq no .
864The default is
865.Dq yes .
866.Pp
867If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100868.Dq without-password ,
Darren Tucker9dca0992005-02-01 19:16:45 +1100869password authentication is disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000870.Pp
871If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100872.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000873root login with public key authentication will be allowed,
874but only if the
875.Ar command
876option has been specified
877(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +1000878normally not allowed).
879All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000880.Pp
881If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100882.Dq no ,
Darren Tuckerb3509012005-01-20 11:01:46 +1100883root is not allowed to log in.
Damien Millerd27b9472005-12-13 19:29:02 +1100884.It Cm PermitTunnel
885Specifies whether
886.Xr tun 4
887device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +1100888The argument must be
889.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +1000890.Dq point-to-point
891(layer 3),
892.Dq ethernet
893(layer 2), or
Damien Miller7b58e802005-12-13 19:33:19 +1100894.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +1000895Specifying
896.Dq yes
897permits both
898.Dq point-to-point
899and
900.Dq ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +1100901The default is
902.Dq no .
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000903.It Cm PermitUserEnvironment
904Specifies whether
905.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000906and
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000907.Cm environment=
908options in
909.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000910are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +1100911.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000912The default is
913.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000914Enabling environment processing may enable users to bypass access
915restrictions in some configurations using mechanisms such as
916.Ev LD_PRELOAD .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000917.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +0000918Specifies the file that contains the process ID of the
Damien Millerf4f22b52006-03-15 11:57:25 +1100919SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000920The default is
921.Pa /var/run/sshd.pid .
922.It Cm Port
923Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100924.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000925listens on.
926The default is 22.
927Multiple options of this type are permitted.
928See also
929.Cm ListenAddress .
930.It Cm PrintLastLog
931Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100932.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +1100933should print the date and time of the last user login when a user logs
934in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000935The default is
936.Dq yes .
937.It Cm PrintMotd
938Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100939.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000940should print
941.Pa /etc/motd
942when a user logs in interactively.
943(On some systems it is also printed by the shell,
944.Pa /etc/profile ,
945or equivalent.)
946The default is
947.Dq yes .
948.It Cm Protocol
949Specifies the protocol versions
Damien Miller5b0d63f2006-03-15 11:56:56 +1100950.Xr sshd 8
Ben Lindstrom9c445542002-07-11 03:59:18 +0000951supports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000952The possible values are
Damien Miller5b0d63f2006-03-15 11:56:56 +1100953.Sq 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000954and
Damien Miller5b0d63f2006-03-15 11:56:56 +1100955.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000956Multiple versions must be comma-separated.
957The default is
Darren Tucker7a4a7652009-10-11 21:51:40 +1100958.Sq 2 .
Ben Lindstrom9c445542002-07-11 03:59:18 +0000959Note that the order of the protocol list does not indicate preference,
960because the client selects among multiple protocol versions offered
961by the server.
962Specifying
963.Dq 2,1
964is identical to
965.Dq 1,2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000966.It Cm PubkeyAuthentication
967Specifies whether public key authentication is allowed.
968The default is
969.Dq yes .
970Note that this option applies to protocol version 2 only.
Damien Miller1aed65e2010-03-04 21:53:35 +1100971.It Cm RevokedKeys
972Specifies a list of revoked public keys.
973Keys listed in this file will be refused for public key authentication.
974Note that if this file is not readable, then public key authentication will
975be refused for all users.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000976.It Cm RhostsRSAAuthentication
977Specifies whether rhosts or /etc/hosts.equiv authentication together
978with successful RSA host authentication is allowed.
979The default is
980.Dq no .
981This option applies to protocol version 1 only.
982.It Cm RSAAuthentication
983Specifies whether pure RSA authentication is allowed.
984The default is
985.Dq yes .
986This option applies to protocol version 1 only.
987.It Cm ServerKeyBits
988Defines the number of bits in the ephemeral protocol version 1 server key.
Darren Tucker7499b0c2008-07-02 22:35:43 +1000989The minimum value is 512, and the default is 1024.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000990.It Cm StrictModes
991Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100992.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000993should check file modes and ownership of the
994user's files and home directory before accepting login.
995This is normally desirable because novices sometimes accidentally leave their
996directory or files world-writable.
997The default is
998.Dq yes .
Darren Tuckerf788a912010-01-08 17:06:47 +1100999Note that this does not apply to
1000.Cm ChrootDirectory ,
1001whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001002.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +11001003Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +10001004Arguments should be a subsystem name and a command (with optional arguments)
1005to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001006.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001007The command
1008.Xr sftp-server 8
1009implements the
1010.Dq sftp
1011file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001012.Pp
1013Alternately the name
1014.Dq internal-sftp
1015implements an in-process
1016.Dq sftp
1017server.
1018This may simplify configurations using
1019.Cm ChrootDirectory
1020to force a different filesystem root on clients.
1021.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001022By default no subsystems are defined.
1023Note that this option applies to protocol version 2 only.
1024.It Cm SyslogFacility
1025Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001026.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001027The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1028LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1029The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001030.It Cm TCPKeepAlive
1031Specifies whether the system should send TCP keepalive messages to the
1032other side.
1033If they are sent, death of the connection or crash of one
1034of the machines will be properly noticed.
1035However, this means that
1036connections will die if the route is down temporarily, and some people
1037find it annoying.
1038On the other hand, if TCP keepalives are not sent,
1039sessions may hang indefinitely on the server, leaving
1040.Dq ghost
1041users and consuming server resources.
1042.Pp
1043The default is
1044.Dq yes
1045(to send TCP keepalive messages), and the server will notice
1046if the network goes down or the client host crashes.
1047This avoids infinitely hanging sessions.
1048.Pp
1049To disable TCP keepalive messages, the value should be set to
1050.Dq no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001051.It Cm TrustedUserCAKeys
1052Specifies a file containing public keys of certificate authorities that are
Damien Millerc6db99e2010-03-05 10:41:45 +11001053trusted to sign user certificates for authentication.
Damien Miller72b33822010-03-05 07:39:01 +11001054Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001055.Ql #
1056are allowed.
1057If a certificate is presented for authentication and has its signing CA key
1058listed in this file, then it may be used for authentication for any user
1059listed in the certificate's principals list.
1060Note that certificates that lack a list of principals will not be permitted
1061for authentication using
1062.Cm TrustedUserCAKeys .
Damien Miller72b33822010-03-05 07:39:01 +11001063For more details on certificates, see the
Damien Miller1aed65e2010-03-04 21:53:35 +11001064.Sx CERTIFICATES
1065section in
1066.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001067.It Cm UseDNS
1068Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001069.Xr sshd 8
Darren Tucker83d5a982005-03-31 21:33:50 +10001070should look up the remote host name and check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001071the resolved host name for the remote IP address maps back to the
1072very same IP address.
1073The default is
1074.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001075.It Cm UseLogin
1076Specifies whether
1077.Xr login 1
1078is used for interactive login sessions.
1079The default is
1080.Dq no .
1081Note that
1082.Xr login 1
1083is never used for remote command execution.
1084Note also, that if this is enabled,
1085.Cm X11Forwarding
1086will be disabled because
1087.Xr login 1
1088does not know how to handle
1089.Xr xauth 1
Damien Miller495dca32003-04-01 21:42:14 +10001090cookies.
1091If
Ben Lindstrom9f049032002-06-21 00:59:05 +00001092.Cm UsePrivilegeSeparation
1093is specified, it will be disabled after authentication.
Damien Miller2e193e22003-05-14 15:13:03 +10001094.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001095Enables the Pluggable Authentication Module interface.
1096If set to
1097.Dq yes
1098this will enable PAM authentication using
1099.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001100and
1101.Cm PasswordAuthentication
1102in addition to PAM account and session module processing for all
1103authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001104.Pp
1105Because PAM challenge-response authentication usually serves an equivalent
1106role to password authentication, you should disable either
1107.Cm PasswordAuthentication
1108or
1109.Cm ChallengeResponseAuthentication.
1110.Pp
1111If
1112.Cm UsePAM
1113is enabled, you will not be able to run
1114.Xr sshd 8
1115as a non-root user.
1116The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +10001117.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001118.It Cm UsePrivilegeSeparation
1119Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001120.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001121separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +10001122to deal with incoming network traffic.
1123After successful authentication, another process will be created that has
1124the privilege of the authenticated user.
1125The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +00001126escalation by containing any corruption within the unprivileged processes.
1127The default is
1128.Dq yes .
Damien Miller69ff1df2011-06-23 08:30:03 +10001129If
1130.Cm UsePrivilegeSeparation
1131is set to
1132.Dq sandbox
1133then the pre-authentication unprivileged process is subject to additional
1134restrictions.
Damien Miller23528812012-04-22 11:24:43 +10001135.It Cm VersionAddendum
1136Optionally specifies additional text to append to the SSH protocol banner
1137sent by the server upon connection.
1138The default is
1139.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001140.It Cm X11DisplayOffset
1141Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001142.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001143X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001144This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001145The default is 10.
1146.It Cm X11Forwarding
1147Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001148The argument must be
1149.Dq yes
1150or
1151.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001152The default is
1153.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +10001154.Pp
1155When X11 forwarding is enabled, there may be additional exposure to
1156the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001157.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001158proxy display is configured to listen on the wildcard address (see
1159.Cm X11UseLocalhost
Damien Miller5b0d63f2006-03-15 11:56:56 +11001160below), though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001161Additionally, the authentication spoofing and authentication data
1162verification and substitution occur on the client side.
1163The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001164display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001165forwarding (see the warnings for
1166.Cm ForwardX11
1167in
Damien Millerf1ce5052003-06-11 22:04:39 +10001168.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001169A system administrator may have a stance in which they want to
1170protect clients that may expose themselves to attack by unwittingly
1171requesting X11 forwarding, which can warrant a
1172.Dq no
1173setting.
1174.Pp
1175Note that disabling X11 forwarding does not prevent users from
1176forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001177X11 forwarding is automatically disabled if
1178.Cm UseLogin
1179is enabled.
1180.It Cm X11UseLocalhost
1181Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001182.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001183should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001184the wildcard address.
1185By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001186sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001187hostname part of the
1188.Ev DISPLAY
1189environment variable to
1190.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001191This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001192However, some older X11 clients may not function with this
1193configuration.
1194.Cm X11UseLocalhost
1195may be set to
1196.Dq no
1197to specify that the forwarding server should be bound to the wildcard
1198address.
1199The argument must be
1200.Dq yes
1201or
1202.Dq no .
1203The default is
1204.Dq yes .
1205.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001206Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001207.Xr xauth 1
1208program.
1209The default is
1210.Pa /usr/X11R6/bin/xauth .
1211.El
Damien Millere3beba22006-03-15 11:59:25 +11001212.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001213.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001214command-line arguments and configuration file options that specify time
1215may be expressed using a sequence of the form:
1216.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001217.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001218.Sm on
1219where
1220.Ar time
1221is a positive integer value and
1222.Ar qualifier
1223is one of the following:
1224.Pp
1225.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001226.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001227seconds
1228.It Cm s | Cm S
1229seconds
1230.It Cm m | Cm M
1231minutes
1232.It Cm h | Cm H
1233hours
1234.It Cm d | Cm D
1235days
1236.It Cm w | Cm W
1237weeks
1238.El
1239.Pp
1240Each member of the sequence is added together to calculate
1241the total time value.
1242.Pp
1243Time format examples:
1244.Pp
1245.Bl -tag -width Ds -compact -offset indent
1246.It 600
1247600 seconds (10 minutes)
1248.It 10m
124910 minutes
1250.It 1h30m
12511 hour 30 minutes (90 minutes)
1252.El
1253.Sh FILES
1254.Bl -tag -width Ds
1255.It Pa /etc/ssh/sshd_config
1256Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001257.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001258This file should be writable by root only, but it is recommended
1259(though not necessary) that it be world-readable.
1260.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001261.Sh SEE ALSO
1262.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001263.Sh AUTHORS
1264OpenSSH is a derivative of the original and free
1265ssh 1.2.12 release by Tatu Ylonen.
1266Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1267Theo de Raadt and Dug Song
1268removed many bugs, re-added newer features and
1269created OpenSSH.
1270Markus Friedl contributed the support for SSH
1271protocol versions 1.5 and 2.0.
1272Niels Provos and Markus Friedl contributed support
1273for privilege separation.