blob: de8f0f8253603e9b10917034dadec853587720ab [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 Miller09d3e122012-10-31 08:58:58 +110036.\" $OpenBSD: sshd_config.5,v 1.146 2012/10/30 21:29:55 djm Exp $
37.Dd $Mdocdate: October 30 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 Miller09d3e122012-10-31 08:58:58 +1100154.It Cm AuthorizedKeysCommand
155Specifies a program to be used for lookup of the user's public keys.
156The program will be invoked with a single argument of the username
157being authenticated, and should produce on standard output zero or
158more lines of authorized_keys output (see AUTHORIZED_KEYS in
159.Xr sshd 8 )
160If a key supplied by AuthorizedKeysCommand does not successfully authenticate
161and authorize the user then public key authentication continues using the usual
162.Cm AuthorizedKeysFile
163files.
164By default, no AuthorizedKeysCommand is run.
165.It Cm AuthorizedKeysCommandUser
166Specifies the user under whose account the AuthorizedKeysCommand is run.
167The default is the user being authenticated.
168It is recommended to use a dedicated user that has no other role on the host
169than running authorized keys commands.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000170.It Cm AuthorizedKeysFile
171Specifies the file that contains the public keys that can be used
172for user authentication.
Damien Miller6018a362010-07-02 13:35:19 +1000173The format is described in the
174.Sx AUTHORIZED_KEYS FILE FORMAT
175section of
176.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000177.Cm AuthorizedKeysFile
178may contain tokens of the form %T which are substituted during connection
Damien Miller5b0d63f2006-03-15 11:56:56 +1100179setup.
Damien Millerfbf486b2003-05-23 18:44:23 +1000180The following tokens are defined: %% is replaced by a literal '%',
Damien Miller5b0d63f2006-03-15 11:56:56 +1100181%h is replaced by the home directory of the user being authenticated, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000182%u is replaced by the username of that user.
183After expansion,
184.Cm AuthorizedKeysFile
185is taken to be an absolute path or one relative to the user's home
186directory.
Damien Millerb9132fc2011-05-29 21:41:40 +1000187Multiple files may be listed, separated by whitespace.
188The default is
189.Dq .ssh/authorized_keys .ssh/authorized_keys2 .
Damien Miller30da3442010-05-10 11:58:03 +1000190.It Cm AuthorizedPrincipalsFile
191Specifies a file that lists principal names that are accepted for
192certificate authentication.
193When using certificates signed by a key listed in
194.Cm TrustedUserCAKeys ,
195this file lists names, one of which must appear in the certificate for it
196to be accepted for authentication.
Damien Millerd59dab82010-07-02 13:37:17 +1000197Names are listed one per line preceded by key options (as described
Damien Miller6018a362010-07-02 13:35:19 +1000198in
199.Sx AUTHORIZED_KEYS FILE FORMAT
200in
Damien Millerd59dab82010-07-02 13:37:17 +1000201.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000202Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000203.Ql #
204are ignored.
205.Pp
206.Cm AuthorizedPrincipalsFile
207may contain tokens of the form %T which are substituted during connection
208setup.
209The following tokens are defined: %% is replaced by a literal '%',
210%h is replaced by the home directory of the user being authenticated, and
211%u is replaced by the username of that user.
212After expansion,
213.Cm AuthorizedPrincipalsFile
214is taken to be an absolute path or one relative to the user's home
215directory.
216.Pp
Damien Miller8fef9eb2012-04-22 11:25:10 +1000217The default is
218.Dq none ,
219i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000220of the user must appear in a certificate's principals list for it to be
221accepted.
222Note that
223.Cm AuthorizedPrincipalsFile
224is only used when authentication proceeds using a CA listed in
225.Cm TrustedUserCAKeys
226and is not consulted for certification authorities trusted via
227.Pa ~/.ssh/authorized_keys ,
228though the
229.Cm principals=
230key option offers a similar facility (see
231.Xr sshd 8
232for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000233.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000234The contents of the specified file are sent to the remote user before
235authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000236If the argument is
237.Dq none
238then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000239This option is only available for protocol version 2.
240By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000241.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000242Specifies whether challenge-response authentication is allowed (e.g. via
243PAM or though authentication styles supported in
244.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000245The default is
246.Dq yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100247.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100248Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100249.Xr chroot 2
250to after authentication.
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100251All components of the pathname must be root-owned directories that are
Damien Millerd8cb1f12008-02-10 22:40:12 +1100252not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000253After the chroot,
254.Xr sshd 8
255changes the working directory to the user's home directory.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100256.Pp
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100257The pathname may contain the following tokens that are expanded at runtime once
Damien Millerd8cb1f12008-02-10 22:40:12 +1100258the connecting user has been authenticated: %% is replaced by a literal '%',
259%h is replaced by the home directory of the user being authenticated, and
260%u is replaced by the username of that user.
261.Pp
262The
263.Cm ChrootDirectory
264must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000265user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100266For an interactive session this requires at least a shell, typically
267.Xr sh 1 ,
268and basic
269.Pa /dev
270nodes such as
271.Xr null 4 ,
272.Xr zero 4 ,
273.Xr stdin 4 ,
274.Xr stdout 4 ,
275.Xr stderr 4 ,
276.Xr arandom 4
277and
278.Xr tty 4
279devices.
280For file transfer sessions using
Darren Tuckerf92077f2009-06-21 17:56:25 +1000281.Dq sftp ,
Damien Millerd8cb1f12008-02-10 22:40:12 +1100282no additional configuration of the environment is necessary if the
Darren Tuckerf92077f2009-06-21 17:56:25 +1000283in-process sftp server is used,
284though sessions which use logging do require
Darren Tucker00fcd712009-06-21 17:56:00 +1000285.Pa /dev/log
286inside the chroot directory (see
287.Xr sftp-server 8
288for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100289.Pp
290The default is not to
291.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000292.It Cm Ciphers
293Specifies the ciphers allowed for protocol version 2.
294Multiple ciphers must be comma-separated.
Damien Miller05202ff2004-06-15 10:30:39 +1000295The supported ciphers are
296.Dq 3des-cbc ,
297.Dq aes128-cbc ,
298.Dq aes192-cbc ,
299.Dq aes256-cbc ,
300.Dq aes128-ctr ,
301.Dq aes192-ctr ,
302.Dq aes256-ctr ,
Damien Miller3710f272005-05-26 12:19:17 +1000303.Dq arcfour128 ,
304.Dq arcfour256 ,
Damien Miller05202ff2004-06-15 10:30:39 +1000305.Dq arcfour ,
306.Dq blowfish-cbc ,
307and
308.Dq cast128-cbc .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100309The default is:
310.Bd -literal -offset 3n
Damien Miller9aa72ba2009-01-28 16:34:00 +1100311aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,
312aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,
313aes256-cbc,arcfour
Ben Lindstrom9f049032002-06-21 00:59:05 +0000314.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +0000315.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100316Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000317sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100318.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000319receiving any messages back from the client.
320If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100321sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000322It is important to note that the use of client alive messages is very
323different from
Damien Miller12c150e2003-12-17 16:31:10 +1100324.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000325(below).
326The client alive messages are sent through the encrypted channel
327and therefore will not be spoofable.
328The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100329.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000330is spoofable.
331The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000332server depend on knowing when a connection has become inactive.
333.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000334The default value is 3.
335If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000336.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100337(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000338.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100339is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000340will be disconnected after approximately 45 seconds.
Damien Millercc3e8ba2006-03-15 12:06:55 +1100341This option applies to protocol version 2 only.
Damien Miller1594ad52005-05-26 12:12:19 +1000342.It Cm ClientAliveInterval
343Sets a timeout interval in seconds after which if no data has been received
344from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100345.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000346will send a message through the encrypted
347channel to request a response from the client.
348The default
349is 0, indicating that these messages will not be sent to the client.
350This option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000351.It Cm Compression
Damien Miller9786e6e2005-07-26 21:54:56 +1000352Specifies whether compression is allowed, or delayed until
353the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000354The argument must be
Damien Miller9786e6e2005-07-26 21:54:56 +1000355.Dq yes ,
356.Dq delayed ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000357or
358.Dq no .
359The default is
Damien Miller9786e6e2005-07-26 21:54:56 +1000360.Dq delayed .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000361.It Cm DenyGroups
362This keyword can be followed by a list of group name patterns, separated
363by spaces.
364Login is disallowed for users whose primary group or supplementary
365group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000366Only group names are valid; a numerical group ID is not recognized.
367By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100368The allow/deny directives are processed in the following order:
369.Cm DenyUsers ,
370.Cm AllowUsers ,
371.Cm DenyGroups ,
372and finally
373.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100374.Pp
375See
376.Sx PATTERNS
377in
378.Xr ssh_config 5
379for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000380.It Cm DenyUsers
381This keyword can be followed by a list of user name patterns, separated
382by spaces.
383Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000384Only user names are valid; a numerical user ID is not recognized.
385By default, login is allowed for all users.
386If the pattern takes the form USER@HOST then USER and HOST
387are separately checked, restricting logins to particular
388users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100389The allow/deny directives are processed in the following order:
390.Cm DenyUsers ,
391.Cm AllowUsers ,
392.Cm DenyGroups ,
393and finally
394.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100395.Pp
396See
397.Sx PATTERNS
398in
399.Xr ssh_config 5
400for more information on patterns.
Damien Millere2754432006-07-24 14:06:47 +1000401.It Cm ForceCommand
402Forces the execution of the command specified by
403.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100404ignoring any command supplied by the client and
405.Pa ~/.ssh/rc
406if present.
Damien Millere2754432006-07-24 14:06:47 +1000407The command is invoked by using the user's login shell with the -c option.
408This applies to shell, command, or subsystem execution.
409It is most useful inside a
410.Cm Match
411block.
412The command originally supplied by the client is available in the
413.Ev SSH_ORIGINAL_COMMAND
414environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100415Specifying a command of
416.Dq internal-sftp
417will force the use of an in-process sftp server that requires no support
418files when used with
419.Cm ChrootDirectory .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000420.It Cm GatewayPorts
421Specifies whether remote hosts are allowed to connect to ports
422forwarded for the client.
423By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100424.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000425binds remote port forwardings to the loopback address.
426This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000427.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100428can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100429should allow remote port forwardings to bind to non-loopback addresses, thus
430allowing other hosts to connect.
431The argument may be
432.Dq no
433to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000434.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100435to force remote port forwardings to bind to the wildcard address, or
436.Dq clientspecified
437to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000438The default is
439.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000440.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000441Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100442The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000443.Dq no .
444Note that this option applies to protocol version 2 only.
445.It Cm GSSAPICleanupCredentials
446Specifies whether to automatically destroy the user's credentials cache
447on logout.
448The default is
449.Dq yes .
450Note that this option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000451.It Cm HostbasedAuthentication
452Specifies whether rhosts or /etc/hosts.equiv authentication together
453with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100454(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000455This option is similar to
456.Cm RhostsRSAAuthentication
457and applies to protocol version 2 only.
458The default is
459.Dq no .
Damien Millerb594f382006-08-30 11:06:34 +1000460.It Cm HostbasedUsesNameFromPacketOnly
461Specifies whether or not the server will attempt to perform a reverse
462name lookup when matching the name in the
463.Pa ~/.shosts ,
464.Pa ~/.rhosts ,
465and
466.Pa /etc/hosts.equiv
467files during
468.Cm HostbasedAuthentication .
469A setting of
470.Dq yes
471means that
472.Xr sshd 8
473uses the name supplied by the client rather than
474attempting to resolve the name from the TCP connection itself.
475The default is
476.Dq no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100477.It Cm HostCertificate
478Specifies a file containing a public host certificate.
479The certificate's public key must match a private host key already specified
480by
481.Cm HostKey .
482The default behaviour of
483.Xr sshd 8
484is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000485.It Cm HostKey
486Specifies a file containing a private host key
487used by SSH.
488The default is
489.Pa /etc/ssh/ssh_host_key
490for protocol version 1, and
Damien Millereb8b60e2010-08-31 22:41:14 +1000491.Pa /etc/ssh/ssh_host_dsa_key ,
492.Pa /etc/ssh/ssh_host_ecdsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000493and
Damien Millereb8b60e2010-08-31 22:41:14 +1000494.Pa /etc/ssh/ssh_host_rsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000495for protocol version 2.
496Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100497.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000498will refuse to use a file if it is group/world-accessible.
499It is possible to have multiple host key files.
500.Dq rsa1
501keys are used for version 1 and
Damien Millereb8b60e2010-08-31 22:41:14 +1000502.Dq dsa ,
503.Dq ecdsa
Ben Lindstrom9f049032002-06-21 00:59:05 +0000504or
505.Dq rsa
506are used for version 2 of the SSH protocol.
507.It Cm IgnoreRhosts
508Specifies that
509.Pa .rhosts
510and
511.Pa .shosts
512files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000513.Cm RhostsRSAAuthentication
514or
515.Cm HostbasedAuthentication .
516.Pp
517.Pa /etc/hosts.equiv
518and
519.Pa /etc/shosts.equiv
520are still used.
521The default is
522.Dq yes .
523.It Cm IgnoreUserKnownHosts
524Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100525.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000526should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000527.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000528during
529.Cm RhostsRSAAuthentication
530or
531.Cm HostbasedAuthentication .
532The default is
533.Dq no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100534.It Cm IPQoS
535Specifies the IPv4 type-of-service or DSCP class for the connection.
536Accepted values are
537.Dq af11 ,
538.Dq af12 ,
539.Dq af13 ,
Damien Millerf6e758c2011-09-22 21:37:13 +1000540.Dq af21 ,
Damien Miller0dac6fb2010-11-20 15:19:38 +1100541.Dq af22 ,
542.Dq af23 ,
543.Dq af31 ,
544.Dq af32 ,
545.Dq af33 ,
546.Dq af41 ,
547.Dq af42 ,
548.Dq af43 ,
549.Dq cs0 ,
550.Dq cs1 ,
551.Dq cs2 ,
552.Dq cs3 ,
553.Dq cs4 ,
554.Dq cs5 ,
555.Dq cs6 ,
556.Dq cs7 ,
557.Dq ef ,
558.Dq lowdelay ,
559.Dq throughput ,
560.Dq reliability ,
561or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +1100562This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100563If one argument is specified, it is used as the packet class unconditionally.
564If two values are specified, the first is automatically selected for
565interactive sessions and the second for non-interactive sessions.
566The default is
567.Dq lowdelay
568for interactive sessions and
569.Dq throughput
570for non-interactive sessions.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000571.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000572Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000573.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000574will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000575To use this option, the server needs a
576Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100577The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000578.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100579.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000580If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100581an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100582The default is
Damien Miller8448e662004-03-08 23:13:15 +1100583.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000584.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100585If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000586the password will be validated via any additional local mechanism
587such as
588.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100589The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000590.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000591.It Cm KerberosTicketCleanup
592Specifies whether to automatically destroy the user's ticket cache
593file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100594The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000595.Dq yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000596.It Cm KexAlgorithms
597Specifies the available KEX (Key Exchange) algorithms.
598Multiple algorithms must be comma-separated.
599The default is
600.Dq ecdh-sha2-nistp256 ,
601.Dq ecdh-sha2-nistp384 ,
602.Dq ecdh-sha2-nistp521 ,
Damien Miller0a184732010-11-20 15:21:03 +1100603.Dq diffie-hellman-group-exchange-sha256 ,
Damien Millerd5f62bf2010-09-24 22:11:14 +1000604.Dq diffie-hellman-group-exchange-sha1 ,
605.Dq diffie-hellman-group14-sha1 ,
606.Dq diffie-hellman-group1-sha1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000607.It Cm KeyRegenerationInterval
608In protocol version 1, the ephemeral server key is automatically regenerated
609after this many seconds (if it has been used).
610The purpose of regeneration is to prevent
611decrypting captured sessions by later breaking into the machine and
612stealing the keys.
613The key is never stored anywhere.
614If the value is 0, the key is never regenerated.
615The default is 3600 (seconds).
616.It Cm ListenAddress
617Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100618.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000619should listen on.
620The following forms may be used:
621.Pp
622.Bl -item -offset indent -compact
623.It
624.Cm ListenAddress
625.Sm off
626.Ar host No | Ar IPv4_addr No | Ar IPv6_addr
627.Sm on
628.It
629.Cm ListenAddress
630.Sm off
631.Ar host No | Ar IPv4_addr No : Ar port
632.Sm on
633.It
634.Cm ListenAddress
635.Sm off
636.Oo
637.Ar host No | Ar IPv6_addr Oc : Ar port
638.Sm on
639.El
640.Pp
641If
642.Ar port
643is not specified,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100644sshd will listen on the address and all prior
Ben Lindstrom9f049032002-06-21 00:59:05 +0000645.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000646options specified.
647The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000648Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000649.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000650options are permitted.
651Additionally, any
Ben Lindstrom9f049032002-06-21 00:59:05 +0000652.Cm Port
Damien Miller5b0d63f2006-03-15 11:56:56 +1100653options must precede this option for non-port qualified addresses.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000654.It Cm LoginGraceTime
655The server disconnects after this time if the user has not
656successfully logged in.
657If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000658The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000659.It Cm LogLevel
660Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100661.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000662The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100663QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000664The default is INFO.
665DEBUG and DEBUG1 are equivalent.
666DEBUG2 and DEBUG3 each specify higher levels of debugging output.
667Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000668.It Cm MACs
669Specifies the available MAC (message authentication code) algorithms.
670The MAC algorithm is used in protocol version 2
671for data integrity protection.
672Multiple algorithms must be comma-separated.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100673The default is:
Damien Miller22b7b492007-06-11 14:07:12 +1000674.Bd -literal -offset indent
Darren Tucker427e4092012-10-05 11:02:39 +1000675hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,
Darren Tuckerecbf14a2012-07-02 18:53:37 +1000676hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,
677hmac-sha1-96,hmac-md5-96
Damien Miller22b7b492007-06-11 14:07:12 +1000678.Ed
Darren Tucker45150472006-07-12 22:34:17 +1000679.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +1000680Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +1000681If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +1000682.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000683line are satisfied, the keywords on the following lines override those
684set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +1000685.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000686line or the end of the file.
Darren Tucker7a3935d2008-06-10 22:59:10 +1000687.Pp
Damien Millerd04f3572006-07-24 13:46:50 +1000688The arguments to
Darren Tucker45150472006-07-12 22:34:17 +1000689.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000690are one or more criteria-pattern pairs.
Darren Tucker45150472006-07-12 22:34:17 +1000691The available criteria are
692.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +1000693.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +1000694.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +1000695.Cm LocalAddress ,
696.Cm LocalPort ,
Darren Tucker45150472006-07-12 22:34:17 +1000697and
698.Cm Address .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000699The match patterns may consist of single entries or comma-separated
700lists and may use the wildcard and negation operators described in the
Darren Tuckerb06cc4a2008-06-10 22:59:53 +1000701.Sx PATTERNS
Darren Tucker7a3935d2008-06-10 22:59:10 +1000702section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +1000703.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000704.Pp
705The patterns in an
706.Cm Address
707criteria may additionally contain addresses to match in CIDR
Darren Tucker6a2a4002008-06-10 23:03:04 +1000708address/masklen format, e.g.\&
Darren Tucker7a3935d2008-06-10 22:59:10 +1000709.Dq 192.0.2.0/24
710or
711.Dq 3ffe:ffff::/32 .
712Note that the mask length provided must be consistent with the address -
713it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +1000714or one with bits set in this host portion of the address.
715For example,
Darren Tucker7a3935d2008-06-10 22:59:10 +1000716.Dq 192.0.2.0/33
717and
Darren Tucker6a2a4002008-06-10 23:03:04 +1000718.Dq 192.0.2.0/8
Darren Tucker7a3935d2008-06-10 22:59:10 +1000719respectively.
720.Pp
Darren Tucker45150472006-07-12 22:34:17 +1000721Only a subset of keywords may be used on the lines following a
722.Cm Match
723keyword.
724Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +1000725.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +1100726.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +1000727.Cm AllowGroups ,
Damien Miller9b439df2006-07-24 14:04:00 +1000728.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +1000729.Cm AllowUsers ,
Damien Millerab6de352010-06-26 09:38:45 +1000730.Cm AuthorizedKeysFile ,
Damien Miller09d3e122012-10-31 08:58:58 +1100731.Cm AuthorizedKeysCommand ,
732.Cm AuthorizedKeysCommandUser ,
Damien Millerab6de352010-06-26 09:38:45 +1000733.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +1100734.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +1000735.Cm ChrootDirectory ,
Damien Millerc24da772012-06-20 21:53:58 +1000736.Cm DenyGroups ,
737.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +1000738.Cm ForceCommand ,
Damien Millerc24da772012-06-20 21:53:58 +1000739.Cm GatewayPorts ,
Damien Millerf8268502012-06-20 21:54:15 +1000740.Cm GSSAPIAuthentication ,
Damien Miller25434de2008-05-19 14:29:08 +1000741.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +1000742.Cm HostbasedUsesNameFromPacketOnly ,
Darren Tucker1d75f222007-03-01 21:31:28 +1100743.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +1100744.Cm KerberosAuthentication ,
Damien Miller307c1d12008-06-16 07:56:20 +1000745.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +1000746.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +1100747.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +1100748.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +1000749.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +1100750.Cm PermitRootLogin ,
Damien Millerab6de352010-06-26 09:38:45 +1000751.Cm PermitTunnel ,
Darren Tucker1477ea12009-10-07 08:36:05 +1100752.Cm PubkeyAuthentication ,
Damien Millerc24da772012-06-20 21:53:58 +1000753.Cm RhostsRSAAuthentication ,
Damien Millerf8268502012-06-20 21:54:15 +1000754.Cm RSAAuthentication ,
Damien Millerd1de9952006-07-24 14:05:48 +1000755.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +1100756.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +1000757and
Damien Miller0296ae82009-02-23 11:00:24 +1100758.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +1000759.It Cm MaxAuthTries
760Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +1000761connection.
762Once the number of failures reaches half this value,
763additional failures are logged.
764The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +1000765.It Cm MaxSessions
766Specifies the maximum number of open sessions permitted per network connection.
767The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000768.It Cm MaxStartups
769Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +1100770SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000771Additional connections will be dropped until authentication succeeds or the
772.Cm LoginGraceTime
773expires for a connection.
774The default is 10.
775.Pp
776Alternatively, random early drop can be enabled by specifying
777the three colon separated values
778.Dq start:rate:full
Damien Miller208f1ed2006-03-15 11:56:03 +1100779(e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +1100780.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000781will refuse connection attempts with a probability of
782.Dq rate/100
783(30%)
784if there are currently
785.Dq start
786(10)
787unauthenticated connections.
788The probability increases linearly and all connection attempts
789are refused if the number of unauthenticated connections reaches
790.Dq full
791(60).
792.It Cm PasswordAuthentication
793Specifies whether password authentication is allowed.
794The default is
795.Dq yes .
796.It Cm PermitEmptyPasswords
797When password authentication is allowed, it specifies whether the
798server allows login to accounts with empty password strings.
799The default is
800.Dq no .
Damien Miller9b439df2006-07-24 14:04:00 +1000801.It Cm PermitOpen
802Specifies the destinations to which TCP port forwarding is permitted.
803The forwarding specification must be one of the following forms:
804.Pp
805.Bl -item -offset indent -compact
806.It
807.Cm PermitOpen
808.Sm off
809.Ar host : port
810.Sm on
811.It
812.Cm PermitOpen
813.Sm off
814.Ar IPv4_addr : port
815.Sm on
816.It
817.Cm PermitOpen
818.Sm off
819.Ar \&[ IPv6_addr \&] : port
820.Sm on
821.El
822.Pp
Damien Millera765cf42006-07-24 14:08:13 +1000823Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +1000824An argument of
825.Dq any
826can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +1000827An argument of
828.Dq none
829can be used to prohibit all forwarding requests.
Damien Miller65bc2c42006-07-24 14:04:16 +1000830By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000831.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +1100832Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +0000833.Xr ssh 1 .
834The argument must be
835.Dq yes ,
836.Dq without-password ,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100837.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000838or
839.Dq no .
840The default is
841.Dq yes .
842.Pp
843If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100844.Dq without-password ,
Darren Tucker9dca0992005-02-01 19:16:45 +1100845password authentication is disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000846.Pp
847If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100848.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000849root login with public key authentication will be allowed,
850but only if the
851.Ar command
852option has been specified
853(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +1000854normally not allowed).
855All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000856.Pp
857If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100858.Dq no ,
Darren Tuckerb3509012005-01-20 11:01:46 +1100859root is not allowed to log in.
Damien Millerd27b9472005-12-13 19:29:02 +1100860.It Cm PermitTunnel
861Specifies whether
862.Xr tun 4
863device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +1100864The argument must be
865.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +1000866.Dq point-to-point
867(layer 3),
868.Dq ethernet
869(layer 2), or
Damien Miller7b58e802005-12-13 19:33:19 +1100870.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +1000871Specifying
872.Dq yes
873permits both
874.Dq point-to-point
875and
876.Dq ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +1100877The default is
878.Dq no .
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000879.It Cm PermitUserEnvironment
880Specifies whether
881.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000882and
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000883.Cm environment=
884options in
885.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000886are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +1100887.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000888The default is
889.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000890Enabling environment processing may enable users to bypass access
891restrictions in some configurations using mechanisms such as
892.Ev LD_PRELOAD .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000893.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +0000894Specifies the file that contains the process ID of the
Damien Millerf4f22b52006-03-15 11:57:25 +1100895SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000896The default is
897.Pa /var/run/sshd.pid .
898.It Cm Port
899Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100900.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000901listens on.
902The default is 22.
903Multiple options of this type are permitted.
904See also
905.Cm ListenAddress .
906.It Cm PrintLastLog
907Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100908.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +1100909should print the date and time of the last user login when a user logs
910in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000911The default is
912.Dq yes .
913.It Cm PrintMotd
914Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100915.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000916should print
917.Pa /etc/motd
918when a user logs in interactively.
919(On some systems it is also printed by the shell,
920.Pa /etc/profile ,
921or equivalent.)
922The default is
923.Dq yes .
924.It Cm Protocol
925Specifies the protocol versions
Damien Miller5b0d63f2006-03-15 11:56:56 +1100926.Xr sshd 8
Ben Lindstrom9c445542002-07-11 03:59:18 +0000927supports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000928The possible values are
Damien Miller5b0d63f2006-03-15 11:56:56 +1100929.Sq 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000930and
Damien Miller5b0d63f2006-03-15 11:56:56 +1100931.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000932Multiple versions must be comma-separated.
933The default is
Darren Tucker7a4a7652009-10-11 21:51:40 +1100934.Sq 2 .
Ben Lindstrom9c445542002-07-11 03:59:18 +0000935Note that the order of the protocol list does not indicate preference,
936because the client selects among multiple protocol versions offered
937by the server.
938Specifying
939.Dq 2,1
940is identical to
941.Dq 1,2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000942.It Cm PubkeyAuthentication
943Specifies whether public key authentication is allowed.
944The default is
945.Dq yes .
946Note that this option applies to protocol version 2 only.
Damien Miller1aed65e2010-03-04 21:53:35 +1100947.It Cm RevokedKeys
948Specifies a list of revoked public keys.
949Keys listed in this file will be refused for public key authentication.
950Note that if this file is not readable, then public key authentication will
951be refused for all users.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000952.It Cm RhostsRSAAuthentication
953Specifies whether rhosts or /etc/hosts.equiv authentication together
954with successful RSA host authentication is allowed.
955The default is
956.Dq no .
957This option applies to protocol version 1 only.
958.It Cm RSAAuthentication
959Specifies whether pure RSA authentication is allowed.
960The default is
961.Dq yes .
962This option applies to protocol version 1 only.
963.It Cm ServerKeyBits
964Defines the number of bits in the ephemeral protocol version 1 server key.
Darren Tucker7499b0c2008-07-02 22:35:43 +1000965The minimum value is 512, and the default is 1024.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000966.It Cm StrictModes
967Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100968.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000969should check file modes and ownership of the
970user's files and home directory before accepting login.
971This is normally desirable because novices sometimes accidentally leave their
972directory or files world-writable.
973The default is
974.Dq yes .
Darren Tuckerf788a912010-01-08 17:06:47 +1100975Note that this does not apply to
976.Cm ChrootDirectory ,
977whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000978.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +1100979Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +1000980Arguments should be a subsystem name and a command (with optional arguments)
981to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100982.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000983The command
984.Xr sftp-server 8
985implements the
986.Dq sftp
987file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100988.Pp
989Alternately the name
990.Dq internal-sftp
991implements an in-process
992.Dq sftp
993server.
994This may simplify configurations using
995.Cm ChrootDirectory
996to force a different filesystem root on clients.
997.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000998By default no subsystems are defined.
999Note that this option applies to protocol version 2 only.
1000.It Cm SyslogFacility
1001Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001002.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001003The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1004LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1005The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001006.It Cm TCPKeepAlive
1007Specifies whether the system should send TCP keepalive messages to the
1008other side.
1009If they are sent, death of the connection or crash of one
1010of the machines will be properly noticed.
1011However, this means that
1012connections will die if the route is down temporarily, and some people
1013find it annoying.
1014On the other hand, if TCP keepalives are not sent,
1015sessions may hang indefinitely on the server, leaving
1016.Dq ghost
1017users and consuming server resources.
1018.Pp
1019The default is
1020.Dq yes
1021(to send TCP keepalive messages), and the server will notice
1022if the network goes down or the client host crashes.
1023This avoids infinitely hanging sessions.
1024.Pp
1025To disable TCP keepalive messages, the value should be set to
1026.Dq no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001027.It Cm TrustedUserCAKeys
1028Specifies a file containing public keys of certificate authorities that are
Damien Millerc6db99e2010-03-05 10:41:45 +11001029trusted to sign user certificates for authentication.
Damien Miller72b33822010-03-05 07:39:01 +11001030Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001031.Ql #
1032are allowed.
1033If a certificate is presented for authentication and has its signing CA key
1034listed in this file, then it may be used for authentication for any user
1035listed in the certificate's principals list.
1036Note that certificates that lack a list of principals will not be permitted
1037for authentication using
1038.Cm TrustedUserCAKeys .
Damien Miller72b33822010-03-05 07:39:01 +11001039For more details on certificates, see the
Damien Miller1aed65e2010-03-04 21:53:35 +11001040.Sx CERTIFICATES
1041section in
1042.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001043.It Cm UseDNS
1044Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001045.Xr sshd 8
Darren Tucker83d5a982005-03-31 21:33:50 +10001046should look up the remote host name and check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001047the resolved host name for the remote IP address maps back to the
1048very same IP address.
1049The default is
1050.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001051.It Cm UseLogin
1052Specifies whether
1053.Xr login 1
1054is used for interactive login sessions.
1055The default is
1056.Dq no .
1057Note that
1058.Xr login 1
1059is never used for remote command execution.
1060Note also, that if this is enabled,
1061.Cm X11Forwarding
1062will be disabled because
1063.Xr login 1
1064does not know how to handle
1065.Xr xauth 1
Damien Miller495dca32003-04-01 21:42:14 +10001066cookies.
1067If
Ben Lindstrom9f049032002-06-21 00:59:05 +00001068.Cm UsePrivilegeSeparation
1069is specified, it will be disabled after authentication.
Damien Miller2e193e22003-05-14 15:13:03 +10001070.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001071Enables the Pluggable Authentication Module interface.
1072If set to
1073.Dq yes
1074this will enable PAM authentication using
1075.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001076and
1077.Cm PasswordAuthentication
1078in addition to PAM account and session module processing for all
1079authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001080.Pp
1081Because PAM challenge-response authentication usually serves an equivalent
1082role to password authentication, you should disable either
1083.Cm PasswordAuthentication
1084or
1085.Cm ChallengeResponseAuthentication.
1086.Pp
1087If
1088.Cm UsePAM
1089is enabled, you will not be able to run
1090.Xr sshd 8
1091as a non-root user.
1092The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +10001093.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001094.It Cm UsePrivilegeSeparation
1095Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001096.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001097separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +10001098to deal with incoming network traffic.
1099After successful authentication, another process will be created that has
1100the privilege of the authenticated user.
1101The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +00001102escalation by containing any corruption within the unprivileged processes.
1103The default is
1104.Dq yes .
Damien Miller69ff1df2011-06-23 08:30:03 +10001105If
1106.Cm UsePrivilegeSeparation
1107is set to
1108.Dq sandbox
1109then the pre-authentication unprivileged process is subject to additional
1110restrictions.
Damien Miller23528812012-04-22 11:24:43 +10001111.It Cm VersionAddendum
1112Optionally specifies additional text to append to the SSH protocol banner
1113sent by the server upon connection.
1114The default is
1115.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001116.It Cm X11DisplayOffset
1117Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001118.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001119X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001120This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001121The default is 10.
1122.It Cm X11Forwarding
1123Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001124The argument must be
1125.Dq yes
1126or
1127.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001128The default is
1129.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +10001130.Pp
1131When X11 forwarding is enabled, there may be additional exposure to
1132the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001133.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001134proxy display is configured to listen on the wildcard address (see
1135.Cm X11UseLocalhost
Damien Miller5b0d63f2006-03-15 11:56:56 +11001136below), though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001137Additionally, the authentication spoofing and authentication data
1138verification and substitution occur on the client side.
1139The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001140display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001141forwarding (see the warnings for
1142.Cm ForwardX11
1143in
Damien Millerf1ce5052003-06-11 22:04:39 +10001144.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001145A system administrator may have a stance in which they want to
1146protect clients that may expose themselves to attack by unwittingly
1147requesting X11 forwarding, which can warrant a
1148.Dq no
1149setting.
1150.Pp
1151Note that disabling X11 forwarding does not prevent users from
1152forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001153X11 forwarding is automatically disabled if
1154.Cm UseLogin
1155is enabled.
1156.It Cm X11UseLocalhost
1157Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001158.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001159should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001160the wildcard address.
1161By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001162sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001163hostname part of the
1164.Ev DISPLAY
1165environment variable to
1166.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001167This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001168However, some older X11 clients may not function with this
1169configuration.
1170.Cm X11UseLocalhost
1171may be set to
1172.Dq no
1173to specify that the forwarding server should be bound to the wildcard
1174address.
1175The argument must be
1176.Dq yes
1177or
1178.Dq no .
1179The default is
1180.Dq yes .
1181.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001182Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001183.Xr xauth 1
1184program.
1185The default is
1186.Pa /usr/X11R6/bin/xauth .
1187.El
Damien Millere3beba22006-03-15 11:59:25 +11001188.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001189.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001190command-line arguments and configuration file options that specify time
1191may be expressed using a sequence of the form:
1192.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001193.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001194.Sm on
1195where
1196.Ar time
1197is a positive integer value and
1198.Ar qualifier
1199is one of the following:
1200.Pp
1201.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001202.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001203seconds
1204.It Cm s | Cm S
1205seconds
1206.It Cm m | Cm M
1207minutes
1208.It Cm h | Cm H
1209hours
1210.It Cm d | Cm D
1211days
1212.It Cm w | Cm W
1213weeks
1214.El
1215.Pp
1216Each member of the sequence is added together to calculate
1217the total time value.
1218.Pp
1219Time format examples:
1220.Pp
1221.Bl -tag -width Ds -compact -offset indent
1222.It 600
1223600 seconds (10 minutes)
1224.It 10m
122510 minutes
1226.It 1h30m
12271 hour 30 minutes (90 minutes)
1228.El
1229.Sh FILES
1230.Bl -tag -width Ds
1231.It Pa /etc/ssh/sshd_config
1232Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001233.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001234This file should be writable by root only, but it is recommended
1235(though not necessary) that it be world-readable.
1236.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001237.Sh SEE ALSO
1238.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001239.Sh AUTHORS
1240OpenSSH is a derivative of the original and free
1241ssh 1.2.12 release by Tatu Ylonen.
1242Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1243Theo de Raadt and Dug Song
1244removed many bugs, re-added newer features and
1245created OpenSSH.
1246Markus Friedl contributed the support for SSH
1247protocol versions 1.5 and 2.0.
1248Niels Provos and Markus Friedl contributed support
1249for privilege separation.