blob: 3cc901a825f4b3c6a5d43c02bf80ca353a861b88 [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 Millerf33580e2012-11-04 22:22:52 +110036.\" $OpenBSD: sshd_config.5,v 1.147 2012/10/31 08:04:50 jmc Exp $
37.Dd $Mdocdate: October 31 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
Damien Millerf33580e2012-11-04 22:22:52 +1100155Specifies a program to be used to look up the user's public keys.
Damien Miller09d3e122012-10-31 08:58:58 +1100156The program will be invoked with a single argument of the username
157being authenticated, and should produce on standard output zero or
Damien Millerf33580e2012-11-04 22:22:52 +1100158more lines of authorized_keys output (see
159.Sx AUTHORIZED_KEYS
160in
161.Xr sshd 8 ) .
Damien Miller09d3e122012-10-31 08:58:58 +1100162If a key supplied by AuthorizedKeysCommand does not successfully authenticate
163and authorize the user then public key authentication continues using the usual
164.Cm AuthorizedKeysFile
165files.
166By default, no AuthorizedKeysCommand is run.
167.It Cm AuthorizedKeysCommandUser
168Specifies the user under whose account the AuthorizedKeysCommand is run.
169The default is the user being authenticated.
170It is recommended to use a dedicated user that has no other role on the host
171than running authorized keys commands.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000172.It Cm AuthorizedKeysFile
173Specifies the file that contains the public keys that can be used
174for user authentication.
Damien Miller6018a362010-07-02 13:35:19 +1000175The format is described in the
176.Sx AUTHORIZED_KEYS FILE FORMAT
177section of
178.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000179.Cm AuthorizedKeysFile
180may contain tokens of the form %T which are substituted during connection
Damien Miller5b0d63f2006-03-15 11:56:56 +1100181setup.
Damien Millerfbf486b2003-05-23 18:44:23 +1000182The following tokens are defined: %% is replaced by a literal '%',
Damien Miller5b0d63f2006-03-15 11:56:56 +1100183%h is replaced by the home directory of the user being authenticated, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000184%u is replaced by the username of that user.
185After expansion,
186.Cm AuthorizedKeysFile
187is taken to be an absolute path or one relative to the user's home
188directory.
Damien Millerb9132fc2011-05-29 21:41:40 +1000189Multiple files may be listed, separated by whitespace.
190The default is
191.Dq .ssh/authorized_keys .ssh/authorized_keys2 .
Damien Miller30da3442010-05-10 11:58:03 +1000192.It Cm AuthorizedPrincipalsFile
193Specifies a file that lists principal names that are accepted for
194certificate authentication.
195When using certificates signed by a key listed in
196.Cm TrustedUserCAKeys ,
197this file lists names, one of which must appear in the certificate for it
198to be accepted for authentication.
Damien Millerd59dab82010-07-02 13:37:17 +1000199Names are listed one per line preceded by key options (as described
Damien Miller6018a362010-07-02 13:35:19 +1000200in
201.Sx AUTHORIZED_KEYS FILE FORMAT
202in
Damien Millerd59dab82010-07-02 13:37:17 +1000203.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000204Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000205.Ql #
206are ignored.
207.Pp
208.Cm AuthorizedPrincipalsFile
209may contain tokens of the form %T which are substituted during connection
210setup.
211The following tokens are defined: %% is replaced by a literal '%',
212%h is replaced by the home directory of the user being authenticated, and
213%u is replaced by the username of that user.
214After expansion,
215.Cm AuthorizedPrincipalsFile
216is taken to be an absolute path or one relative to the user's home
217directory.
218.Pp
Damien Miller8fef9eb2012-04-22 11:25:10 +1000219The default is
220.Dq none ,
221i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000222of the user must appear in a certificate's principals list for it to be
223accepted.
224Note that
225.Cm AuthorizedPrincipalsFile
226is only used when authentication proceeds using a CA listed in
227.Cm TrustedUserCAKeys
228and is not consulted for certification authorities trusted via
229.Pa ~/.ssh/authorized_keys ,
230though the
231.Cm principals=
232key option offers a similar facility (see
233.Xr sshd 8
234for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000235.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000236The contents of the specified file are sent to the remote user before
237authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000238If the argument is
239.Dq none
240then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000241This option is only available for protocol version 2.
242By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000243.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000244Specifies whether challenge-response authentication is allowed (e.g. via
245PAM or though authentication styles supported in
246.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000247The default is
248.Dq yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100249.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100250Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100251.Xr chroot 2
252to after authentication.
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100253All components of the pathname must be root-owned directories that are
Damien Millerd8cb1f12008-02-10 22:40:12 +1100254not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000255After the chroot,
256.Xr sshd 8
257changes the working directory to the user's home directory.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100258.Pp
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100259The pathname may contain the following tokens that are expanded at runtime once
Damien Millerd8cb1f12008-02-10 22:40:12 +1100260the connecting user has been authenticated: %% is replaced by a literal '%',
261%h is replaced by the home directory of the user being authenticated, and
262%u is replaced by the username of that user.
263.Pp
264The
265.Cm ChrootDirectory
266must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000267user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100268For an interactive session this requires at least a shell, typically
269.Xr sh 1 ,
270and basic
271.Pa /dev
272nodes such as
273.Xr null 4 ,
274.Xr zero 4 ,
275.Xr stdin 4 ,
276.Xr stdout 4 ,
277.Xr stderr 4 ,
278.Xr arandom 4
279and
280.Xr tty 4
281devices.
282For file transfer sessions using
Darren Tuckerf92077f2009-06-21 17:56:25 +1000283.Dq sftp ,
Damien Millerd8cb1f12008-02-10 22:40:12 +1100284no additional configuration of the environment is necessary if the
Darren Tuckerf92077f2009-06-21 17:56:25 +1000285in-process sftp server is used,
286though sessions which use logging do require
Darren Tucker00fcd712009-06-21 17:56:00 +1000287.Pa /dev/log
288inside the chroot directory (see
289.Xr sftp-server 8
290for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100291.Pp
292The default is not to
293.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000294.It Cm Ciphers
295Specifies the ciphers allowed for protocol version 2.
296Multiple ciphers must be comma-separated.
Damien Miller05202ff2004-06-15 10:30:39 +1000297The supported ciphers are
298.Dq 3des-cbc ,
299.Dq aes128-cbc ,
300.Dq aes192-cbc ,
301.Dq aes256-cbc ,
302.Dq aes128-ctr ,
303.Dq aes192-ctr ,
304.Dq aes256-ctr ,
Damien Miller3710f272005-05-26 12:19:17 +1000305.Dq arcfour128 ,
306.Dq arcfour256 ,
Damien Miller05202ff2004-06-15 10:30:39 +1000307.Dq arcfour ,
308.Dq blowfish-cbc ,
309and
310.Dq cast128-cbc .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100311The default is:
312.Bd -literal -offset 3n
Damien Miller9aa72ba2009-01-28 16:34:00 +1100313aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,
314aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,aes192-cbc,
315aes256-cbc,arcfour
Ben Lindstrom9f049032002-06-21 00:59:05 +0000316.Ed
Ben Lindstrom9f049032002-06-21 00:59:05 +0000317.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100318Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000319sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100320.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000321receiving any messages back from the client.
322If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100323sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000324It is important to note that the use of client alive messages is very
325different from
Damien Miller12c150e2003-12-17 16:31:10 +1100326.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000327(below).
328The client alive messages are sent through the encrypted channel
329and therefore will not be spoofable.
330The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100331.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000332is spoofable.
333The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000334server depend on knowing when a connection has become inactive.
335.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000336The default value is 3.
337If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000338.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100339(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000340.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100341is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000342will be disconnected after approximately 45 seconds.
Damien Millercc3e8ba2006-03-15 12:06:55 +1100343This option applies to protocol version 2 only.
Damien Miller1594ad52005-05-26 12:12:19 +1000344.It Cm ClientAliveInterval
345Sets a timeout interval in seconds after which if no data has been received
346from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100347.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000348will send a message through the encrypted
349channel to request a response from the client.
350The default
351is 0, indicating that these messages will not be sent to the client.
352This option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000353.It Cm Compression
Damien Miller9786e6e2005-07-26 21:54:56 +1000354Specifies whether compression is allowed, or delayed until
355the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000356The argument must be
Damien Miller9786e6e2005-07-26 21:54:56 +1000357.Dq yes ,
358.Dq delayed ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000359or
360.Dq no .
361The default is
Damien Miller9786e6e2005-07-26 21:54:56 +1000362.Dq delayed .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000363.It Cm DenyGroups
364This keyword can be followed by a list of group name patterns, separated
365by spaces.
366Login is disallowed for users whose primary group or supplementary
367group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000368Only group names are valid; a numerical group ID is not recognized.
369By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100370The allow/deny directives are processed in the following order:
371.Cm DenyUsers ,
372.Cm AllowUsers ,
373.Cm DenyGroups ,
374and finally
375.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100376.Pp
377See
378.Sx PATTERNS
379in
380.Xr ssh_config 5
381for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000382.It Cm DenyUsers
383This keyword can be followed by a list of user name patterns, separated
384by spaces.
385Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000386Only user names are valid; a numerical user ID is not recognized.
387By default, login is allowed for all users.
388If the pattern takes the form USER@HOST then USER and HOST
389are separately checked, restricting logins to particular
390users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100391The allow/deny directives are processed in the following order:
392.Cm DenyUsers ,
393.Cm AllowUsers ,
394.Cm DenyGroups ,
395and finally
396.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100397.Pp
398See
399.Sx PATTERNS
400in
401.Xr ssh_config 5
402for more information on patterns.
Damien Millere2754432006-07-24 14:06:47 +1000403.It Cm ForceCommand
404Forces the execution of the command specified by
405.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100406ignoring any command supplied by the client and
407.Pa ~/.ssh/rc
408if present.
Damien Millere2754432006-07-24 14:06:47 +1000409The command is invoked by using the user's login shell with the -c option.
410This applies to shell, command, or subsystem execution.
411It is most useful inside a
412.Cm Match
413block.
414The command originally supplied by the client is available in the
415.Ev SSH_ORIGINAL_COMMAND
416environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100417Specifying a command of
418.Dq internal-sftp
419will force the use of an in-process sftp server that requires no support
420files when used with
421.Cm ChrootDirectory .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000422.It Cm GatewayPorts
423Specifies whether remote hosts are allowed to connect to ports
424forwarded for the client.
425By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100426.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000427binds remote port forwardings to the loopback address.
428This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000429.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100430can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100431should allow remote port forwardings to bind to non-loopback addresses, thus
432allowing other hosts to connect.
433The argument may be
434.Dq no
435to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000436.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100437to force remote port forwardings to bind to the wildcard address, or
438.Dq clientspecified
439to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000440The default is
441.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000442.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000443Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100444The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000445.Dq no .
446Note that this option applies to protocol version 2 only.
447.It Cm GSSAPICleanupCredentials
448Specifies whether to automatically destroy the user's credentials cache
449on logout.
450The default is
451.Dq yes .
452Note that this option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000453.It Cm HostbasedAuthentication
454Specifies whether rhosts or /etc/hosts.equiv authentication together
455with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100456(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000457This option is similar to
458.Cm RhostsRSAAuthentication
459and applies to protocol version 2 only.
460The default is
461.Dq no .
Damien Millerb594f382006-08-30 11:06:34 +1000462.It Cm HostbasedUsesNameFromPacketOnly
463Specifies whether or not the server will attempt to perform a reverse
464name lookup when matching the name in the
465.Pa ~/.shosts ,
466.Pa ~/.rhosts ,
467and
468.Pa /etc/hosts.equiv
469files during
470.Cm HostbasedAuthentication .
471A setting of
472.Dq yes
473means that
474.Xr sshd 8
475uses the name supplied by the client rather than
476attempting to resolve the name from the TCP connection itself.
477The default is
478.Dq no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100479.It Cm HostCertificate
480Specifies a file containing a public host certificate.
481The certificate's public key must match a private host key already specified
482by
483.Cm HostKey .
484The default behaviour of
485.Xr sshd 8
486is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000487.It Cm HostKey
488Specifies a file containing a private host key
489used by SSH.
490The default is
491.Pa /etc/ssh/ssh_host_key
492for protocol version 1, and
Damien Millereb8b60e2010-08-31 22:41:14 +1000493.Pa /etc/ssh/ssh_host_dsa_key ,
494.Pa /etc/ssh/ssh_host_ecdsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000495and
Damien Millereb8b60e2010-08-31 22:41:14 +1000496.Pa /etc/ssh/ssh_host_rsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000497for protocol version 2.
498Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100499.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000500will refuse to use a file if it is group/world-accessible.
501It is possible to have multiple host key files.
502.Dq rsa1
503keys are used for version 1 and
Damien Millereb8b60e2010-08-31 22:41:14 +1000504.Dq dsa ,
505.Dq ecdsa
Ben Lindstrom9f049032002-06-21 00:59:05 +0000506or
507.Dq rsa
508are used for version 2 of the SSH protocol.
509.It Cm IgnoreRhosts
510Specifies that
511.Pa .rhosts
512and
513.Pa .shosts
514files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000515.Cm RhostsRSAAuthentication
516or
517.Cm HostbasedAuthentication .
518.Pp
519.Pa /etc/hosts.equiv
520and
521.Pa /etc/shosts.equiv
522are still used.
523The default is
524.Dq yes .
525.It Cm IgnoreUserKnownHosts
526Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100527.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000528should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000529.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000530during
531.Cm RhostsRSAAuthentication
532or
533.Cm HostbasedAuthentication .
534The default is
535.Dq no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100536.It Cm IPQoS
537Specifies the IPv4 type-of-service or DSCP class for the connection.
538Accepted values are
539.Dq af11 ,
540.Dq af12 ,
541.Dq af13 ,
Damien Millerf6e758c2011-09-22 21:37:13 +1000542.Dq af21 ,
Damien Miller0dac6fb2010-11-20 15:19:38 +1100543.Dq af22 ,
544.Dq af23 ,
545.Dq af31 ,
546.Dq af32 ,
547.Dq af33 ,
548.Dq af41 ,
549.Dq af42 ,
550.Dq af43 ,
551.Dq cs0 ,
552.Dq cs1 ,
553.Dq cs2 ,
554.Dq cs3 ,
555.Dq cs4 ,
556.Dq cs5 ,
557.Dq cs6 ,
558.Dq cs7 ,
559.Dq ef ,
560.Dq lowdelay ,
561.Dq throughput ,
562.Dq reliability ,
563or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +1100564This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100565If one argument is specified, it is used as the packet class unconditionally.
566If two values are specified, the first is automatically selected for
567interactive sessions and the second for non-interactive sessions.
568The default is
569.Dq lowdelay
570for interactive sessions and
571.Dq throughput
572for non-interactive sessions.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000573.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000574Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000575.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000576will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000577To use this option, the server needs a
578Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100579The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000580.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100581.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000582If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100583an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100584The default is
Damien Miller8448e662004-03-08 23:13:15 +1100585.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000586.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100587If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000588the password will be validated via any additional local mechanism
589such as
590.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100591The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000592.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000593.It Cm KerberosTicketCleanup
594Specifies whether to automatically destroy the user's ticket cache
595file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100596The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000597.Dq yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000598.It Cm KexAlgorithms
599Specifies the available KEX (Key Exchange) algorithms.
600Multiple algorithms must be comma-separated.
601The default is
602.Dq ecdh-sha2-nistp256 ,
603.Dq ecdh-sha2-nistp384 ,
604.Dq ecdh-sha2-nistp521 ,
Damien Miller0a184732010-11-20 15:21:03 +1100605.Dq diffie-hellman-group-exchange-sha256 ,
Damien Millerd5f62bf2010-09-24 22:11:14 +1000606.Dq diffie-hellman-group-exchange-sha1 ,
607.Dq diffie-hellman-group14-sha1 ,
608.Dq diffie-hellman-group1-sha1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000609.It Cm KeyRegenerationInterval
610In protocol version 1, the ephemeral server key is automatically regenerated
611after this many seconds (if it has been used).
612The purpose of regeneration is to prevent
613decrypting captured sessions by later breaking into the machine and
614stealing the keys.
615The key is never stored anywhere.
616If the value is 0, the key is never regenerated.
617The default is 3600 (seconds).
618.It Cm ListenAddress
619Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100620.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000621should listen on.
622The following forms may be used:
623.Pp
624.Bl -item -offset indent -compact
625.It
626.Cm ListenAddress
627.Sm off
628.Ar host No | Ar IPv4_addr No | Ar IPv6_addr
629.Sm on
630.It
631.Cm ListenAddress
632.Sm off
633.Ar host No | Ar IPv4_addr No : Ar port
634.Sm on
635.It
636.Cm ListenAddress
637.Sm off
638.Oo
639.Ar host No | Ar IPv6_addr Oc : Ar port
640.Sm on
641.El
642.Pp
643If
644.Ar port
645is not specified,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100646sshd will listen on the address and all prior
Ben Lindstrom9f049032002-06-21 00:59:05 +0000647.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000648options specified.
649The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000650Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000651.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000652options are permitted.
653Additionally, any
Ben Lindstrom9f049032002-06-21 00:59:05 +0000654.Cm Port
Damien Miller5b0d63f2006-03-15 11:56:56 +1100655options must precede this option for non-port qualified addresses.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000656.It Cm LoginGraceTime
657The server disconnects after this time if the user has not
658successfully logged in.
659If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000660The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000661.It Cm LogLevel
662Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100663.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000664The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100665QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000666The default is INFO.
667DEBUG and DEBUG1 are equivalent.
668DEBUG2 and DEBUG3 each specify higher levels of debugging output.
669Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000670.It Cm MACs
671Specifies the available MAC (message authentication code) algorithms.
672The MAC algorithm is used in protocol version 2
673for data integrity protection.
674Multiple algorithms must be comma-separated.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100675The default is:
Damien Miller22b7b492007-06-11 14:07:12 +1000676.Bd -literal -offset indent
Darren Tucker427e4092012-10-05 11:02:39 +1000677hmac-md5,hmac-sha1,umac-64@openssh.com,umac-128@openssh.com,
Darren Tuckerecbf14a2012-07-02 18:53:37 +1000678hmac-sha2-256,hmac-sha2-512,hmac-ripemd160,
679hmac-sha1-96,hmac-md5-96
Damien Miller22b7b492007-06-11 14:07:12 +1000680.Ed
Darren Tucker45150472006-07-12 22:34:17 +1000681.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +1000682Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +1000683If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +1000684.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000685line are satisfied, the keywords on the following lines override those
686set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +1000687.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000688line or the end of the file.
Darren Tucker7a3935d2008-06-10 22:59:10 +1000689.Pp
Damien Millerd04f3572006-07-24 13:46:50 +1000690The arguments to
Darren Tucker45150472006-07-12 22:34:17 +1000691.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000692are one or more criteria-pattern pairs.
Darren Tucker45150472006-07-12 22:34:17 +1000693The available criteria are
694.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +1000695.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +1000696.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +1000697.Cm LocalAddress ,
698.Cm LocalPort ,
Darren Tucker45150472006-07-12 22:34:17 +1000699and
700.Cm Address .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000701The match patterns may consist of single entries or comma-separated
702lists and may use the wildcard and negation operators described in the
Darren Tuckerb06cc4a2008-06-10 22:59:53 +1000703.Sx PATTERNS
Darren Tucker7a3935d2008-06-10 22:59:10 +1000704section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +1000705.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000706.Pp
707The patterns in an
708.Cm Address
709criteria may additionally contain addresses to match in CIDR
Darren Tucker6a2a4002008-06-10 23:03:04 +1000710address/masklen format, e.g.\&
Darren Tucker7a3935d2008-06-10 22:59:10 +1000711.Dq 192.0.2.0/24
712or
713.Dq 3ffe:ffff::/32 .
714Note that the mask length provided must be consistent with the address -
715it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +1000716or one with bits set in this host portion of the address.
717For example,
Darren Tucker7a3935d2008-06-10 22:59:10 +1000718.Dq 192.0.2.0/33
719and
Darren Tucker6a2a4002008-06-10 23:03:04 +1000720.Dq 192.0.2.0/8
Darren Tucker7a3935d2008-06-10 22:59:10 +1000721respectively.
722.Pp
Darren Tucker45150472006-07-12 22:34:17 +1000723Only a subset of keywords may be used on the lines following a
724.Cm Match
725keyword.
726Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +1000727.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +1100728.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +1000729.Cm AllowGroups ,
Damien Miller9b439df2006-07-24 14:04:00 +1000730.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +1000731.Cm AllowUsers ,
Damien Miller09d3e122012-10-31 08:58:58 +1100732.Cm AuthorizedKeysCommand ,
733.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +1100734.Cm AuthorizedKeysFile ,
Damien Millerab6de352010-06-26 09:38:45 +1000735.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +1100736.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +1000737.Cm ChrootDirectory ,
Damien Millerc24da772012-06-20 21:53:58 +1000738.Cm DenyGroups ,
739.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +1000740.Cm ForceCommand ,
Damien Millerc24da772012-06-20 21:53:58 +1000741.Cm GatewayPorts ,
Damien Millerf8268502012-06-20 21:54:15 +1000742.Cm GSSAPIAuthentication ,
Damien Miller25434de2008-05-19 14:29:08 +1000743.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +1000744.Cm HostbasedUsesNameFromPacketOnly ,
Darren Tucker1d75f222007-03-01 21:31:28 +1100745.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +1100746.Cm KerberosAuthentication ,
Damien Miller307c1d12008-06-16 07:56:20 +1000747.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +1000748.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +1100749.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +1100750.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +1000751.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +1100752.Cm PermitRootLogin ,
Damien Millerab6de352010-06-26 09:38:45 +1000753.Cm PermitTunnel ,
Darren Tucker1477ea12009-10-07 08:36:05 +1100754.Cm PubkeyAuthentication ,
Damien Millerc24da772012-06-20 21:53:58 +1000755.Cm RhostsRSAAuthentication ,
Damien Millerf8268502012-06-20 21:54:15 +1000756.Cm RSAAuthentication ,
Damien Millerd1de9952006-07-24 14:05:48 +1000757.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +1100758.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +1000759and
Damien Miller0296ae82009-02-23 11:00:24 +1100760.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +1000761.It Cm MaxAuthTries
762Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +1000763connection.
764Once the number of failures reaches half this value,
765additional failures are logged.
766The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +1000767.It Cm MaxSessions
768Specifies the maximum number of open sessions permitted per network connection.
769The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000770.It Cm MaxStartups
771Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +1100772SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000773Additional connections will be dropped until authentication succeeds or the
774.Cm LoginGraceTime
775expires for a connection.
776The default is 10.
777.Pp
778Alternatively, random early drop can be enabled by specifying
779the three colon separated values
780.Dq start:rate:full
Damien Miller208f1ed2006-03-15 11:56:03 +1100781(e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +1100782.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000783will refuse connection attempts with a probability of
784.Dq rate/100
785(30%)
786if there are currently
787.Dq start
788(10)
789unauthenticated connections.
790The probability increases linearly and all connection attempts
791are refused if the number of unauthenticated connections reaches
792.Dq full
793(60).
794.It Cm PasswordAuthentication
795Specifies whether password authentication is allowed.
796The default is
797.Dq yes .
798.It Cm PermitEmptyPasswords
799When password authentication is allowed, it specifies whether the
800server allows login to accounts with empty password strings.
801The default is
802.Dq no .
Damien Miller9b439df2006-07-24 14:04:00 +1000803.It Cm PermitOpen
804Specifies the destinations to which TCP port forwarding is permitted.
805The forwarding specification must be one of the following forms:
806.Pp
807.Bl -item -offset indent -compact
808.It
809.Cm PermitOpen
810.Sm off
811.Ar host : port
812.Sm on
813.It
814.Cm PermitOpen
815.Sm off
816.Ar IPv4_addr : port
817.Sm on
818.It
819.Cm PermitOpen
820.Sm off
821.Ar \&[ IPv6_addr \&] : port
822.Sm on
823.El
824.Pp
Damien Millera765cf42006-07-24 14:08:13 +1000825Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +1000826An argument of
827.Dq any
828can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +1000829An argument of
830.Dq none
831can be used to prohibit all forwarding requests.
Damien Miller65bc2c42006-07-24 14:04:16 +1000832By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000833.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +1100834Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +0000835.Xr ssh 1 .
836The argument must be
837.Dq yes ,
838.Dq without-password ,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100839.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000840or
841.Dq no .
842The default is
843.Dq yes .
844.Pp
845If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100846.Dq without-password ,
Darren Tucker9dca0992005-02-01 19:16:45 +1100847password authentication is disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000848.Pp
849If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100850.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000851root login with public key authentication will be allowed,
852but only if the
853.Ar command
854option has been specified
855(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +1000856normally not allowed).
857All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000858.Pp
859If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +1100860.Dq no ,
Darren Tuckerb3509012005-01-20 11:01:46 +1100861root is not allowed to log in.
Damien Millerd27b9472005-12-13 19:29:02 +1100862.It Cm PermitTunnel
863Specifies whether
864.Xr tun 4
865device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +1100866The argument must be
867.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +1000868.Dq point-to-point
869(layer 3),
870.Dq ethernet
871(layer 2), or
Damien Miller7b58e802005-12-13 19:33:19 +1100872.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +1000873Specifying
874.Dq yes
875permits both
876.Dq point-to-point
877and
878.Dq ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +1100879The default is
880.Dq no .
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000881.It Cm PermitUserEnvironment
882Specifies whether
883.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000884and
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000885.Cm environment=
886options in
887.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000888are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +1100889.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +0000890The default is
891.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +0000892Enabling environment processing may enable users to bypass access
893restrictions in some configurations using mechanisms such as
894.Ev LD_PRELOAD .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000895.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +0000896Specifies the file that contains the process ID of the
Damien Millerf4f22b52006-03-15 11:57:25 +1100897SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000898The default is
899.Pa /var/run/sshd.pid .
900.It Cm Port
901Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100902.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000903listens on.
904The default is 22.
905Multiple options of this type are permitted.
906See also
907.Cm ListenAddress .
908.It Cm PrintLastLog
909Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100910.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +1100911should print the date and time of the last user login when a user logs
912in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000913The default is
914.Dq yes .
915.It Cm PrintMotd
916Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100917.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000918should print
919.Pa /etc/motd
920when a user logs in interactively.
921(On some systems it is also printed by the shell,
922.Pa /etc/profile ,
923or equivalent.)
924The default is
925.Dq yes .
926.It Cm Protocol
927Specifies the protocol versions
Damien Miller5b0d63f2006-03-15 11:56:56 +1100928.Xr sshd 8
Ben Lindstrom9c445542002-07-11 03:59:18 +0000929supports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000930The possible values are
Damien Miller5b0d63f2006-03-15 11:56:56 +1100931.Sq 1
Ben Lindstrom9f049032002-06-21 00:59:05 +0000932and
Damien Miller5b0d63f2006-03-15 11:56:56 +1100933.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000934Multiple versions must be comma-separated.
935The default is
Darren Tucker7a4a7652009-10-11 21:51:40 +1100936.Sq 2 .
Ben Lindstrom9c445542002-07-11 03:59:18 +0000937Note that the order of the protocol list does not indicate preference,
938because the client selects among multiple protocol versions offered
939by the server.
940Specifying
941.Dq 2,1
942is identical to
943.Dq 1,2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000944.It Cm PubkeyAuthentication
945Specifies whether public key authentication is allowed.
946The default is
947.Dq yes .
948Note that this option applies to protocol version 2 only.
Damien Miller1aed65e2010-03-04 21:53:35 +1100949.It Cm RevokedKeys
950Specifies a list of revoked public keys.
951Keys listed in this file will be refused for public key authentication.
952Note that if this file is not readable, then public key authentication will
953be refused for all users.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000954.It Cm RhostsRSAAuthentication
955Specifies whether rhosts or /etc/hosts.equiv authentication together
956with successful RSA host authentication is allowed.
957The default is
958.Dq no .
959This option applies to protocol version 1 only.
960.It Cm RSAAuthentication
961Specifies whether pure RSA authentication is allowed.
962The default is
963.Dq yes .
964This option applies to protocol version 1 only.
965.It Cm ServerKeyBits
966Defines the number of bits in the ephemeral protocol version 1 server key.
Darren Tucker7499b0c2008-07-02 22:35:43 +1000967The minimum value is 512, and the default is 1024.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000968.It Cm StrictModes
969Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100970.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000971should check file modes and ownership of the
972user's files and home directory before accepting login.
973This is normally desirable because novices sometimes accidentally leave their
974directory or files world-writable.
975The default is
976.Dq yes .
Darren Tuckerf788a912010-01-08 17:06:47 +1100977Note that this does not apply to
978.Cm ChrootDirectory ,
979whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000980.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +1100981Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +1000982Arguments should be a subsystem name and a command (with optional arguments)
983to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100984.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000985The command
986.Xr sftp-server 8
987implements the
988.Dq sftp
989file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100990.Pp
991Alternately the name
992.Dq internal-sftp
993implements an in-process
994.Dq sftp
995server.
996This may simplify configurations using
997.Cm ChrootDirectory
998to force a different filesystem root on clients.
999.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001000By default no subsystems are defined.
1001Note that this option applies to protocol version 2 only.
1002.It Cm SyslogFacility
1003Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001004.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001005The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1006LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1007The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001008.It Cm TCPKeepAlive
1009Specifies whether the system should send TCP keepalive messages to the
1010other side.
1011If they are sent, death of the connection or crash of one
1012of the machines will be properly noticed.
1013However, this means that
1014connections will die if the route is down temporarily, and some people
1015find it annoying.
1016On the other hand, if TCP keepalives are not sent,
1017sessions may hang indefinitely on the server, leaving
1018.Dq ghost
1019users and consuming server resources.
1020.Pp
1021The default is
1022.Dq yes
1023(to send TCP keepalive messages), and the server will notice
1024if the network goes down or the client host crashes.
1025This avoids infinitely hanging sessions.
1026.Pp
1027To disable TCP keepalive messages, the value should be set to
1028.Dq no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001029.It Cm TrustedUserCAKeys
1030Specifies a file containing public keys of certificate authorities that are
Damien Millerc6db99e2010-03-05 10:41:45 +11001031trusted to sign user certificates for authentication.
Damien Miller72b33822010-03-05 07:39:01 +11001032Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001033.Ql #
1034are allowed.
1035If a certificate is presented for authentication and has its signing CA key
1036listed in this file, then it may be used for authentication for any user
1037listed in the certificate's principals list.
1038Note that certificates that lack a list of principals will not be permitted
1039for authentication using
1040.Cm TrustedUserCAKeys .
Damien Miller72b33822010-03-05 07:39:01 +11001041For more details on certificates, see the
Damien Miller1aed65e2010-03-04 21:53:35 +11001042.Sx CERTIFICATES
1043section in
1044.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001045.It Cm UseDNS
1046Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001047.Xr sshd 8
Darren Tucker83d5a982005-03-31 21:33:50 +10001048should look up the remote host name and check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001049the resolved host name for the remote IP address maps back to the
1050very same IP address.
1051The default is
1052.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001053.It Cm UseLogin
1054Specifies whether
1055.Xr login 1
1056is used for interactive login sessions.
1057The default is
1058.Dq no .
1059Note that
1060.Xr login 1
1061is never used for remote command execution.
1062Note also, that if this is enabled,
1063.Cm X11Forwarding
1064will be disabled because
1065.Xr login 1
1066does not know how to handle
1067.Xr xauth 1
Damien Miller495dca32003-04-01 21:42:14 +10001068cookies.
1069If
Ben Lindstrom9f049032002-06-21 00:59:05 +00001070.Cm UsePrivilegeSeparation
1071is specified, it will be disabled after authentication.
Damien Miller2e193e22003-05-14 15:13:03 +10001072.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001073Enables the Pluggable Authentication Module interface.
1074If set to
1075.Dq yes
1076this will enable PAM authentication using
1077.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001078and
1079.Cm PasswordAuthentication
1080in addition to PAM account and session module processing for all
1081authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001082.Pp
1083Because PAM challenge-response authentication usually serves an equivalent
1084role to password authentication, you should disable either
1085.Cm PasswordAuthentication
1086or
1087.Cm ChallengeResponseAuthentication.
1088.Pp
1089If
1090.Cm UsePAM
1091is enabled, you will not be able to run
1092.Xr sshd 8
1093as a non-root user.
1094The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +10001095.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001096.It Cm UsePrivilegeSeparation
1097Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001098.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001099separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +10001100to deal with incoming network traffic.
1101After successful authentication, another process will be created that has
1102the privilege of the authenticated user.
1103The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +00001104escalation by containing any corruption within the unprivileged processes.
1105The default is
1106.Dq yes .
Damien Miller69ff1df2011-06-23 08:30:03 +10001107If
1108.Cm UsePrivilegeSeparation
1109is set to
1110.Dq sandbox
1111then the pre-authentication unprivileged process is subject to additional
1112restrictions.
Damien Miller23528812012-04-22 11:24:43 +10001113.It Cm VersionAddendum
1114Optionally specifies additional text to append to the SSH protocol banner
1115sent by the server upon connection.
1116The default is
1117.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001118.It Cm X11DisplayOffset
1119Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001120.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001121X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001122This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001123The default is 10.
1124.It Cm X11Forwarding
1125Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001126The argument must be
1127.Dq yes
1128or
1129.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001130The default is
1131.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +10001132.Pp
1133When X11 forwarding is enabled, there may be additional exposure to
1134the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001135.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001136proxy display is configured to listen on the wildcard address (see
1137.Cm X11UseLocalhost
Damien Miller5b0d63f2006-03-15 11:56:56 +11001138below), though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001139Additionally, the authentication spoofing and authentication data
1140verification and substitution occur on the client side.
1141The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001142display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001143forwarding (see the warnings for
1144.Cm ForwardX11
1145in
Damien Millerf1ce5052003-06-11 22:04:39 +10001146.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001147A system administrator may have a stance in which they want to
1148protect clients that may expose themselves to attack by unwittingly
1149requesting X11 forwarding, which can warrant a
1150.Dq no
1151setting.
1152.Pp
1153Note that disabling X11 forwarding does not prevent users from
1154forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001155X11 forwarding is automatically disabled if
1156.Cm UseLogin
1157is enabled.
1158.It Cm X11UseLocalhost
1159Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001160.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001161should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001162the wildcard address.
1163By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001164sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001165hostname part of the
1166.Ev DISPLAY
1167environment variable to
1168.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001169This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001170However, some older X11 clients may not function with this
1171configuration.
1172.Cm X11UseLocalhost
1173may be set to
1174.Dq no
1175to specify that the forwarding server should be bound to the wildcard
1176address.
1177The argument must be
1178.Dq yes
1179or
1180.Dq no .
1181The default is
1182.Dq yes .
1183.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001184Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001185.Xr xauth 1
1186program.
1187The default is
1188.Pa /usr/X11R6/bin/xauth .
1189.El
Damien Millere3beba22006-03-15 11:59:25 +11001190.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001191.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001192command-line arguments and configuration file options that specify time
1193may be expressed using a sequence of the form:
1194.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001195.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001196.Sm on
1197where
1198.Ar time
1199is a positive integer value and
1200.Ar qualifier
1201is one of the following:
1202.Pp
1203.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001204.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001205seconds
1206.It Cm s | Cm S
1207seconds
1208.It Cm m | Cm M
1209minutes
1210.It Cm h | Cm H
1211hours
1212.It Cm d | Cm D
1213days
1214.It Cm w | Cm W
1215weeks
1216.El
1217.Pp
1218Each member of the sequence is added together to calculate
1219the total time value.
1220.Pp
1221Time format examples:
1222.Pp
1223.Bl -tag -width Ds -compact -offset indent
1224.It 600
1225600 seconds (10 minutes)
1226.It 10m
122710 minutes
1228.It 1h30m
12291 hour 30 minutes (90 minutes)
1230.El
1231.Sh FILES
1232.Bl -tag -width Ds
1233.It Pa /etc/ssh/sshd_config
1234Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001235.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001236This file should be writable by root only, but it is recommended
1237(though not necessary) that it be world-readable.
1238.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001239.Sh SEE ALSO
1240.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001241.Sh AUTHORS
1242OpenSSH is a derivative of the original and free
1243ssh 1.2.12 release by Tatu Ylonen.
1244Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1245Theo de Raadt and Dug Song
1246removed many bugs, re-added newer features and
1247created OpenSSH.
1248Markus Friedl contributed the support for SSH
1249protocol versions 1.5 and 2.0.
1250Niels Provos and Markus Friedl contributed support
1251for privilege separation.