blob: 70a53b3a903c5c8b5f08afe8d35b769f7b75da34 [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 Millerb9132fc2011-05-29 21:41:40 +100036.\" $OpenBSD: sshd_config.5,v 1.133 2011/05/23 07:10:21 jmc Exp $
Damien Millerd8478b62011-05-29 21:39:36 +100037.Dd $Mdocdate: May 23 2011 $
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.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000154.It Cm AuthorizedKeysFile
155Specifies the file that contains the public keys that can be used
156for user authentication.
Damien Miller6018a362010-07-02 13:35:19 +1000157The format is described in the
158.Sx AUTHORIZED_KEYS FILE FORMAT
159section of
160.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000161.Cm AuthorizedKeysFile
162may contain tokens of the form %T which are substituted during connection
Damien Miller5b0d63f2006-03-15 11:56:56 +1100163setup.
Damien Millerfbf486b2003-05-23 18:44:23 +1000164The following tokens are defined: %% is replaced by a literal '%',
Damien Miller5b0d63f2006-03-15 11:56:56 +1100165%h is replaced by the home directory of the user being authenticated, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000166%u is replaced by the username of that user.
167After expansion,
168.Cm AuthorizedKeysFile
169is taken to be an absolute path or one relative to the user's home
170directory.
Damien Millerb9132fc2011-05-29 21:41:40 +1000171Multiple files may be listed, separated by whitespace.
172The default is
173.Dq .ssh/authorized_keys .ssh/authorized_keys2 .
Damien Miller30da3442010-05-10 11:58:03 +1000174.It Cm AuthorizedPrincipalsFile
175Specifies a file that lists principal names that are accepted for
176certificate authentication.
177When using certificates signed by a key listed in
178.Cm TrustedUserCAKeys ,
179this file lists names, one of which must appear in the certificate for it
180to be accepted for authentication.
Damien Millerd59dab82010-07-02 13:37:17 +1000181Names are listed one per line preceded by key options (as described
Damien Miller6018a362010-07-02 13:35:19 +1000182in
183.Sx AUTHORIZED_KEYS FILE FORMAT
184in
Damien Millerd59dab82010-07-02 13:37:17 +1000185.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000186Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000187.Ql #
188are ignored.
189.Pp
190.Cm AuthorizedPrincipalsFile
191may contain tokens of the form %T which are substituted during connection
192setup.
193The following tokens are defined: %% is replaced by a literal '%',
194%h is replaced by the home directory of the user being authenticated, and
195%u is replaced by the username of that user.
196After expansion,
197.Cm AuthorizedPrincipalsFile
198is taken to be an absolute path or one relative to the user's home
199directory.
200.Pp
Damien Miller81d3fc52010-05-10 11:58:45 +1000201The default is not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000202of the user must appear in a certificate's principals list for it to be
203accepted.
204Note that
205.Cm AuthorizedPrincipalsFile
206is only used when authentication proceeds using a CA listed in
207.Cm TrustedUserCAKeys
208and is not consulted for certification authorities trusted via
209.Pa ~/.ssh/authorized_keys ,
210though the
211.Cm principals=
212key option offers a similar facility (see
213.Xr sshd 8
214for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000215.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000216The contents of the specified file are sent to the remote user before
217authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000218If the argument is
219.Dq none
220then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000221This option is only available for protocol version 2.
222By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000223.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000224Specifies whether challenge-response authentication is allowed (e.g. via
225PAM or though authentication styles supported in
226.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000227The default is
228.Dq yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100229.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100230Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100231.Xr chroot 2
232to after authentication.
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100233All components of the pathname must be root-owned directories that are
Damien Millerd8cb1f12008-02-10 22:40:12 +1100234not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000235After the chroot,
236.Xr sshd 8
237changes the working directory to the user's home directory.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100238.Pp
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100239The pathname may contain the following tokens that are expanded at runtime once
Damien Millerd8cb1f12008-02-10 22:40:12 +1100240the connecting user has been authenticated: %% is replaced by a literal '%',
241%h is replaced by the home directory of the user being authenticated, and
242%u is replaced by the username of that user.
243.Pp
244The
245.Cm ChrootDirectory
246must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000247user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100248For an interactive session this requires at least a shell, typically
249.Xr sh 1 ,
250and basic
251.Pa /dev
252nodes such as
253.Xr null 4 ,
254.Xr zero 4 ,
255.Xr stdin 4 ,
256.Xr stdout 4 ,
257.Xr stderr 4 ,
258.Xr arandom 4
259and
260.Xr tty 4
261devices.
262For file transfer sessions using
Darren Tuckerf92077f2009-06-21 17:56:25 +1000263.Dq sftp ,
Damien Millerd8cb1f12008-02-10 22:40:12 +1100264no additional configuration of the environment is necessary if the
Darren Tuckerf92077f2009-06-21 17:56:25 +1000265in-process sftp server is used,
266though sessions which use logging do require
Darren Tucker00fcd712009-06-21 17:56:00 +1000267.Pa /dev/log
268inside the chroot directory (see
269.Xr sftp-server 8
270for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100271.Pp
272The default is not to
273.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000274.It Cm Ciphers
275Specifies the ciphers allowed for protocol version 2.
276Multiple ciphers must be comma-separated.
Damien Miller05202ff2004-06-15 10:30:39 +1000277The supported ciphers are
278.Dq 3des-cbc ,
279.Dq aes128-cbc ,
280.Dq aes192-cbc ,
281.Dq aes256-cbc ,
282.Dq aes128-ctr ,
283.Dq aes192-ctr ,
284.Dq aes256-ctr ,
Damien Miller3710f272005-05-26 12:19:17 +1000285.Dq arcfour128 ,
286.Dq arcfour256 ,
Damien Miller05202ff2004-06-15 10:30:39 +1000287.Dq arcfour ,
288.Dq blowfish-cbc ,
289and
290.Dq cast128-cbc .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100291The default is:
292.Bd -literal -offset 3n
Damien Miller9aa72ba2009-01-28 16:34:00 +1100293aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,
294aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,
295aes256-cbc,arcfour
Ben Lindstrom9f049032002-06-21 00:59:05 +0000296.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +0000297.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100298Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000299sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100300.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000301receiving any messages back from the client.
302If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100303sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000304It is important to note that the use of client alive messages is very
305different from
Damien Miller12c150e2003-12-17 16:31:10 +1100306.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000307(below).
308The client alive messages are sent through the encrypted channel
309and therefore will not be spoofable.
310The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100311.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000312is spoofable.
313The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000314server depend on knowing when a connection has become inactive.
315.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000316The default value is 3.
317If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000318.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100319(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000320.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100321is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000322will be disconnected after approximately 45 seconds.
Damien Millercc3e8ba2006-03-15 12:06:55 +1100323This option applies to protocol version 2 only.
Damien Miller1594ad52005-05-26 12:12:19 +1000324.It Cm ClientAliveInterval
325Sets a timeout interval in seconds after which if no data has been received
326from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100327.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000328will send a message through the encrypted
329channel to request a response from the client.
330The default
331is 0, indicating that these messages will not be sent to the client.
332This option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000333.It Cm Compression
Damien Miller9786e6e2005-07-26 21:54:56 +1000334Specifies whether compression is allowed, or delayed until
335the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000336The argument must be
Damien Miller9786e6e2005-07-26 21:54:56 +1000337.Dq yes ,
338.Dq delayed ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000339or
340.Dq no .
341The default is
Damien Miller9786e6e2005-07-26 21:54:56 +1000342.Dq delayed .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000343.It Cm DenyGroups
344This keyword can be followed by a list of group name patterns, separated
345by spaces.
346Login is disallowed for users whose primary group or supplementary
347group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000348Only group names are valid; a numerical group ID is not recognized.
349By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100350The allow/deny directives are processed in the following order:
351.Cm DenyUsers ,
352.Cm AllowUsers ,
353.Cm DenyGroups ,
354and finally
355.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100356.Pp
357See
358.Sx PATTERNS
359in
360.Xr ssh_config 5
361for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000362.It Cm DenyUsers
363This keyword can be followed by a list of user name patterns, separated
364by spaces.
365Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000366Only user names are valid; a numerical user ID is not recognized.
367By default, login is allowed for all users.
368If the pattern takes the form USER@HOST then USER and HOST
369are separately checked, restricting logins to particular
370users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100371The allow/deny directives are processed in the following order:
372.Cm DenyUsers ,
373.Cm AllowUsers ,
374.Cm DenyGroups ,
375and finally
376.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100377.Pp
378See
379.Sx PATTERNS
380in
381.Xr ssh_config 5
382for more information on patterns.
Damien Millere2754432006-07-24 14:06:47 +1000383.It Cm ForceCommand
384Forces the execution of the command specified by
385.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100386ignoring any command supplied by the client and
387.Pa ~/.ssh/rc
388if present.
Damien Millere2754432006-07-24 14:06:47 +1000389The command is invoked by using the user's login shell with the -c option.
390This applies to shell, command, or subsystem execution.
391It is most useful inside a
392.Cm Match
393block.
394The command originally supplied by the client is available in the
395.Ev SSH_ORIGINAL_COMMAND
396environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100397Specifying a command of
398.Dq internal-sftp
399will force the use of an in-process sftp server that requires no support
400files when used with
401.Cm ChrootDirectory .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000402.It Cm GatewayPorts
403Specifies whether remote hosts are allowed to connect to ports
404forwarded for the client.
405By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100406.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000407binds remote port forwardings to the loopback address.
408This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000409.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100410can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100411should allow remote port forwardings to bind to non-loopback addresses, thus
412allowing other hosts to connect.
413The argument may be
414.Dq no
415to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000416.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100417to force remote port forwardings to bind to the wildcard address, or
418.Dq clientspecified
419to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000420The default is
421.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000422.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000423Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100424The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000425.Dq no .
426Note that this option applies to protocol version 2 only.
427.It Cm GSSAPICleanupCredentials
428Specifies whether to automatically destroy the user's credentials cache
429on logout.
430The default is
431.Dq yes .
432Note that this option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000433.It Cm HostbasedAuthentication
434Specifies whether rhosts or /etc/hosts.equiv authentication together
435with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100436(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000437This option is similar to
438.Cm RhostsRSAAuthentication
439and applies to protocol version 2 only.
440The default is
441.Dq no .
Damien Millerb594f382006-08-30 11:06:34 +1000442.It Cm HostbasedUsesNameFromPacketOnly
443Specifies whether or not the server will attempt to perform a reverse
444name lookup when matching the name in the
445.Pa ~/.shosts ,
446.Pa ~/.rhosts ,
447and
448.Pa /etc/hosts.equiv
449files during
450.Cm HostbasedAuthentication .
451A setting of
452.Dq yes
453means that
454.Xr sshd 8
455uses the name supplied by the client rather than
456attempting to resolve the name from the TCP connection itself.
457The default is
458.Dq no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100459.It Cm HostCertificate
460Specifies a file containing a public host certificate.
461The certificate's public key must match a private host key already specified
462by
463.Cm HostKey .
464The default behaviour of
465.Xr sshd 8
466is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000467.It Cm HostKey
468Specifies a file containing a private host key
469used by SSH.
470The default is
471.Pa /etc/ssh/ssh_host_key
472for protocol version 1, and
Damien Millereb8b60e2010-08-31 22:41:14 +1000473.Pa /etc/ssh/ssh_host_dsa_key ,
474.Pa /etc/ssh/ssh_host_ecdsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000475and
Damien Millereb8b60e2010-08-31 22:41:14 +1000476.Pa /etc/ssh/ssh_host_rsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000477for protocol version 2.
478Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100479.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000480will refuse to use a file if it is group/world-accessible.
481It is possible to have multiple host key files.
482.Dq rsa1
483keys are used for version 1 and
Damien Millereb8b60e2010-08-31 22:41:14 +1000484.Dq dsa ,
485.Dq ecdsa
Ben Lindstrom9f049032002-06-21 00:59:05 +0000486or
487.Dq rsa
488are used for version 2 of the SSH protocol.
489.It Cm IgnoreRhosts
490Specifies that
491.Pa .rhosts
492and
493.Pa .shosts
494files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000495.Cm RhostsRSAAuthentication
496or
497.Cm HostbasedAuthentication .
498.Pp
499.Pa /etc/hosts.equiv
500and
501.Pa /etc/shosts.equiv
502are still used.
503The default is
504.Dq yes .
505.It Cm IgnoreUserKnownHosts
506Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100507.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000508should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000509.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000510during
511.Cm RhostsRSAAuthentication
512or
513.Cm HostbasedAuthentication .
514The default is
515.Dq no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100516.It Cm IPQoS
517Specifies the IPv4 type-of-service or DSCP class for the connection.
518Accepted values are
519.Dq af11 ,
520.Dq af12 ,
521.Dq af13 ,
522.Dq af14 ,
523.Dq af22 ,
524.Dq af23 ,
525.Dq af31 ,
526.Dq af32 ,
527.Dq af33 ,
528.Dq af41 ,
529.Dq af42 ,
530.Dq af43 ,
531.Dq cs0 ,
532.Dq cs1 ,
533.Dq cs2 ,
534.Dq cs3 ,
535.Dq cs4 ,
536.Dq cs5 ,
537.Dq cs6 ,
538.Dq cs7 ,
539.Dq ef ,
540.Dq lowdelay ,
541.Dq throughput ,
542.Dq reliability ,
543or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +1100544This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100545If one argument is specified, it is used as the packet class unconditionally.
546If two values are specified, the first is automatically selected for
547interactive sessions and the second for non-interactive sessions.
548The default is
549.Dq lowdelay
550for interactive sessions and
551.Dq throughput
552for non-interactive sessions.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000553.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000554Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000555.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000556will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000557To use this option, the server needs a
558Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100559The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000560.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100561.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000562If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100563an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100564The default is
Damien Miller8448e662004-03-08 23:13:15 +1100565.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000566.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100567If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000568the password will be validated via any additional local mechanism
569such as
570.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100571The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000572.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000573.It Cm KerberosTicketCleanup
574Specifies whether to automatically destroy the user's ticket cache
575file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100576The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000577.Dq yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000578.It Cm KexAlgorithms
579Specifies the available KEX (Key Exchange) algorithms.
580Multiple algorithms must be comma-separated.
581The default is
582.Dq ecdh-sha2-nistp256 ,
583.Dq ecdh-sha2-nistp384 ,
584.Dq ecdh-sha2-nistp521 ,
Damien Miller0a184732010-11-20 15:21:03 +1100585.Dq diffie-hellman-group-exchange-sha256 ,
Damien Millerd5f62bf2010-09-24 22:11:14 +1000586.Dq diffie-hellman-group-exchange-sha1 ,
587.Dq diffie-hellman-group14-sha1 ,
588.Dq diffie-hellman-group1-sha1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000589.It Cm KeyRegenerationInterval
590In protocol version 1, the ephemeral server key is automatically regenerated
591after this many seconds (if it has been used).
592The purpose of regeneration is to prevent
593decrypting captured sessions by later breaking into the machine and
594stealing the keys.
595The key is never stored anywhere.
596If the value is 0, the key is never regenerated.
597The default is 3600 (seconds).
598.It Cm ListenAddress
599Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100600.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000601should listen on.
602The following forms may be used:
603.Pp
604.Bl -item -offset indent -compact
605.It
606.Cm ListenAddress
607.Sm off
608.Ar host No | Ar IPv4_addr No | Ar IPv6_addr
609.Sm on
610.It
611.Cm ListenAddress
612.Sm off
613.Ar host No | Ar IPv4_addr No : Ar port
614.Sm on
615.It
616.Cm ListenAddress
617.Sm off
618.Oo
619.Ar host No | Ar IPv6_addr Oc : Ar port
620.Sm on
621.El
622.Pp
623If
624.Ar port
625is not specified,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100626sshd will listen on the address and all prior
Ben Lindstrom9f049032002-06-21 00:59:05 +0000627.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000628options specified.
629The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000630Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000631.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000632options are permitted.
633Additionally, any
Ben Lindstrom9f049032002-06-21 00:59:05 +0000634.Cm Port
Damien Miller5b0d63f2006-03-15 11:56:56 +1100635options must precede this option for non-port qualified addresses.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000636.It Cm LoginGraceTime
637The server disconnects after this time if the user has not
638successfully logged in.
639If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000640The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000641.It Cm LogLevel
642Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100643.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000644The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100645QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000646The default is INFO.
647DEBUG and DEBUG1 are equivalent.
648DEBUG2 and DEBUG3 each specify higher levels of debugging output.
649Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000650.It Cm MACs
651Specifies the available MAC (message authentication code) algorithms.
652The MAC algorithm is used in protocol version 2
653for data integrity protection.
654Multiple algorithms must be comma-separated.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100655The default is:
Damien Miller22b7b492007-06-11 14:07:12 +1000656.Bd -literal -offset indent
657hmac-md5,hmac-sha1,umac-64@openssh.com,
658hmac-ripemd160,hmac-sha1-96,hmac-md5-96
659.Ed
Darren Tucker45150472006-07-12 22:34:17 +1000660.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +1000661Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +1000662If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +1000663.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000664line are satisfied, the keywords on the following lines override those
665set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +1000666.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000667line or the end of the file.
Darren Tucker7a3935d2008-06-10 22:59:10 +1000668.Pp
Damien Millerd04f3572006-07-24 13:46:50 +1000669The arguments to
Darren Tucker45150472006-07-12 22:34:17 +1000670.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000671are one or more criteria-pattern pairs.
Darren Tucker45150472006-07-12 22:34:17 +1000672The available criteria are
673.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +1000674.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +1000675.Cm Host ,
676and
677.Cm Address .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000678The match patterns may consist of single entries or comma-separated
679lists and may use the wildcard and negation operators described in the
Darren Tuckerb06cc4a2008-06-10 22:59:53 +1000680.Sx PATTERNS
Darren Tucker7a3935d2008-06-10 22:59:10 +1000681section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +1000682.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000683.Pp
684The patterns in an
685.Cm Address
686criteria may additionally contain addresses to match in CIDR
Darren Tucker6a2a4002008-06-10 23:03:04 +1000687address/masklen format, e.g.\&
Darren Tucker7a3935d2008-06-10 22:59:10 +1000688.Dq 192.0.2.0/24
689or
690.Dq 3ffe:ffff::/32 .
691Note that the mask length provided must be consistent with the address -
692it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +1000693or one with bits set in this host portion of the address.
694For example,
Darren Tucker7a3935d2008-06-10 22:59:10 +1000695.Dq 192.0.2.0/33
696and
Darren Tucker6a2a4002008-06-10 23:03:04 +1000697.Dq 192.0.2.0/8
Darren Tucker7a3935d2008-06-10 22:59:10 +1000698respectively.
699.Pp
Darren Tucker45150472006-07-12 22:34:17 +1000700Only a subset of keywords may be used on the lines following a
701.Cm Match
702keyword.
703Available keywords are
Damien Miller17819012009-01-28 16:20:17 +1100704.Cm AllowAgentForwarding ,
Damien Miller9b439df2006-07-24 14:04:00 +1000705.Cm AllowTcpForwarding ,
Damien Millerab6de352010-06-26 09:38:45 +1000706.Cm AuthorizedKeysFile ,
707.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +1100708.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +1000709.Cm ChrootDirectory ,
Damien Millere2754432006-07-24 14:06:47 +1000710.Cm ForceCommand ,
Damien Miller9b439df2006-07-24 14:04:00 +1000711.Cm GatewayPorts ,
Damien Miller25434de2008-05-19 14:29:08 +1000712.Cm GSSAPIAuthentication ,
713.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +1000714.Cm HostbasedUsesNameFromPacketOnly ,
Darren Tucker1d75f222007-03-01 21:31:28 +1100715.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +1100716.Cm KerberosAuthentication ,
Damien Miller307c1d12008-06-16 07:56:20 +1000717.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +1000718.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +1100719.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +1100720.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +1000721.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +1100722.Cm PermitRootLogin ,
Damien Millerab6de352010-06-26 09:38:45 +1000723.Cm PermitTunnel ,
Darren Tucker1477ea12009-10-07 08:36:05 +1100724.Cm PubkeyAuthentication ,
Darren Tucker1629c072007-02-19 22:25:37 +1100725.Cm RhostsRSAAuthentication ,
726.Cm RSAAuthentication ,
Damien Millerd1de9952006-07-24 14:05:48 +1000727.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +1100728.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +1000729and
Damien Miller0296ae82009-02-23 11:00:24 +1100730.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +1000731.It Cm MaxAuthTries
732Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +1000733connection.
734Once the number of failures reaches half this value,
735additional failures are logged.
736The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +1000737.It Cm MaxSessions
738Specifies the maximum number of open sessions permitted per network connection.
739The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000740.It Cm MaxStartups
741Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +1100742SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000743Additional connections will be dropped until authentication succeeds or the
744.Cm LoginGraceTime
745expires for a connection.
746The default is 10.
747.Pp
748Alternatively, random early drop can be enabled by specifying
749the three colon separated values
750.Dq start:rate:full
Damien Miller208f1ed2006-03-15 11:56:03 +1100751(e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +1100752.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000753will refuse connection attempts with a probability of
754.Dq rate/100
755(30%)
756if there are currently
757.Dq start
758(10)
759unauthenticated connections.
760The probability increases linearly and all connection attempts
761are refused if the number of unauthenticated connections reaches
762.Dq full
763(60).
764.It Cm PasswordAuthentication
765Specifies whether password authentication is allowed.
766The default is
767.Dq yes .
768.It Cm PermitEmptyPasswords
769When password authentication is allowed, it specifies whether the
770server allows login to accounts with empty password strings.
771The default is
772.Dq no .
Damien Miller9b439df2006-07-24 14:04:00 +1000773.It Cm PermitOpen
774Specifies the destinations to which TCP port forwarding is permitted.
775The forwarding specification must be one of the following forms:
776.Pp
777.Bl -item -offset indent -compact
778.It
779.Cm PermitOpen
780.Sm off
781.Ar host : port
782.Sm on
783.It
784.Cm PermitOpen
785.Sm off
786.Ar IPv4_addr : port
787.Sm on
788.It
789.Cm PermitOpen
790.Sm off
791.Ar \&[ IPv6_addr \&] : port
792.Sm on
793.El
794.Pp
Damien Millera765cf42006-07-24 14:08:13 +1000795Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +1000796An argument of
797.Dq any
798can be used to remove all restrictions and permit any forwarding requests.
Damien Miller65bc2c42006-07-24 14:04:16 +1000799By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000800.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +1100801Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +0000802.Xr ssh 1 .
803The argument must be
804.Dq yes ,
805.Dq without-password ,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100806.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000807or
808.Dq no .
809The default is
810.Dq yes .
811.Pp
812If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100813.Dq without-password ,
Darren Tucker9dca0992005-02-01 19:16:45 +1100814password authentication is disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000815.Pp
816If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100817.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000818root login with public key authentication will be allowed,
819but only if the
820.Ar command
821option has been specified
822(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +1000823normally not allowed).
824All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000825.Pp
826If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100827.Dq no ,
Darren Tuckerb3509012005-01-20 11:01:46 +1100828root is not allowed to log in.
Damien Millerd27b9472005-12-13 19:29:02 +1100829.It Cm PermitTunnel
830Specifies whether
831.Xr tun 4
832device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +1100833The argument must be
834.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +1000835.Dq point-to-point
836(layer 3),
837.Dq ethernet
838(layer 2), or
Damien Miller7b58e802005-12-13 19:33:19 +1100839.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +1000840Specifying
841.Dq yes
842permits both
843.Dq point-to-point
844and
845.Dq ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +1100846The default is
847.Dq no .
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000848.It Cm PermitUserEnvironment
849Specifies whether
850.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000851and
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000852.Cm environment=
853options in
854.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000855are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +1100856.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000857The default is
858.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000859Enabling environment processing may enable users to bypass access
860restrictions in some configurations using mechanisms such as
861.Ev LD_PRELOAD .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000862.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +0000863Specifies the file that contains the process ID of the
Damien Millerf4f22b52006-03-15 11:57:25 +1100864SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000865The default is
866.Pa /var/run/sshd.pid .
867.It Cm Port
868Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100869.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000870listens on.
871The default is 22.
872Multiple options of this type are permitted.
873See also
874.Cm ListenAddress .
875.It Cm PrintLastLog
876Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100877.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +1100878should print the date and time of the last user login when a user logs
879in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000880The default is
881.Dq yes .
882.It Cm PrintMotd
883Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100884.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000885should print
886.Pa /etc/motd
887when a user logs in interactively.
888(On some systems it is also printed by the shell,
889.Pa /etc/profile ,
890or equivalent.)
891The default is
892.Dq yes .
893.It Cm Protocol
894Specifies the protocol versions
Damien Miller5b0d63f2006-03-15 11:56:56 +1100895.Xr sshd 8
Ben Lindstrom9c445542002-07-11 03:59:18 +0000896supports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000897The possible values are
Damien Miller5b0d63f2006-03-15 11:56:56 +1100898.Sq 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000899and
Damien Miller5b0d63f2006-03-15 11:56:56 +1100900.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000901Multiple versions must be comma-separated.
902The default is
Darren Tucker7a4a7652009-10-11 21:51:40 +1100903.Sq 2 .
Ben Lindstrom9c445542002-07-11 03:59:18 +0000904Note that the order of the protocol list does not indicate preference,
905because the client selects among multiple protocol versions offered
906by the server.
907Specifying
908.Dq 2,1
909is identical to
910.Dq 1,2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000911.It Cm PubkeyAuthentication
912Specifies whether public key authentication is allowed.
913The default is
914.Dq yes .
915Note that this option applies to protocol version 2 only.
Damien Miller1aed65e2010-03-04 21:53:35 +1100916.It Cm RevokedKeys
917Specifies a list of revoked public keys.
918Keys listed in this file will be refused for public key authentication.
919Note that if this file is not readable, then public key authentication will
920be refused for all users.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000921.It Cm RhostsRSAAuthentication
922Specifies whether rhosts or /etc/hosts.equiv authentication together
923with successful RSA host authentication is allowed.
924The default is
925.Dq no .
926This option applies to protocol version 1 only.
927.It Cm RSAAuthentication
928Specifies whether pure RSA authentication is allowed.
929The default is
930.Dq yes .
931This option applies to protocol version 1 only.
932.It Cm ServerKeyBits
933Defines the number of bits in the ephemeral protocol version 1 server key.
Darren Tucker7499b0c2008-07-02 22:35:43 +1000934The minimum value is 512, and the default is 1024.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000935.It Cm StrictModes
936Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100937.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000938should check file modes and ownership of the
939user's files and home directory before accepting login.
940This is normally desirable because novices sometimes accidentally leave their
941directory or files world-writable.
942The default is
943.Dq yes .
Darren Tuckerf788a912010-01-08 17:06:47 +1100944Note that this does not apply to
945.Cm ChrootDirectory ,
946whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000947.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +1100948Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +1000949Arguments should be a subsystem name and a command (with optional arguments)
950to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100951.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000952The command
953.Xr sftp-server 8
954implements the
955.Dq sftp
956file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100957.Pp
958Alternately the name
959.Dq internal-sftp
960implements an in-process
961.Dq sftp
962server.
963This may simplify configurations using
964.Cm ChrootDirectory
965to force a different filesystem root on clients.
966.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000967By default no subsystems are defined.
968Note that this option applies to protocol version 2 only.
969.It Cm SyslogFacility
970Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100971.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000972The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
973LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
974The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +1100975.It Cm TCPKeepAlive
976Specifies whether the system should send TCP keepalive messages to the
977other side.
978If they are sent, death of the connection or crash of one
979of the machines will be properly noticed.
980However, this means that
981connections will die if the route is down temporarily, and some people
982find it annoying.
983On the other hand, if TCP keepalives are not sent,
984sessions may hang indefinitely on the server, leaving
985.Dq ghost
986users and consuming server resources.
987.Pp
988The default is
989.Dq yes
990(to send TCP keepalive messages), and the server will notice
991if the network goes down or the client host crashes.
992This avoids infinitely hanging sessions.
993.Pp
994To disable TCP keepalive messages, the value should be set to
995.Dq no .
Damien Miller1aed65e2010-03-04 21:53:35 +1100996.It Cm TrustedUserCAKeys
997Specifies a file containing public keys of certificate authorities that are
Damien Millerc6db99e2010-03-05 10:41:45 +1100998trusted to sign user certificates for authentication.
Damien Miller72b33822010-03-05 07:39:01 +1100999Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001000.Ql #
1001are allowed.
1002If a certificate is presented for authentication and has its signing CA key
1003listed in this file, then it may be used for authentication for any user
1004listed in the certificate's principals list.
1005Note that certificates that lack a list of principals will not be permitted
1006for authentication using
1007.Cm TrustedUserCAKeys .
Damien Miller72b33822010-03-05 07:39:01 +11001008For more details on certificates, see the
Damien Miller1aed65e2010-03-04 21:53:35 +11001009.Sx CERTIFICATES
1010section in
1011.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001012.It Cm UseDNS
1013Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001014.Xr sshd 8
Darren Tucker83d5a982005-03-31 21:33:50 +10001015should look up the remote host name and check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001016the resolved host name for the remote IP address maps back to the
1017very same IP address.
1018The default is
1019.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001020.It Cm UseLogin
1021Specifies whether
1022.Xr login 1
1023is used for interactive login sessions.
1024The default is
1025.Dq no .
1026Note that
1027.Xr login 1
1028is never used for remote command execution.
1029Note also, that if this is enabled,
1030.Cm X11Forwarding
1031will be disabled because
1032.Xr login 1
1033does not know how to handle
1034.Xr xauth 1
Damien Miller495dca32003-04-01 21:42:14 +10001035cookies.
1036If
Ben Lindstrom9f049032002-06-21 00:59:05 +00001037.Cm UsePrivilegeSeparation
1038is specified, it will be disabled after authentication.
Damien Miller2e193e22003-05-14 15:13:03 +10001039.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001040Enables the Pluggable Authentication Module interface.
1041If set to
1042.Dq yes
1043this will enable PAM authentication using
1044.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001045and
1046.Cm PasswordAuthentication
1047in addition to PAM account and session module processing for all
1048authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001049.Pp
1050Because PAM challenge-response authentication usually serves an equivalent
1051role to password authentication, you should disable either
1052.Cm PasswordAuthentication
1053or
1054.Cm ChallengeResponseAuthentication.
1055.Pp
1056If
1057.Cm UsePAM
1058is enabled, you will not be able to run
1059.Xr sshd 8
1060as a non-root user.
1061The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +10001062.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001063.It Cm UsePrivilegeSeparation
1064Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001065.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001066separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +10001067to deal with incoming network traffic.
1068After successful authentication, another process will be created that has
1069the privilege of the authenticated user.
1070The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +00001071escalation by containing any corruption within the unprivileged processes.
1072The default is
1073.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001074.It Cm X11DisplayOffset
1075Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001076.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001077X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001078This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001079The default is 10.
1080.It Cm X11Forwarding
1081Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001082The argument must be
1083.Dq yes
1084or
1085.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001086The default is
1087.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +10001088.Pp
1089When X11 forwarding is enabled, there may be additional exposure to
1090the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001091.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001092proxy display is configured to listen on the wildcard address (see
1093.Cm X11UseLocalhost
Damien Miller5b0d63f2006-03-15 11:56:56 +11001094below), though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001095Additionally, the authentication spoofing and authentication data
1096verification and substitution occur on the client side.
1097The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001098display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001099forwarding (see the warnings for
1100.Cm ForwardX11
1101in
Damien Millerf1ce5052003-06-11 22:04:39 +10001102.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001103A system administrator may have a stance in which they want to
1104protect clients that may expose themselves to attack by unwittingly
1105requesting X11 forwarding, which can warrant a
1106.Dq no
1107setting.
1108.Pp
1109Note that disabling X11 forwarding does not prevent users from
1110forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001111X11 forwarding is automatically disabled if
1112.Cm UseLogin
1113is enabled.
1114.It Cm X11UseLocalhost
1115Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001116.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001117should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001118the wildcard address.
1119By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001120sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001121hostname part of the
1122.Ev DISPLAY
1123environment variable to
1124.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001125This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001126However, some older X11 clients may not function with this
1127configuration.
1128.Cm X11UseLocalhost
1129may be set to
1130.Dq no
1131to specify that the forwarding server should be bound to the wildcard
1132address.
1133The argument must be
1134.Dq yes
1135or
1136.Dq no .
1137The default is
1138.Dq yes .
1139.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001140Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001141.Xr xauth 1
1142program.
1143The default is
1144.Pa /usr/X11R6/bin/xauth .
1145.El
Damien Millere3beba22006-03-15 11:59:25 +11001146.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001147.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001148command-line arguments and configuration file options that specify time
1149may be expressed using a sequence of the form:
1150.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001151.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001152.Sm on
1153where
1154.Ar time
1155is a positive integer value and
1156.Ar qualifier
1157is one of the following:
1158.Pp
1159.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001160.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001161seconds
1162.It Cm s | Cm S
1163seconds
1164.It Cm m | Cm M
1165minutes
1166.It Cm h | Cm H
1167hours
1168.It Cm d | Cm D
1169days
1170.It Cm w | Cm W
1171weeks
1172.El
1173.Pp
1174Each member of the sequence is added together to calculate
1175the total time value.
1176.Pp
1177Time format examples:
1178.Pp
1179.Bl -tag -width Ds -compact -offset indent
1180.It 600
1181600 seconds (10 minutes)
1182.It 10m
118310 minutes
1184.It 1h30m
11851 hour 30 minutes (90 minutes)
1186.El
1187.Sh FILES
1188.Bl -tag -width Ds
1189.It Pa /etc/ssh/sshd_config
1190Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001191.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001192This file should be writable by root only, but it is recommended
1193(though not necessary) that it be world-readable.
1194.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001195.Sh SEE ALSO
1196.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001197.Sh AUTHORS
1198OpenSSH is a derivative of the original and free
1199ssh 1.2.12 release by Tatu Ylonen.
1200Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1201Theo de Raadt and Dug Song
1202removed many bugs, re-added newer features and
1203created OpenSSH.
1204Markus Friedl contributed the support for SSH
1205protocol versions 1.5 and 2.0.
1206Niels Provos and Markus Friedl contributed support
1207for privilege separation.