blob: 33e401170c974f5d23fad7769d5702da08d63ea3 [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.\"
jmc@openbsd.orgc1d5bcf2015-04-28 13:47:38 +000036.\" $OpenBSD: sshd_config.5,v 1.199 2015/04/28 13:47:38 jmc Exp $
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +000037.Dd $Mdocdate: April 28 2015 $
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.
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +000073Note that environment passing is only supported for protocol 2, and
74that the
75.Ev TERM
jmc@openbsd.orgc1d5bcf2015-04-28 13:47:38 +000076environment variable is always sent whenever the client
dtucker@openbsd.org43beea02015-04-28 10:25:15 +000077requests a pseudo-terminal is requested as it is required by the protocol.
Darren Tucker46bc0752004-05-02 22:11:30 +100078Variables are specified by name, which may contain the wildcard characters
Damien Miller208f1ed2006-03-15 11:56:03 +110079.Ql *
Darren Tucker46bc0752004-05-02 22:11:30 +100080and
81.Ql \&? .
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100082Multiple environment variables may be separated by whitespace or spread
Darren Tucker46bc0752004-05-02 22:11:30 +100083across multiple
84.Cm AcceptEnv
85directives.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100086Be warned that some environment variables could be used to bypass restricted
Darren Tucker46bc0752004-05-02 22:11:30 +100087user environments.
88For this reason, care should be taken in the use of this directive.
89The default is not to accept any environment variables.
Darren Tucker0f383232005-01-20 10:57:56 +110090.It Cm AddressFamily
91Specifies which address family should be used by
Damien Millerf4f22b52006-03-15 11:57:25 +110092.Xr sshd 8 .
Darren Tucker0f383232005-01-20 10:57:56 +110093Valid arguments are
94.Dq any ,
95.Dq inet
Damien Miller5b0d63f2006-03-15 11:56:56 +110096(use IPv4 only), or
Darren Tucker0f383232005-01-20 10:57:56 +110097.Dq inet6
98(use IPv6 only).
99The default is
100.Dq any .
Damien Millere9890192008-05-19 14:59:02 +1000101.It Cm AllowAgentForwarding
102Specifies whether
103.Xr ssh-agent 1
104forwarding is permitted.
105The default is
106.Dq yes .
107Note that disabling agent forwarding does not improve security
108unless users are also denied shell access, as they can always install
109their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000110.It Cm AllowGroups
111This keyword can be followed by a list of group name patterns, separated
112by spaces.
113If specified, login is allowed only for users whose primary
114group or supplementary group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000115Only group names are valid; a numerical group ID is not recognized.
116By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100117The allow/deny directives are processed in the following order:
118.Cm DenyUsers ,
119.Cm AllowUsers ,
120.Cm DenyGroups ,
121and finally
122.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100123.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000124See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100125.Xr ssh_config 5
126for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000127.It Cm AllowTcpForwarding
128Specifies whether TCP forwarding is permitted.
Damien Milleraa5b3f82012-12-03 09:50:54 +1100129The available options are
130.Dq yes
131or
132.Dq all
133to allow TCP forwarding,
134.Dq no
135to prevent all TCP forwarding,
136.Dq local
137to allow local (from the perspective of
Darren Tuckerf9333d52012-12-07 13:06:13 +1100138.Xr ssh 1 )
139forwarding only or
Damien Milleraa5b3f82012-12-03 09:50:54 +1100140.Dq remote
141to allow remote forwarding only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000142The default is
143.Dq yes .
144Note that disabling TCP forwarding does not improve security unless
145users are also denied shell access, as they can always install their
146own forwarders.
Damien Miller7acefbb2014-07-18 14:11:24 +1000147.It Cm AllowStreamLocalForwarding
148Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
149The available options are
150.Dq yes
151or
152.Dq all
153to allow StreamLocal forwarding,
154.Dq no
155to prevent all StreamLocal forwarding,
156.Dq local
157to allow local (from the perspective of
158.Xr ssh 1 )
159forwarding only or
160.Dq remote
161to allow remote forwarding only.
162The default is
163.Dq yes .
164Note that disabling StreamLocal forwarding does not improve security unless
165users are also denied shell access, as they can always install their
166own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000167.It Cm AllowUsers
168This keyword can be followed by a list of user name patterns, separated
169by spaces.
Damien Miller5a93add2003-01-24 11:34:52 +1100170If specified, login is allowed only for user names that
Ben Lindstrom9f049032002-06-21 00:59:05 +0000171match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000172Only user names are valid; a numerical user ID is not recognized.
173By default, login is allowed for all users.
174If the pattern takes the form USER@HOST then USER and HOST
175are separately checked, restricting logins to particular
176users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100177The allow/deny directives are processed in the following order:
178.Cm DenyUsers ,
179.Cm AllowUsers ,
180.Cm DenyGroups ,
181and finally
182.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100183.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000184See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100185.Xr ssh_config 5
186for more information on patterns.
Damien Millera6e3f012012-11-04 23:21:40 +1100187.It Cm AuthenticationMethods
188Specifies the authentication methods that must be successfully completed
189for a user to be granted access.
190This option must be followed by one or more comma-separated lists of
191authentication method names.
192Successful authentication requires completion of every method in at least
193one of these lists.
194.Pp
195For example, an argument of
196.Dq publickey,password publickey,keyboard-interactive
197would require the user to complete public key authentication, followed by
198either password or keyboard interactive authentication.
199Only methods that are next in one or more lists are offered at each stage,
200so for this example, it would not be possible to attempt password or
201keyboard-interactive authentication before public key.
202.Pp
Damien Miller91a55f22013-04-23 15:18:10 +1000203For keyboard interactive authentication it is also possible to
204restrict authentication to a specific device by appending a
205colon followed by the device identifier
206.Dq bsdauth ,
207.Dq pam ,
208or
209.Dq skey ,
210depending on the server configuration.
211For example,
212.Dq keyboard-interactive:bsdauth
213would restrict keyboard interactive authentication to the
214.Dq bsdauth
215device.
216.Pp
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000217If the
218.Dq publickey
jmc@openbsd.org449e11b2014-12-22 08:24:17 +0000219method is listed more than once,
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000220.Xr sshd 8
221verifies that keys that have been used successfully are not reused for
222subsequent authentications.
223For example, an
224.Cm AuthenticationMethods
225of
226.Dq publickey,publickey
227will require successful authentication using two different public keys.
228.Pp
Damien Millera6e3f012012-11-04 23:21:40 +1100229This option is only available for SSH protocol 2 and will yield a fatal
230error if enabled if protocol 1 is also enabled.
231Note that each authentication method listed should also be explicitly enabled
232in the configuration.
233The default is not to require multiple authentication; successful completion
234of a single authentication method is sufficient.
Damien Miller09d3e122012-10-31 08:58:58 +1100235.It Cm AuthorizedKeysCommand
Damien Millerf33580e2012-11-04 22:22:52 +1100236Specifies a program to be used to look up the user's public keys.
Damien Miller467b00c2013-04-23 15:23:07 +1000237The program must be owned by root and not writable by group or others.
238It will be invoked with a single argument of the username
Damien Miller09d3e122012-10-31 08:58:58 +1100239being authenticated, and should produce on standard output zero or
Damien Millerfecfd112013-07-18 16:11:50 +1000240more lines of authorized_keys output (see AUTHORIZED_KEYS in
Damien Millerf33580e2012-11-04 22:22:52 +1100241.Xr sshd 8 ) .
Damien Miller09d3e122012-10-31 08:58:58 +1100242If a key supplied by AuthorizedKeysCommand does not successfully authenticate
243and authorize the user then public key authentication continues using the usual
244.Cm AuthorizedKeysFile
245files.
246By default, no AuthorizedKeysCommand is run.
247.It Cm AuthorizedKeysCommandUser
248Specifies the user under whose account the AuthorizedKeysCommand is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100249It is recommended to use a dedicated user that has no other role on the host
250than running authorized keys commands.
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000251If
djm@openbsd.orgd663bea2014-12-11 05:25:06 +0000252.Cm AuthorizedKeysCommand
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000253is specified but
254.Cm AuthorizedKeysCommandUser
255is not, then
256.Xr sshd 8
257will refuse to start.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000258.It Cm AuthorizedKeysFile
259Specifies the file that contains the public keys that can be used
260for user authentication.
Damien Miller6018a362010-07-02 13:35:19 +1000261The format is described in the
Damien Millerfecfd112013-07-18 16:11:50 +1000262AUTHORIZED_KEYS FILE FORMAT
Damien Miller6018a362010-07-02 13:35:19 +1000263section of
264.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000265.Cm AuthorizedKeysFile
266may contain tokens of the form %T which are substituted during connection
Damien Miller5b0d63f2006-03-15 11:56:56 +1100267setup.
Damien Millerfbf486b2003-05-23 18:44:23 +1000268The following tokens are defined: %% is replaced by a literal '%',
Damien Miller5b0d63f2006-03-15 11:56:56 +1100269%h is replaced by the home directory of the user being authenticated, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000270%u is replaced by the username of that user.
271After expansion,
272.Cm AuthorizedKeysFile
273is taken to be an absolute path or one relative to the user's home
274directory.
Damien Millerb9132fc2011-05-29 21:41:40 +1000275Multiple files may be listed, separated by whitespace.
276The default is
277.Dq .ssh/authorized_keys .ssh/authorized_keys2 .
Damien Miller30da3442010-05-10 11:58:03 +1000278.It Cm AuthorizedPrincipalsFile
279Specifies a file that lists principal names that are accepted for
280certificate authentication.
281When using certificates signed by a key listed in
282.Cm TrustedUserCAKeys ,
283this file lists names, one of which must appear in the certificate for it
284to be accepted for authentication.
Damien Millerd59dab82010-07-02 13:37:17 +1000285Names are listed one per line preceded by key options (as described
Damien Millerfecfd112013-07-18 16:11:50 +1000286in AUTHORIZED_KEYS FILE FORMAT in
Damien Millerd59dab82010-07-02 13:37:17 +1000287.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000288Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000289.Ql #
290are ignored.
291.Pp
292.Cm AuthorizedPrincipalsFile
293may contain tokens of the form %T which are substituted during connection
294setup.
295The following tokens are defined: %% is replaced by a literal '%',
296%h is replaced by the home directory of the user being authenticated, and
297%u is replaced by the username of that user.
298After expansion,
299.Cm AuthorizedPrincipalsFile
300is taken to be an absolute path or one relative to the user's home
301directory.
302.Pp
Damien Miller8fef9eb2012-04-22 11:25:10 +1000303The default is
304.Dq none ,
305i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000306of the user must appear in a certificate's principals list for it to be
307accepted.
308Note that
309.Cm AuthorizedPrincipalsFile
310is only used when authentication proceeds using a CA listed in
311.Cm TrustedUserCAKeys
312and is not consulted for certification authorities trusted via
313.Pa ~/.ssh/authorized_keys ,
314though the
315.Cm principals=
316key option offers a similar facility (see
317.Xr sshd 8
318for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000319.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000320The contents of the specified file are sent to the remote user before
321authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000322If the argument is
323.Dq none
324then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000325This option is only available for protocol version 2.
326By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000327.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000328Specifies whether challenge-response authentication is allowed (e.g. via
Damien Millere8c9f262014-10-03 09:24:56 +1000329PAM or through authentication styles supported in
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000330.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000331The default is
332.Dq yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100333.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100334Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100335.Xr chroot 2
336to after authentication.
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000337At session startup
338.Xr sshd 8
339checks that all components of the pathname are root-owned directories
340which are not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000341After the chroot,
342.Xr sshd 8
343changes the working directory to the user's home directory.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100344.Pp
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100345The pathname may contain the following tokens that are expanded at runtime once
Damien Millerd8cb1f12008-02-10 22:40:12 +1100346the connecting user has been authenticated: %% is replaced by a literal '%',
347%h is replaced by the home directory of the user being authenticated, and
348%u is replaced by the username of that user.
349.Pp
350The
351.Cm ChrootDirectory
352must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000353user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100354For an interactive session this requires at least a shell, typically
355.Xr sh 1 ,
356and basic
357.Pa /dev
358nodes such as
359.Xr null 4 ,
360.Xr zero 4 ,
361.Xr stdin 4 ,
362.Xr stdout 4 ,
363.Xr stderr 4 ,
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000364and
Damien Millerd8cb1f12008-02-10 22:40:12 +1100365.Xr tty 4
366devices.
367For file transfer sessions using
Darren Tuckerf92077f2009-06-21 17:56:25 +1000368.Dq sftp ,
Damien Millerd8cb1f12008-02-10 22:40:12 +1100369no additional configuration of the environment is necessary if the
Darren Tuckerf92077f2009-06-21 17:56:25 +1000370in-process sftp server is used,
Damien Miller426117b2014-07-30 12:33:20 +1000371though sessions which use logging may require
Darren Tucker00fcd712009-06-21 17:56:00 +1000372.Pa /dev/log
Damien Miller426117b2014-07-30 12:33:20 +1000373inside the chroot directory on some operating systems (see
Darren Tucker00fcd712009-06-21 17:56:00 +1000374.Xr sftp-server 8
375for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100376.Pp
jmc@openbsd.orga5a3e332015-01-22 21:00:42 +0000377For safety, it is very important that the directory hierarchy be
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000378prevented from modification by other processes on the system (especially
379those outside the jail).
380Misconfiguration can lead to unsafe environments which
381.Xr sshd 8
382cannot detect.
383.Pp
Damien Millerd8cb1f12008-02-10 22:40:12 +1100384The default is not to
385.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000386.It Cm Ciphers
387Specifies the ciphers allowed for protocol version 2.
388Multiple ciphers must be comma-separated.
Damien Miller0fde8ac2013-11-21 14:12:23 +1100389The supported ciphers are:
390.Pp
Damien Millerc1621c82014-04-20 13:22:46 +1000391.Bl -item -compact -offset indent
392.It
3933des-cbc
394.It
395aes128-cbc
396.It
397aes192-cbc
398.It
399aes256-cbc
400.It
401aes128-ctr
402.It
403aes192-ctr
404.It
405aes256-ctr
406.It
407aes128-gcm@openssh.com
408.It
409aes256-gcm@openssh.com
410.It
411arcfour
412.It
413arcfour128
414.It
415arcfour256
416.It
417blowfish-cbc
418.It
419cast128-cbc
420.It
421chacha20-poly1305@openssh.com
422.El
Damien Miller0fde8ac2013-11-21 14:12:23 +1100423.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100424The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000425.Bd -literal -offset indent
426aes128-ctr,aes192-ctr,aes256-ctr,
Damien Miller1d75abf2013-01-09 16:12:19 +1100427aes128-gcm@openssh.com,aes256-gcm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000428chacha20-poly1305@openssh.com
Ben Lindstrom9f049032002-06-21 00:59:05 +0000429.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100430.Pp
431The list of available ciphers may also be obtained using the
432.Fl Q
433option of
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000434.Xr ssh 1
435with an argument of
436.Dq cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000437.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100438Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000439sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100440.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000441receiving any messages back from the client.
442If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100443sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000444It is important to note that the use of client alive messages is very
445different from
Damien Miller12c150e2003-12-17 16:31:10 +1100446.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000447(below).
448The client alive messages are sent through the encrypted channel
449and therefore will not be spoofable.
450The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100451.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000452is spoofable.
453The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000454server depend on knowing when a connection has become inactive.
455.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000456The default value is 3.
457If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000458.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100459(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000460.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100461is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000462will be disconnected after approximately 45 seconds.
Damien Millercc3e8ba2006-03-15 12:06:55 +1100463This option applies to protocol version 2 only.
Damien Miller1594ad52005-05-26 12:12:19 +1000464.It Cm ClientAliveInterval
465Sets a timeout interval in seconds after which if no data has been received
466from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100467.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000468will send a message through the encrypted
469channel to request a response from the client.
470The default
471is 0, indicating that these messages will not be sent to the client.
472This option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000473.It Cm Compression
Damien Miller9786e6e2005-07-26 21:54:56 +1000474Specifies whether compression is allowed, or delayed until
475the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000476The argument must be
Damien Miller9786e6e2005-07-26 21:54:56 +1000477.Dq yes ,
478.Dq delayed ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000479or
480.Dq no .
481The default is
Damien Miller9786e6e2005-07-26 21:54:56 +1000482.Dq delayed .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000483.It Cm DenyGroups
484This keyword can be followed by a list of group name patterns, separated
485by spaces.
486Login is disallowed for users whose primary group or supplementary
487group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000488Only group names are valid; a numerical group ID is not recognized.
489By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100490The allow/deny directives are processed in the following order:
491.Cm DenyUsers ,
492.Cm AllowUsers ,
493.Cm DenyGroups ,
494and finally
495.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100496.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000497See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100498.Xr ssh_config 5
499for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000500.It Cm DenyUsers
501This keyword can be followed by a list of user name patterns, separated
502by spaces.
503Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000504Only user names are valid; a numerical user ID is not recognized.
505By default, login is allowed for all users.
506If the pattern takes the form USER@HOST then USER and HOST
507are separately checked, restricting logins to particular
508users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100509The allow/deny directives are processed in the following order:
510.Cm DenyUsers ,
511.Cm AllowUsers ,
512.Cm DenyGroups ,
513and finally
514.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100515.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000516See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100517.Xr ssh_config 5
518for more information on patterns.
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000519.It Cm FingerprintHash
520Specifies the hash algorithm used when logging key fingerprints.
521Valid options are:
522.Dq md5
523and
524.Dq sha256 .
525The default is
526.Dq sha256 .
Damien Millere2754432006-07-24 14:06:47 +1000527.It Cm ForceCommand
528Forces the execution of the command specified by
529.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100530ignoring any command supplied by the client and
531.Pa ~/.ssh/rc
532if present.
Damien Millere2754432006-07-24 14:06:47 +1000533The command is invoked by using the user's login shell with the -c option.
534This applies to shell, command, or subsystem execution.
535It is most useful inside a
536.Cm Match
537block.
538The command originally supplied by the client is available in the
539.Ev SSH_ORIGINAL_COMMAND
540environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100541Specifying a command of
542.Dq internal-sftp
543will force the use of an in-process sftp server that requires no support
544files when used with
545.Cm ChrootDirectory .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000546.It Cm GatewayPorts
547Specifies whether remote hosts are allowed to connect to ports
548forwarded for the client.
549By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100550.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000551binds remote port forwardings to the loopback address.
552This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000553.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100554can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100555should allow remote port forwardings to bind to non-loopback addresses, thus
556allowing other hosts to connect.
557The argument may be
558.Dq no
559to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000560.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100561to force remote port forwardings to bind to the wildcard address, or
562.Dq clientspecified
563to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000564The default is
565.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000566.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000567Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100568The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000569.Dq no .
570Note that this option applies to protocol version 2 only.
571.It Cm GSSAPICleanupCredentials
572Specifies whether to automatically destroy the user's credentials cache
573on logout.
574The default is
575.Dq yes .
576Note that this option applies to protocol version 2 only.
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000577.It Cm HostbasedAcceptedKeyTypes
578Specifies the key types that will be accepted for hostbased authentication
579as a comma-separated pattern list.
580The default
581.Dq *
582will allow all key types.
583The
584.Fl Q
585option of
586.Xr ssh 1
587may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000588.It Cm HostbasedAuthentication
589Specifies whether rhosts or /etc/hosts.equiv authentication together
590with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100591(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000592This option is similar to
593.Cm RhostsRSAAuthentication
594and applies to protocol version 2 only.
595The default is
596.Dq no .
Damien Millerb594f382006-08-30 11:06:34 +1000597.It Cm HostbasedUsesNameFromPacketOnly
598Specifies whether or not the server will attempt to perform a reverse
599name lookup when matching the name in the
600.Pa ~/.shosts ,
601.Pa ~/.rhosts ,
602and
603.Pa /etc/hosts.equiv
604files during
605.Cm HostbasedAuthentication .
606A setting of
607.Dq yes
608means that
609.Xr sshd 8
610uses the name supplied by the client rather than
611attempting to resolve the name from the TCP connection itself.
612The default is
613.Dq no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100614.It Cm HostCertificate
615Specifies a file containing a public host certificate.
616The certificate's public key must match a private host key already specified
617by
618.Cm HostKey .
619The default behaviour of
620.Xr sshd 8
621is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000622.It Cm HostKey
623Specifies a file containing a private host key
624used by SSH.
625The default is
626.Pa /etc/ssh/ssh_host_key
627for protocol version 1, and
Damien Millereb8b60e2010-08-31 22:41:14 +1000628.Pa /etc/ssh/ssh_host_dsa_key ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100629.Pa /etc/ssh/ssh_host_ecdsa_key ,
630.Pa /etc/ssh/ssh_host_ed25519_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000631and
Damien Millereb8b60e2010-08-31 22:41:14 +1000632.Pa /etc/ssh/ssh_host_rsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000633for protocol version 2.
634Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100635.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000636will refuse to use a file if it is group/world-accessible.
637It is possible to have multiple host key files.
638.Dq rsa1
639keys are used for version 1 and
Damien Millereb8b60e2010-08-31 22:41:14 +1000640.Dq dsa ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100641.Dq ecdsa ,
642.Dq ed25519
Ben Lindstrom9f049032002-06-21 00:59:05 +0000643or
644.Dq rsa
645are used for version 2 of the SSH protocol.
Damien Miller85b45e02013-07-20 13:21:52 +1000646It is also possible to specify public host key files instead.
647In this case operations on the private key will be delegated
648to an
649.Xr ssh-agent 1 .
650.It Cm HostKeyAgent
651Identifies the UNIX-domain socket used to communicate
652with an agent that has access to the private host keys.
653If
654.Dq SSH_AUTH_SOCK
655is specified, the location of the socket will be read from the
656.Ev SSH_AUTH_SOCK
657environment variable.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000658.It Cm IgnoreRhosts
659Specifies that
660.Pa .rhosts
661and
662.Pa .shosts
663files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000664.Cm RhostsRSAAuthentication
665or
666.Cm HostbasedAuthentication .
667.Pp
668.Pa /etc/hosts.equiv
669and
670.Pa /etc/shosts.equiv
671are still used.
672The default is
673.Dq yes .
674.It Cm IgnoreUserKnownHosts
675Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100676.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000677should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000678.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000679during
680.Cm RhostsRSAAuthentication
681or
682.Cm HostbasedAuthentication .
683The default is
684.Dq no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100685.It Cm IPQoS
686Specifies the IPv4 type-of-service or DSCP class for the connection.
687Accepted values are
688.Dq af11 ,
689.Dq af12 ,
690.Dq af13 ,
Damien Millerf6e758c2011-09-22 21:37:13 +1000691.Dq af21 ,
Damien Miller0dac6fb2010-11-20 15:19:38 +1100692.Dq af22 ,
693.Dq af23 ,
694.Dq af31 ,
695.Dq af32 ,
696.Dq af33 ,
697.Dq af41 ,
698.Dq af42 ,
699.Dq af43 ,
700.Dq cs0 ,
701.Dq cs1 ,
702.Dq cs2 ,
703.Dq cs3 ,
704.Dq cs4 ,
705.Dq cs5 ,
706.Dq cs6 ,
707.Dq cs7 ,
708.Dq ef ,
709.Dq lowdelay ,
710.Dq throughput ,
711.Dq reliability ,
712or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +1100713This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100714If one argument is specified, it is used as the packet class unconditionally.
715If two values are specified, the first is automatically selected for
716interactive sessions and the second for non-interactive sessions.
717The default is
718.Dq lowdelay
719for interactive sessions and
720.Dq throughput
721for non-interactive sessions.
Damien Millere1e480a2014-02-04 11:13:17 +1100722.It Cm KbdInteractiveAuthentication
723Specifies whether to allow keyboard-interactive authentication.
724The argument to this keyword must be
725.Dq yes
726or
727.Dq no .
728The default is to use whatever value
729.Cm ChallengeResponseAuthentication
730is set to
731(by default
732.Dq yes ) .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000733.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000734Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000735.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000736will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000737To use this option, the server needs a
738Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100739The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000740.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100741.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000742If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100743an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100744The default is
Damien Miller8448e662004-03-08 23:13:15 +1100745.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000746.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100747If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000748the password will be validated via any additional local mechanism
749such as
750.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100751The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000752.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000753.It Cm KerberosTicketCleanup
754Specifies whether to automatically destroy the user's ticket cache
755file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100756The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000757.Dq yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000758.It Cm KexAlgorithms
759Specifies the available KEX (Key Exchange) algorithms.
760Multiple algorithms must be comma-separated.
Damien Millerc1621c82014-04-20 13:22:46 +1000761The supported algorithms are:
762.Pp
763.Bl -item -compact -offset indent
764.It
765curve25519-sha256@libssh.org
766.It
767diffie-hellman-group1-sha1
768.It
769diffie-hellman-group14-sha1
770.It
771diffie-hellman-group-exchange-sha1
772.It
773diffie-hellman-group-exchange-sha256
774.It
775ecdh-sha2-nistp256
776.It
777ecdh-sha2-nistp384
778.It
779ecdh-sha2-nistp521
780.El
781.Pp
782The default is:
Damien Miller6575c3a2013-12-18 17:47:02 +1100783.Bd -literal -offset indent
784curve25519-sha256@libssh.org,
785ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
786diffie-hellman-group-exchange-sha256,
Damien Millerc1621c82014-04-20 13:22:46 +1000787diffie-hellman-group14-sha1
Damien Miller6575c3a2013-12-18 17:47:02 +1100788.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000789.Pp
790The list of available key exchange algorithms may also be obtained using the
791.Fl Q
792option of
793.Xr ssh 1
794with an argument of
795.Dq kex .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000796.It Cm KeyRegenerationInterval
797In protocol version 1, the ephemeral server key is automatically regenerated
798after this many seconds (if it has been used).
799The purpose of regeneration is to prevent
800decrypting captured sessions by later breaking into the machine and
801stealing the keys.
802The key is never stored anywhere.
803If the value is 0, the key is never regenerated.
804The default is 3600 (seconds).
805.It Cm ListenAddress
806Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100807.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000808should listen on.
809The following forms may be used:
810.Pp
811.Bl -item -offset indent -compact
812.It
813.Cm ListenAddress
814.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000815.Ar host | Ar IPv4_addr | Ar IPv6_addr
Ben Lindstrom9f049032002-06-21 00:59:05 +0000816.Sm on
817.It
818.Cm ListenAddress
819.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000820.Ar host | Ar IPv4_addr : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000821.Sm on
822.It
823.Cm ListenAddress
824.Sm off
825.Oo
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000826.Ar host | Ar IPv6_addr Oc : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000827.Sm on
828.El
829.Pp
830If
831.Ar port
832is not specified,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100833sshd will listen on the address and all prior
Ben Lindstrom9f049032002-06-21 00:59:05 +0000834.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000835options specified.
836The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000837Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000838.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000839options are permitted.
840Additionally, any
Ben Lindstrom9f049032002-06-21 00:59:05 +0000841.Cm Port
Damien Miller5b0d63f2006-03-15 11:56:56 +1100842options must precede this option for non-port qualified addresses.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000843.It Cm LoginGraceTime
844The server disconnects after this time if the user has not
845successfully logged in.
846If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000847The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000848.It Cm LogLevel
849Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100850.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000851The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100852QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000853The default is INFO.
854DEBUG and DEBUG1 are equivalent.
855DEBUG2 and DEBUG3 each specify higher levels of debugging output.
856Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000857.It Cm MACs
858Specifies the available MAC (message authentication code) algorithms.
859The MAC algorithm is used in protocol version 2
860for data integrity protection.
861Multiple algorithms must be comma-separated.
Damien Milleraf43a7a2012-12-12 10:46:31 +1100862The algorithms that contain
863.Dq -etm
864calculate the MAC after encryption (encrypt-then-mac).
865These are considered safer and their use recommended.
Damien Millerc1621c82014-04-20 13:22:46 +1000866The supported MACs are:
867.Pp
868.Bl -item -compact -offset indent
869.It
870hmac-md5
871.It
872hmac-md5-96
873.It
874hmac-ripemd160
875.It
876hmac-sha1
877.It
878hmac-sha1-96
879.It
880hmac-sha2-256
881.It
882hmac-sha2-512
883.It
884umac-64@openssh.com
885.It
886umac-128@openssh.com
887.It
888hmac-md5-etm@openssh.com
889.It
890hmac-md5-96-etm@openssh.com
891.It
892hmac-ripemd160-etm@openssh.com
893.It
894hmac-sha1-etm@openssh.com
895.It
896hmac-sha1-96-etm@openssh.com
897.It
898hmac-sha2-256-etm@openssh.com
899.It
900hmac-sha2-512-etm@openssh.com
901.It
902umac-64-etm@openssh.com
903.It
904umac-128-etm@openssh.com
905.El
906.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100907The default is:
Damien Miller22b7b492007-06-11 14:07:12 +1000908.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +1100909umac-64-etm@openssh.com,umac-128-etm@openssh.com,
910hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000911umac-64@openssh.com,umac-128@openssh.com,
912hmac-sha2-256,hmac-sha2-512
Damien Miller22b7b492007-06-11 14:07:12 +1000913.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000914.Pp
915The list of available MAC algorithms may also be obtained using the
916.Fl Q
917option of
918.Xr ssh 1
919with an argument of
920.Dq mac .
Darren Tucker45150472006-07-12 22:34:17 +1000921.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +1000922Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +1000923If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +1000924.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000925line are satisfied, the keywords on the following lines override those
926set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +1000927.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000928line or the end of the file.
Damien Millerfc5d6752014-02-28 10:01:28 +1100929If a keyword appears in multiple
930.Cm Match
sobrado@openbsd.org180bcb42014-08-30 16:32:25 +0000931blocks that are satisfied, only the first instance of the keyword is
Damien Millerfc5d6752014-02-28 10:01:28 +1100932applied.
Darren Tucker7a3935d2008-06-10 22:59:10 +1000933.Pp
Damien Millerd04f3572006-07-24 13:46:50 +1000934The arguments to
Darren Tucker45150472006-07-12 22:34:17 +1000935.Cm Match
Damien Millercf31f382013-10-24 21:02:56 +1100936are one or more criteria-pattern pairs or the single token
937.Cm All
938which matches all criteria.
Darren Tucker45150472006-07-12 22:34:17 +1000939The available criteria are
940.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +1000941.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +1000942.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +1000943.Cm LocalAddress ,
944.Cm LocalPort ,
Darren Tucker45150472006-07-12 22:34:17 +1000945and
946.Cm Address .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000947The match patterns may consist of single entries or comma-separated
948lists and may use the wildcard and negation operators described in the
Damien Millerfecfd112013-07-18 16:11:50 +1000949PATTERNS section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +1000950.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000951.Pp
952The patterns in an
953.Cm Address
954criteria may additionally contain addresses to match in CIDR
Darren Tucker6a2a4002008-06-10 23:03:04 +1000955address/masklen format, e.g.\&
Darren Tucker7a3935d2008-06-10 22:59:10 +1000956.Dq 192.0.2.0/24
957or
958.Dq 3ffe:ffff::/32 .
959Note that the mask length provided must be consistent with the address -
960it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +1000961or one with bits set in this host portion of the address.
962For example,
Darren Tucker7a3935d2008-06-10 22:59:10 +1000963.Dq 192.0.2.0/33
964and
Darren Tucker6a2a4002008-06-10 23:03:04 +1000965.Dq 192.0.2.0/8
Darren Tucker7a3935d2008-06-10 22:59:10 +1000966respectively.
967.Pp
Darren Tucker45150472006-07-12 22:34:17 +1000968Only a subset of keywords may be used on the lines following a
969.Cm Match
970keyword.
971Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +1000972.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +1100973.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +1000974.Cm AllowGroups ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +0000975.Cm AllowStreamLocalForwarding ,
Damien Miller9b439df2006-07-24 14:04:00 +1000976.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +1000977.Cm AllowUsers ,
Damien Millera6e3f012012-11-04 23:21:40 +1100978.Cm AuthenticationMethods ,
Damien Miller09d3e122012-10-31 08:58:58 +1100979.Cm AuthorizedKeysCommand ,
980.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +1100981.Cm AuthorizedKeysFile ,
Damien Millerab6de352010-06-26 09:38:45 +1000982.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +1100983.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +1000984.Cm ChrootDirectory ,
Damien Millerc24da772012-06-20 21:53:58 +1000985.Cm DenyGroups ,
986.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +1000987.Cm ForceCommand ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +0000988.Cm GatewayPorts ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +0000989.Cm GSSAPIAuthentication ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000990.Cm HostbasedAcceptedKeyTypes ,
Damien Miller25434de2008-05-19 14:29:08 +1000991.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +1000992.Cm HostbasedUsesNameFromPacketOnly ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +0000993.Cm IPQoS ,
Darren Tucker1d75f222007-03-01 21:31:28 +1100994.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +1100995.Cm KerberosAuthentication ,
Damien Miller307c1d12008-06-16 07:56:20 +1000996.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +1000997.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +1100998.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +1100999.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +10001000.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +11001001.Cm PermitRootLogin ,
Damien Miller5ff30c62013-10-30 22:21:50 +11001002.Cm PermitTTY ,
Damien Millerab6de352010-06-26 09:38:45 +10001003.Cm PermitTunnel ,
Damien Miller72e6b5c2014-07-04 09:00:04 +10001004.Cm PermitUserRC ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001005.Cm PubkeyAcceptedKeyTypes ,
Darren Tucker1477ea12009-10-07 08:36:05 +11001006.Cm PubkeyAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001007.Cm RekeyLimit ,
1008.Cm RevokedKeys ,
1009.Cm RhostsRSAAuthentication ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +00001010.Cm RSAAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001011.Cm StreamLocalBindMask ,
1012.Cm StreamLocalBindUnlink ,
1013.Cm TrustedUserCAKeys ,
Damien Millerd1de9952006-07-24 14:05:48 +10001014.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +11001015.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +10001016and
Damien Miller0296ae82009-02-23 11:00:24 +11001017.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +10001018.It Cm MaxAuthTries
1019Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +10001020connection.
1021Once the number of failures reaches half this value,
1022additional failures are logged.
1023The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +10001024.It Cm MaxSessions
1025Specifies the maximum number of open sessions permitted per network connection.
1026The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001027.It Cm MaxStartups
1028Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001029SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001030Additional connections will be dropped until authentication succeeds or the
1031.Cm LoginGraceTime
1032expires for a connection.
Damien Miller1f583df2013-02-12 11:02:08 +11001033The default is 10:30:100.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001034.Pp
1035Alternatively, random early drop can be enabled by specifying
1036the three colon separated values
1037.Dq start:rate:full
Damien Miller208f1ed2006-03-15 11:56:03 +11001038(e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +11001039.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001040will refuse connection attempts with a probability of
1041.Dq rate/100
1042(30%)
1043if there are currently
1044.Dq start
1045(10)
1046unauthenticated connections.
1047The probability increases linearly and all connection attempts
1048are refused if the number of unauthenticated connections reaches
1049.Dq full
1050(60).
1051.It Cm PasswordAuthentication
1052Specifies whether password authentication is allowed.
1053The default is
1054.Dq yes .
1055.It Cm PermitEmptyPasswords
1056When password authentication is allowed, it specifies whether the
1057server allows login to accounts with empty password strings.
1058The default is
1059.Dq no .
Damien Miller9b439df2006-07-24 14:04:00 +10001060.It Cm PermitOpen
1061Specifies the destinations to which TCP port forwarding is permitted.
1062The forwarding specification must be one of the following forms:
1063.Pp
1064.Bl -item -offset indent -compact
1065.It
1066.Cm PermitOpen
1067.Sm off
1068.Ar host : port
1069.Sm on
1070.It
1071.Cm PermitOpen
1072.Sm off
1073.Ar IPv4_addr : port
1074.Sm on
1075.It
1076.Cm PermitOpen
1077.Sm off
1078.Ar \&[ IPv6_addr \&] : port
1079.Sm on
1080.El
1081.Pp
Damien Millera765cf42006-07-24 14:08:13 +10001082Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +10001083An argument of
1084.Dq any
1085can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +10001086An argument of
1087.Dq none
1088can be used to prohibit all forwarding requests.
Damien Miller65bc2c42006-07-24 14:04:16 +10001089By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001090.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +11001091Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +00001092.Xr ssh 1 .
1093The argument must be
1094.Dq yes ,
1095.Dq without-password ,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001096.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001097or
1098.Dq no .
1099The default is
djm@openbsd.org88a7c592015-04-27 21:42:48 +00001100.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001101.Pp
1102If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001103.Dq without-password ,
Darren Tucker9dca0992005-02-01 19:16:45 +11001104password authentication is disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001105.Pp
1106If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001107.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001108root login with public key authentication will be allowed,
1109but only if the
1110.Ar command
1111option has been specified
1112(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +10001113normally not allowed).
1114All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001115.Pp
1116If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001117.Dq no ,
Darren Tuckerb3509012005-01-20 11:01:46 +11001118root is not allowed to log in.
Damien Millerd27b9472005-12-13 19:29:02 +11001119.It Cm PermitTunnel
1120Specifies whether
1121.Xr tun 4
1122device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +11001123The argument must be
1124.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +10001125.Dq point-to-point
1126(layer 3),
1127.Dq ethernet
1128(layer 2), or
Damien Miller7b58e802005-12-13 19:33:19 +11001129.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +10001130Specifying
1131.Dq yes
1132permits both
1133.Dq point-to-point
1134and
1135.Dq ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +11001136The default is
1137.Dq no .
djm@openbsd.org48dffd52014-09-09 09:45:36 +00001138.Pp
1139Independent of this setting, the permissions of the selected
1140.Xr tun 4
1141device must allow access to the user.
Damien Miller5ff30c62013-10-30 22:21:50 +11001142.It Cm PermitTTY
1143Specifies whether
Damien Miller63857c92013-10-30 22:31:06 +11001144.Xr pty 4
Damien Miller5ff30c62013-10-30 22:21:50 +11001145allocation is permitted.
1146The default is
1147.Dq yes .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001148.It Cm PermitUserEnvironment
1149Specifies whether
1150.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001151and
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001152.Cm environment=
1153options in
1154.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001155are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +11001156.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001157The default is
1158.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001159Enabling environment processing may enable users to bypass access
1160restrictions in some configurations using mechanisms such as
1161.Ev LD_PRELOAD .
Damien Miller72e6b5c2014-07-04 09:00:04 +10001162.It Cm PermitUserRC
1163Specifies whether any
1164.Pa ~/.ssh/rc
1165file is executed.
1166The default is
1167.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001168.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +00001169Specifies the file that contains the process ID of the
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001170SSH daemon, or
1171.Dq none
1172to not write one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001173The default is
1174.Pa /var/run/sshd.pid .
1175.It Cm Port
1176Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +11001177.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001178listens on.
1179The default is 22.
1180Multiple options of this type are permitted.
1181See also
1182.Cm ListenAddress .
1183.It Cm PrintLastLog
1184Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001185.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +11001186should print the date and time of the last user login when a user logs
1187in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001188The default is
1189.Dq yes .
1190.It Cm PrintMotd
1191Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001192.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001193should print
1194.Pa /etc/motd
1195when a user logs in interactively.
1196(On some systems it is also printed by the shell,
1197.Pa /etc/profile ,
1198or equivalent.)
1199The default is
1200.Dq yes .
1201.It Cm Protocol
1202Specifies the protocol versions
Damien Miller5b0d63f2006-03-15 11:56:56 +11001203.Xr sshd 8
Ben Lindstrom9c445542002-07-11 03:59:18 +00001204supports.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001205The possible values are
Damien Miller5b0d63f2006-03-15 11:56:56 +11001206.Sq 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001207and
Damien Miller5b0d63f2006-03-15 11:56:56 +11001208.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001209Multiple versions must be comma-separated.
1210The default is
Darren Tucker7a4a7652009-10-11 21:51:40 +11001211.Sq 2 .
Ben Lindstrom9c445542002-07-11 03:59:18 +00001212Note that the order of the protocol list does not indicate preference,
1213because the client selects among multiple protocol versions offered
1214by the server.
1215Specifying
1216.Dq 2,1
1217is identical to
1218.Dq 1,2 .
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001219.It Cm PubkeyAcceptedKeyTypes
1220Specifies the key types that will be accepted for public key authentication
1221as a comma-separated pattern list.
1222The default
1223.Dq *
1224will allow all key types.
1225The
1226.Fl Q
1227option of
1228.Xr ssh 1
1229may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001230.It Cm PubkeyAuthentication
1231Specifies whether public key authentication is allowed.
1232The default is
1233.Dq yes .
1234Note that this option applies to protocol version 2 only.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001235.It Cm RekeyLimit
1236Specifies the maximum amount of data that may be transmitted before the
1237session key is renegotiated, optionally followed a maximum amount of
1238time that may pass before the session key is renegotiated.
1239The first argument is specified in bytes and may have a suffix of
1240.Sq K ,
1241.Sq M ,
1242or
1243.Sq G
1244to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1245The default is between
1246.Sq 1G
1247and
1248.Sq 4G ,
1249depending on the cipher.
1250The optional second value is specified in seconds and may use any of the
1251units documented in the
1252.Sx TIME FORMATS
Darren Tucker64d22942013-05-16 20:31:29 +10001253section.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001254The default value for
1255.Cm RekeyLimit
1256is
1257.Dq default none ,
1258which means that rekeying is performed after the cipher's default amount
1259of data has been sent or received and no time based rekeying is done.
1260This option applies to protocol version 2 only.
Damien Miller1aed65e2010-03-04 21:53:35 +11001261.It Cm RevokedKeys
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001262Specifies revoked public keys file, or
1263.Dq none
1264to not use one.
Damien Miller1aed65e2010-03-04 21:53:35 +11001265Keys listed in this file will be refused for public key authentication.
1266Note that if this file is not readable, then public key authentication will
1267be refused for all users.
Damien Millerf3747bf2013-01-18 11:44:04 +11001268Keys may be specified as a text file, listing one public key per line, or as
1269an OpenSSH Key Revocation List (KRL) as generated by
Damien Miller72abeb72013-01-20 22:33:44 +11001270.Xr ssh-keygen 1 .
Damien Millerfecfd112013-07-18 16:11:50 +10001271For more information on KRLs, see the KEY REVOCATION LISTS section in
Damien Millerf3747bf2013-01-18 11:44:04 +11001272.Xr ssh-keygen 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001273.It Cm RhostsRSAAuthentication
1274Specifies whether rhosts or /etc/hosts.equiv authentication together
1275with successful RSA host authentication is allowed.
1276The default is
1277.Dq no .
1278This option applies to protocol version 1 only.
1279.It Cm RSAAuthentication
1280Specifies whether pure RSA authentication is allowed.
1281The default is
1282.Dq yes .
1283This option applies to protocol version 1 only.
1284.It Cm ServerKeyBits
1285Defines the number of bits in the ephemeral protocol version 1 server key.
Darren Tucker7499b0c2008-07-02 22:35:43 +10001286The minimum value is 512, and the default is 1024.
Damien Miller7acefbb2014-07-18 14:11:24 +10001287.It Cm StreamLocalBindMask
1288Sets the octal file creation mode mask
1289.Pq umask
1290used when creating a Unix-domain socket file for local or remote
1291port forwarding.
1292This option is only used for port forwarding to a Unix-domain socket file.
1293.Pp
1294The default value is 0177, which creates a Unix-domain socket file that is
1295readable and writable only by the owner.
1296Note that not all operating systems honor the file mode on Unix-domain
1297socket files.
1298.It Cm StreamLocalBindUnlink
1299Specifies whether to remove an existing Unix-domain socket file for local
1300or remote port forwarding before creating a new one.
1301If the socket file already exists and
1302.Cm StreamLocalBindUnlink
1303is not enabled,
1304.Nm sshd
1305will be unable to forward the port to the Unix-domain socket file.
1306This option is only used for port forwarding to a Unix-domain socket file.
1307.Pp
1308The argument must be
1309.Dq yes
1310or
1311.Dq no .
1312The default is
1313.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001314.It Cm StrictModes
1315Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001316.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001317should check file modes and ownership of the
1318user's files and home directory before accepting login.
1319This is normally desirable because novices sometimes accidentally leave their
1320directory or files world-writable.
1321The default is
1322.Dq yes .
Darren Tuckerf788a912010-01-08 17:06:47 +11001323Note that this does not apply to
1324.Cm ChrootDirectory ,
1325whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001326.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +11001327Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +10001328Arguments should be a subsystem name and a command (with optional arguments)
1329to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001330.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001331The command
1332.Xr sftp-server 8
1333implements the
1334.Dq sftp
1335file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001336.Pp
1337Alternately the name
1338.Dq internal-sftp
1339implements an in-process
1340.Dq sftp
1341server.
1342This may simplify configurations using
1343.Cm ChrootDirectory
1344to force a different filesystem root on clients.
1345.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001346By default no subsystems are defined.
1347Note that this option applies to protocol version 2 only.
1348.It Cm SyslogFacility
1349Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001350.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001351The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1352LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1353The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001354.It Cm TCPKeepAlive
1355Specifies whether the system should send TCP keepalive messages to the
1356other side.
1357If they are sent, death of the connection or crash of one
1358of the machines will be properly noticed.
1359However, this means that
1360connections will die if the route is down temporarily, and some people
1361find it annoying.
1362On the other hand, if TCP keepalives are not sent,
1363sessions may hang indefinitely on the server, leaving
1364.Dq ghost
1365users and consuming server resources.
1366.Pp
1367The default is
1368.Dq yes
1369(to send TCP keepalive messages), and the server will notice
1370if the network goes down or the client host crashes.
1371This avoids infinitely hanging sessions.
1372.Pp
1373To disable TCP keepalive messages, the value should be set to
1374.Dq no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001375.It Cm TrustedUserCAKeys
1376Specifies a file containing public keys of certificate authorities that are
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001377trusted to sign user certificates for authentication, or
1378.Dq none
1379to not use one.
Damien Miller72b33822010-03-05 07:39:01 +11001380Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001381.Ql #
1382are allowed.
1383If a certificate is presented for authentication and has its signing CA key
1384listed in this file, then it may be used for authentication for any user
1385listed in the certificate's principals list.
1386Note that certificates that lack a list of principals will not be permitted
1387for authentication using
1388.Cm TrustedUserCAKeys .
Damien Millerfecfd112013-07-18 16:11:50 +10001389For more details on certificates, see the CERTIFICATES section in
Damien Miller1aed65e2010-03-04 21:53:35 +11001390.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001391.It Cm UseDNS
1392Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001393.Xr sshd 8
Darren Tucker83d5a982005-03-31 21:33:50 +10001394should look up the remote host name and check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001395the resolved host name for the remote IP address maps back to the
1396very same IP address.
1397The default is
deraadt@openbsd.org3cd51032015-02-02 01:57:44 +00001398.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001399.It Cm UseLogin
1400Specifies whether
1401.Xr login 1
1402is used for interactive login sessions.
1403The default is
1404.Dq no .
1405Note that
1406.Xr login 1
1407is never used for remote command execution.
1408Note also, that if this is enabled,
1409.Cm X11Forwarding
1410will be disabled because
1411.Xr login 1
1412does not know how to handle
1413.Xr xauth 1
Damien Miller495dca32003-04-01 21:42:14 +10001414cookies.
1415If
Ben Lindstrom9f049032002-06-21 00:59:05 +00001416.Cm UsePrivilegeSeparation
1417is specified, it will be disabled after authentication.
Damien Miller2e193e22003-05-14 15:13:03 +10001418.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001419Enables the Pluggable Authentication Module interface.
1420If set to
1421.Dq yes
1422this will enable PAM authentication using
1423.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001424and
1425.Cm PasswordAuthentication
1426in addition to PAM account and session module processing for all
1427authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001428.Pp
1429Because PAM challenge-response authentication usually serves an equivalent
1430role to password authentication, you should disable either
1431.Cm PasswordAuthentication
1432or
1433.Cm ChallengeResponseAuthentication.
1434.Pp
1435If
1436.Cm UsePAM
1437is enabled, you will not be able to run
1438.Xr sshd 8
1439as a non-root user.
1440The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +10001441.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001442.It Cm UsePrivilegeSeparation
1443Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001444.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001445separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +10001446to deal with incoming network traffic.
1447After successful authentication, another process will be created that has
1448the privilege of the authenticated user.
1449The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +00001450escalation by containing any corruption within the unprivileged processes.
1451The default is
1452.Dq yes .
Damien Miller69ff1df2011-06-23 08:30:03 +10001453If
1454.Cm UsePrivilegeSeparation
1455is set to
1456.Dq sandbox
1457then the pre-authentication unprivileged process is subject to additional
1458restrictions.
Damien Miller23528812012-04-22 11:24:43 +10001459.It Cm VersionAddendum
1460Optionally specifies additional text to append to the SSH protocol banner
1461sent by the server upon connection.
1462The default is
1463.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001464.It Cm X11DisplayOffset
1465Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001466.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001467X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001468This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001469The default is 10.
1470.It Cm X11Forwarding
1471Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001472The argument must be
1473.Dq yes
1474or
1475.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001476The default is
1477.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +10001478.Pp
1479When X11 forwarding is enabled, there may be additional exposure to
1480the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001481.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001482proxy display is configured to listen on the wildcard address (see
1483.Cm X11UseLocalhost
Damien Miller5b0d63f2006-03-15 11:56:56 +11001484below), though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001485Additionally, the authentication spoofing and authentication data
1486verification and substitution occur on the client side.
1487The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001488display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001489forwarding (see the warnings for
1490.Cm ForwardX11
1491in
Damien Millerf1ce5052003-06-11 22:04:39 +10001492.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001493A system administrator may have a stance in which they want to
1494protect clients that may expose themselves to attack by unwittingly
1495requesting X11 forwarding, which can warrant a
1496.Dq no
1497setting.
1498.Pp
1499Note that disabling X11 forwarding does not prevent users from
1500forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001501X11 forwarding is automatically disabled if
1502.Cm UseLogin
1503is enabled.
1504.It Cm X11UseLocalhost
1505Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001506.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001507should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001508the wildcard address.
1509By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001510sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001511hostname part of the
1512.Ev DISPLAY
1513environment variable to
1514.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001515This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001516However, some older X11 clients may not function with this
1517configuration.
1518.Cm X11UseLocalhost
1519may be set to
1520.Dq no
1521to specify that the forwarding server should be bound to the wildcard
1522address.
1523The argument must be
1524.Dq yes
1525or
1526.Dq no .
1527The default is
1528.Dq yes .
1529.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001530Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001531.Xr xauth 1
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001532program, or
1533.Dq none
1534to not use one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001535The default is
1536.Pa /usr/X11R6/bin/xauth .
1537.El
Damien Millere3beba22006-03-15 11:59:25 +11001538.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001539.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001540command-line arguments and configuration file options that specify time
1541may be expressed using a sequence of the form:
1542.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001543.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001544.Sm on
1545where
1546.Ar time
1547is a positive integer value and
1548.Ar qualifier
1549is one of the following:
1550.Pp
1551.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001552.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001553seconds
1554.It Cm s | Cm S
1555seconds
1556.It Cm m | Cm M
1557minutes
1558.It Cm h | Cm H
1559hours
1560.It Cm d | Cm D
1561days
1562.It Cm w | Cm W
1563weeks
1564.El
1565.Pp
1566Each member of the sequence is added together to calculate
1567the total time value.
1568.Pp
1569Time format examples:
1570.Pp
1571.Bl -tag -width Ds -compact -offset indent
1572.It 600
1573600 seconds (10 minutes)
1574.It 10m
157510 minutes
1576.It 1h30m
15771 hour 30 minutes (90 minutes)
1578.El
1579.Sh FILES
1580.Bl -tag -width Ds
1581.It Pa /etc/ssh/sshd_config
1582Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001583.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001584This file should be writable by root only, but it is recommended
1585(though not necessary) that it be world-readable.
1586.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001587.Sh SEE ALSO
1588.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001589.Sh AUTHORS
1590OpenSSH is a derivative of the original and free
1591ssh 1.2.12 release by Tatu Ylonen.
1592Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1593Theo de Raadt and Dug Song
1594removed many bugs, re-added newer features and
1595created OpenSSH.
1596Markus Friedl contributed the support for SSH
1597protocol versions 1.5 and 2.0.
1598Niels Provos and Markus Friedl contributed support
1599for privilege separation.