blob: e40ecedef2e6545cea56d29b6c13151130509ae4 [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.\"
djm@openbsd.org24232a32015-05-21 06:38:35 +000036.\" $OpenBSD: sshd_config.5,v 1.201 2015/05/21 06:38:35 djm Exp $
37.Dd $Mdocdate: May 21 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.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000237The program must be owned by root, not writable by group or others and
238specified by an absolute path.
239.Pp
240Arguments to
241.Cm AuthorizedKeysCommand
242may be provided using the following tokens, which will be expanded
243at runtime: %% is replaced by a literal '%', %u is replaced by the
244username being authenticated, %h is replaced by the home directory
245of the user being authenticated, %t is replaced with the key type
246offered for authentication, %f is replaced with the fingerprint of
247the key, and %k is replaced with the key being offered for authentication.
248If no arguments are specified then the username of the target user
249will be supplied.
250.Pp
251The program should produce on standard output zero or
Damien Millerfecfd112013-07-18 16:11:50 +1000252more lines of authorized_keys output (see AUTHORIZED_KEYS in
Damien Millerf33580e2012-11-04 22:22:52 +1100253.Xr sshd 8 ) .
Damien Miller09d3e122012-10-31 08:58:58 +1100254If a key supplied by AuthorizedKeysCommand does not successfully authenticate
255and authorize the user then public key authentication continues using the usual
256.Cm AuthorizedKeysFile
257files.
258By default, no AuthorizedKeysCommand is run.
259.It Cm AuthorizedKeysCommandUser
260Specifies the user under whose account the AuthorizedKeysCommand is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100261It is recommended to use a dedicated user that has no other role on the host
262than running authorized keys commands.
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000263If
djm@openbsd.orgd663bea2014-12-11 05:25:06 +0000264.Cm AuthorizedKeysCommand
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000265is specified but
266.Cm AuthorizedKeysCommandUser
267is not, then
268.Xr sshd 8
269will refuse to start.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000270.It Cm AuthorizedKeysFile
271Specifies the file that contains the public keys that can be used
272for user authentication.
Damien Miller6018a362010-07-02 13:35:19 +1000273The format is described in the
Damien Millerfecfd112013-07-18 16:11:50 +1000274AUTHORIZED_KEYS FILE FORMAT
Damien Miller6018a362010-07-02 13:35:19 +1000275section of
276.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000277.Cm AuthorizedKeysFile
278may contain tokens of the form %T which are substituted during connection
Damien Miller5b0d63f2006-03-15 11:56:56 +1100279setup.
Damien Millerfbf486b2003-05-23 18:44:23 +1000280The following tokens are defined: %% is replaced by a literal '%',
Damien Miller5b0d63f2006-03-15 11:56:56 +1100281%h is replaced by the home directory of the user being authenticated, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000282%u is replaced by the username of that user.
283After expansion,
284.Cm AuthorizedKeysFile
285is taken to be an absolute path or one relative to the user's home
286directory.
Damien Millerb9132fc2011-05-29 21:41:40 +1000287Multiple files may be listed, separated by whitespace.
288The default is
289.Dq .ssh/authorized_keys .ssh/authorized_keys2 .
Damien Miller30da3442010-05-10 11:58:03 +1000290.It Cm AuthorizedPrincipalsFile
291Specifies a file that lists principal names that are accepted for
292certificate authentication.
293When using certificates signed by a key listed in
294.Cm TrustedUserCAKeys ,
295this file lists names, one of which must appear in the certificate for it
296to be accepted for authentication.
Damien Millerd59dab82010-07-02 13:37:17 +1000297Names are listed one per line preceded by key options (as described
Damien Millerfecfd112013-07-18 16:11:50 +1000298in AUTHORIZED_KEYS FILE FORMAT in
Damien Millerd59dab82010-07-02 13:37:17 +1000299.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000300Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000301.Ql #
302are ignored.
303.Pp
304.Cm AuthorizedPrincipalsFile
305may contain tokens of the form %T which are substituted during connection
306setup.
307The following tokens are defined: %% is replaced by a literal '%',
308%h is replaced by the home directory of the user being authenticated, and
309%u is replaced by the username of that user.
310After expansion,
311.Cm AuthorizedPrincipalsFile
312is taken to be an absolute path or one relative to the user's home
313directory.
314.Pp
Damien Miller8fef9eb2012-04-22 11:25:10 +1000315The default is
316.Dq none ,
317i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000318of the user must appear in a certificate's principals list for it to be
319accepted.
320Note that
321.Cm AuthorizedPrincipalsFile
322is only used when authentication proceeds using a CA listed in
323.Cm TrustedUserCAKeys
324and is not consulted for certification authorities trusted via
325.Pa ~/.ssh/authorized_keys ,
326though the
327.Cm principals=
328key option offers a similar facility (see
329.Xr sshd 8
330for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000331.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000332The contents of the specified file are sent to the remote user before
333authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000334If the argument is
335.Dq none
336then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000337This option is only available for protocol version 2.
338By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000339.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000340Specifies whether challenge-response authentication is allowed (e.g. via
Damien Millere8c9f262014-10-03 09:24:56 +1000341PAM or through authentication styles supported in
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000342.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000343The default is
344.Dq yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100345.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100346Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100347.Xr chroot 2
348to after authentication.
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000349At session startup
350.Xr sshd 8
351checks that all components of the pathname are root-owned directories
352which are not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000353After the chroot,
354.Xr sshd 8
355changes the working directory to the user's home directory.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100356.Pp
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100357The pathname may contain the following tokens that are expanded at runtime once
Damien Millerd8cb1f12008-02-10 22:40:12 +1100358the connecting user has been authenticated: %% is replaced by a literal '%',
359%h is replaced by the home directory of the user being authenticated, and
360%u is replaced by the username of that user.
361.Pp
362The
363.Cm ChrootDirectory
364must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000365user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100366For an interactive session this requires at least a shell, typically
367.Xr sh 1 ,
368and basic
369.Pa /dev
370nodes such as
371.Xr null 4 ,
372.Xr zero 4 ,
373.Xr stdin 4 ,
374.Xr stdout 4 ,
375.Xr stderr 4 ,
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000376and
Damien Millerd8cb1f12008-02-10 22:40:12 +1100377.Xr tty 4
378devices.
379For file transfer sessions using
Darren Tuckerf92077f2009-06-21 17:56:25 +1000380.Dq sftp ,
Damien Millerd8cb1f12008-02-10 22:40:12 +1100381no additional configuration of the environment is necessary if the
Darren Tuckerf92077f2009-06-21 17:56:25 +1000382in-process sftp server is used,
Damien Miller426117b2014-07-30 12:33:20 +1000383though sessions which use logging may require
Darren Tucker00fcd712009-06-21 17:56:00 +1000384.Pa /dev/log
Damien Miller426117b2014-07-30 12:33:20 +1000385inside the chroot directory on some operating systems (see
Darren Tucker00fcd712009-06-21 17:56:00 +1000386.Xr sftp-server 8
387for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100388.Pp
jmc@openbsd.orga5a3e332015-01-22 21:00:42 +0000389For safety, it is very important that the directory hierarchy be
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000390prevented from modification by other processes on the system (especially
391those outside the jail).
392Misconfiguration can lead to unsafe environments which
393.Xr sshd 8
394cannot detect.
395.Pp
Damien Millerd8cb1f12008-02-10 22:40:12 +1100396The default is not to
397.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000398.It Cm Ciphers
399Specifies the ciphers allowed for protocol version 2.
400Multiple ciphers must be comma-separated.
Damien Miller0fde8ac2013-11-21 14:12:23 +1100401The supported ciphers are:
402.Pp
Damien Millerc1621c82014-04-20 13:22:46 +1000403.Bl -item -compact -offset indent
404.It
4053des-cbc
406.It
407aes128-cbc
408.It
409aes192-cbc
410.It
411aes256-cbc
412.It
413aes128-ctr
414.It
415aes192-ctr
416.It
417aes256-ctr
418.It
419aes128-gcm@openssh.com
420.It
421aes256-gcm@openssh.com
422.It
423arcfour
424.It
425arcfour128
426.It
427arcfour256
428.It
429blowfish-cbc
430.It
431cast128-cbc
432.It
433chacha20-poly1305@openssh.com
434.El
Damien Miller0fde8ac2013-11-21 14:12:23 +1100435.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100436The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000437.Bd -literal -offset indent
438aes128-ctr,aes192-ctr,aes256-ctr,
Damien Miller1d75abf2013-01-09 16:12:19 +1100439aes128-gcm@openssh.com,aes256-gcm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000440chacha20-poly1305@openssh.com
Ben Lindstrom9f049032002-06-21 00:59:05 +0000441.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100442.Pp
443The list of available ciphers may also be obtained using the
444.Fl Q
445option of
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000446.Xr ssh 1
447with an argument of
448.Dq cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000449.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100450Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000451sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100452.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000453receiving any messages back from the client.
454If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100455sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000456It is important to note that the use of client alive messages is very
457different from
Damien Miller12c150e2003-12-17 16:31:10 +1100458.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000459(below).
460The client alive messages are sent through the encrypted channel
461and therefore will not be spoofable.
462The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100463.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000464is spoofable.
465The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000466server depend on knowing when a connection has become inactive.
467.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000468The default value is 3.
469If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000470.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100471(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000472.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100473is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000474will be disconnected after approximately 45 seconds.
Damien Millercc3e8ba2006-03-15 12:06:55 +1100475This option applies to protocol version 2 only.
Damien Miller1594ad52005-05-26 12:12:19 +1000476.It Cm ClientAliveInterval
477Sets a timeout interval in seconds after which if no data has been received
478from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100479.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000480will send a message through the encrypted
481channel to request a response from the client.
482The default
483is 0, indicating that these messages will not be sent to the client.
484This option applies to protocol version 2 only.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000485.It Cm Compression
Damien Miller9786e6e2005-07-26 21:54:56 +1000486Specifies whether compression is allowed, or delayed until
487the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000488The argument must be
Damien Miller9786e6e2005-07-26 21:54:56 +1000489.Dq yes ,
490.Dq delayed ,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000491or
492.Dq no .
493The default is
Damien Miller9786e6e2005-07-26 21:54:56 +1000494.Dq delayed .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000495.It Cm DenyGroups
496This keyword can be followed by a list of group name patterns, separated
497by spaces.
498Login is disallowed for users whose primary group or supplementary
499group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000500Only group names are valid; a numerical group ID is not recognized.
501By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100502The allow/deny directives are processed in the following order:
503.Cm DenyUsers ,
504.Cm AllowUsers ,
505.Cm DenyGroups ,
506and finally
507.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100508.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000509See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100510.Xr ssh_config 5
511for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000512.It Cm DenyUsers
513This keyword can be followed by a list of user name patterns, separated
514by spaces.
515Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000516Only user names are valid; a numerical user ID is not recognized.
517By default, login is allowed for all users.
518If the pattern takes the form USER@HOST then USER and HOST
519are separately checked, restricting logins to particular
520users from particular hosts.
Damien Millerac73e512006-03-15 11:58:49 +1100521The allow/deny directives are processed in the following order:
522.Cm DenyUsers ,
523.Cm AllowUsers ,
524.Cm DenyGroups ,
525and finally
526.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100527.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000528See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100529.Xr ssh_config 5
530for more information on patterns.
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000531.It Cm FingerprintHash
532Specifies the hash algorithm used when logging key fingerprints.
533Valid options are:
534.Dq md5
535and
536.Dq sha256 .
537The default is
538.Dq sha256 .
Damien Millere2754432006-07-24 14:06:47 +1000539.It Cm ForceCommand
540Forces the execution of the command specified by
541.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100542ignoring any command supplied by the client and
543.Pa ~/.ssh/rc
544if present.
Damien Millere2754432006-07-24 14:06:47 +1000545The command is invoked by using the user's login shell with the -c option.
546This applies to shell, command, or subsystem execution.
547It is most useful inside a
548.Cm Match
549block.
550The command originally supplied by the client is available in the
551.Ev SSH_ORIGINAL_COMMAND
552environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100553Specifying a command of
554.Dq internal-sftp
555will force the use of an in-process sftp server that requires no support
556files when used with
557.Cm ChrootDirectory .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000558.It Cm GatewayPorts
559Specifies whether remote hosts are allowed to connect to ports
560forwarded for the client.
561By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100562.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000563binds remote port forwardings to the loopback address.
564This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000565.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100566can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100567should allow remote port forwardings to bind to non-loopback addresses, thus
568allowing other hosts to connect.
569The argument may be
570.Dq no
571to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000572.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100573to force remote port forwardings to bind to the wildcard address, or
574.Dq clientspecified
575to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000576The default is
577.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000578.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000579Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100580The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000581.Dq no .
582Note that this option applies to protocol version 2 only.
583.It Cm GSSAPICleanupCredentials
584Specifies whether to automatically destroy the user's credentials cache
585on logout.
586The default is
587.Dq yes .
588Note that this option applies to protocol version 2 only.
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000589.It Cm HostbasedAcceptedKeyTypes
590Specifies the key types that will be accepted for hostbased authentication
591as a comma-separated pattern list.
592The default
593.Dq *
594will allow all key types.
595The
596.Fl Q
597option of
598.Xr ssh 1
599may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000600.It Cm HostbasedAuthentication
601Specifies whether rhosts or /etc/hosts.equiv authentication together
602with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100603(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000604This option is similar to
605.Cm RhostsRSAAuthentication
606and applies to protocol version 2 only.
607The default is
608.Dq no .
Damien Millerb594f382006-08-30 11:06:34 +1000609.It Cm HostbasedUsesNameFromPacketOnly
610Specifies whether or not the server will attempt to perform a reverse
611name lookup when matching the name in the
612.Pa ~/.shosts ,
613.Pa ~/.rhosts ,
614and
615.Pa /etc/hosts.equiv
616files during
617.Cm HostbasedAuthentication .
618A setting of
619.Dq yes
620means that
621.Xr sshd 8
622uses the name supplied by the client rather than
623attempting to resolve the name from the TCP connection itself.
624The default is
625.Dq no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100626.It Cm HostCertificate
627Specifies a file containing a public host certificate.
628The certificate's public key must match a private host key already specified
629by
630.Cm HostKey .
631The default behaviour of
632.Xr sshd 8
633is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000634.It Cm HostKey
635Specifies a file containing a private host key
636used by SSH.
637The default is
638.Pa /etc/ssh/ssh_host_key
639for protocol version 1, and
Damien Millereb8b60e2010-08-31 22:41:14 +1000640.Pa /etc/ssh/ssh_host_dsa_key ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100641.Pa /etc/ssh/ssh_host_ecdsa_key ,
642.Pa /etc/ssh/ssh_host_ed25519_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000643and
Damien Millereb8b60e2010-08-31 22:41:14 +1000644.Pa /etc/ssh/ssh_host_rsa_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000645for protocol version 2.
646Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100647.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000648will refuse to use a file if it is group/world-accessible.
649It is possible to have multiple host key files.
650.Dq rsa1
651keys are used for version 1 and
Damien Millereb8b60e2010-08-31 22:41:14 +1000652.Dq dsa ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100653.Dq ecdsa ,
654.Dq ed25519
Ben Lindstrom9f049032002-06-21 00:59:05 +0000655or
656.Dq rsa
657are used for version 2 of the SSH protocol.
Damien Miller85b45e02013-07-20 13:21:52 +1000658It is also possible to specify public host key files instead.
659In this case operations on the private key will be delegated
660to an
661.Xr ssh-agent 1 .
662.It Cm HostKeyAgent
663Identifies the UNIX-domain socket used to communicate
664with an agent that has access to the private host keys.
665If
666.Dq SSH_AUTH_SOCK
667is specified, the location of the socket will be read from the
668.Ev SSH_AUTH_SOCK
669environment variable.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000670.It Cm IgnoreRhosts
671Specifies that
672.Pa .rhosts
673and
674.Pa .shosts
675files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000676.Cm RhostsRSAAuthentication
677or
678.Cm HostbasedAuthentication .
679.Pp
680.Pa /etc/hosts.equiv
681and
682.Pa /etc/shosts.equiv
683are still used.
684The default is
685.Dq yes .
686.It Cm IgnoreUserKnownHosts
687Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100688.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000689should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000690.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000691during
692.Cm RhostsRSAAuthentication
693or
694.Cm HostbasedAuthentication .
695The default is
696.Dq no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100697.It Cm IPQoS
698Specifies the IPv4 type-of-service or DSCP class for the connection.
699Accepted values are
700.Dq af11 ,
701.Dq af12 ,
702.Dq af13 ,
Damien Millerf6e758c2011-09-22 21:37:13 +1000703.Dq af21 ,
Damien Miller0dac6fb2010-11-20 15:19:38 +1100704.Dq af22 ,
705.Dq af23 ,
706.Dq af31 ,
707.Dq af32 ,
708.Dq af33 ,
709.Dq af41 ,
710.Dq af42 ,
711.Dq af43 ,
712.Dq cs0 ,
713.Dq cs1 ,
714.Dq cs2 ,
715.Dq cs3 ,
716.Dq cs4 ,
717.Dq cs5 ,
718.Dq cs6 ,
719.Dq cs7 ,
720.Dq ef ,
721.Dq lowdelay ,
722.Dq throughput ,
723.Dq reliability ,
724or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +1100725This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100726If one argument is specified, it is used as the packet class unconditionally.
727If two values are specified, the first is automatically selected for
728interactive sessions and the second for non-interactive sessions.
729The default is
730.Dq lowdelay
731for interactive sessions and
732.Dq throughput
733for non-interactive sessions.
Damien Millere1e480a2014-02-04 11:13:17 +1100734.It Cm KbdInteractiveAuthentication
735Specifies whether to allow keyboard-interactive authentication.
736The argument to this keyword must be
737.Dq yes
738or
739.Dq no .
740The default is to use whatever value
741.Cm ChallengeResponseAuthentication
742is set to
743(by default
744.Dq yes ) .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000745.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000746Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000747.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000748will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000749To use this option, the server needs a
750Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100751The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000752.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100753.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000754If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100755an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100756The default is
Damien Miller8448e662004-03-08 23:13:15 +1100757.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000758.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100759If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000760the password will be validated via any additional local mechanism
761such as
762.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100763The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000764.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000765.It Cm KerberosTicketCleanup
766Specifies whether to automatically destroy the user's ticket cache
767file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100768The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000769.Dq yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000770.It Cm KexAlgorithms
771Specifies the available KEX (Key Exchange) algorithms.
772Multiple algorithms must be comma-separated.
Damien Millerc1621c82014-04-20 13:22:46 +1000773The supported algorithms are:
774.Pp
775.Bl -item -compact -offset indent
776.It
777curve25519-sha256@libssh.org
778.It
779diffie-hellman-group1-sha1
780.It
781diffie-hellman-group14-sha1
782.It
783diffie-hellman-group-exchange-sha1
784.It
785diffie-hellman-group-exchange-sha256
786.It
787ecdh-sha2-nistp256
788.It
789ecdh-sha2-nistp384
790.It
791ecdh-sha2-nistp521
792.El
793.Pp
794The default is:
Damien Miller6575c3a2013-12-18 17:47:02 +1100795.Bd -literal -offset indent
796curve25519-sha256@libssh.org,
797ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
798diffie-hellman-group-exchange-sha256,
Damien Millerc1621c82014-04-20 13:22:46 +1000799diffie-hellman-group14-sha1
Damien Miller6575c3a2013-12-18 17:47:02 +1100800.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000801.Pp
802The list of available key exchange algorithms may also be obtained using the
803.Fl Q
804option of
805.Xr ssh 1
806with an argument of
807.Dq kex .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000808.It Cm KeyRegenerationInterval
809In protocol version 1, the ephemeral server key is automatically regenerated
810after this many seconds (if it has been used).
811The purpose of regeneration is to prevent
812decrypting captured sessions by later breaking into the machine and
813stealing the keys.
814The key is never stored anywhere.
815If the value is 0, the key is never regenerated.
816The default is 3600 (seconds).
817.It Cm ListenAddress
818Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100819.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000820should listen on.
821The following forms may be used:
822.Pp
823.Bl -item -offset indent -compact
824.It
825.Cm ListenAddress
826.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000827.Ar host | Ar IPv4_addr | Ar IPv6_addr
Ben Lindstrom9f049032002-06-21 00:59:05 +0000828.Sm on
829.It
830.Cm ListenAddress
831.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000832.Ar host | Ar IPv4_addr : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000833.Sm on
834.It
835.Cm ListenAddress
836.Sm off
837.Oo
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000838.Ar host | Ar IPv6_addr Oc : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000839.Sm on
840.El
841.Pp
842If
843.Ar port
844is not specified,
dtucker@openbsd.org531a57a2015-04-29 03:48:56 +0000845sshd will listen on the address and all
Ben Lindstrom9f049032002-06-21 00:59:05 +0000846.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000847options specified.
848The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000849Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000850.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000851options are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000852.It Cm LoginGraceTime
853The server disconnects after this time if the user has not
854successfully logged in.
855If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000856The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000857.It Cm LogLevel
858Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100859.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000860The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100861QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000862The default is INFO.
863DEBUG and DEBUG1 are equivalent.
864DEBUG2 and DEBUG3 each specify higher levels of debugging output.
865Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000866.It Cm MACs
867Specifies the available MAC (message authentication code) algorithms.
868The MAC algorithm is used in protocol version 2
869for data integrity protection.
870Multiple algorithms must be comma-separated.
Damien Milleraf43a7a2012-12-12 10:46:31 +1100871The algorithms that contain
872.Dq -etm
873calculate the MAC after encryption (encrypt-then-mac).
874These are considered safer and their use recommended.
Damien Millerc1621c82014-04-20 13:22:46 +1000875The supported MACs are:
876.Pp
877.Bl -item -compact -offset indent
878.It
879hmac-md5
880.It
881hmac-md5-96
882.It
883hmac-ripemd160
884.It
885hmac-sha1
886.It
887hmac-sha1-96
888.It
889hmac-sha2-256
890.It
891hmac-sha2-512
892.It
893umac-64@openssh.com
894.It
895umac-128@openssh.com
896.It
897hmac-md5-etm@openssh.com
898.It
899hmac-md5-96-etm@openssh.com
900.It
901hmac-ripemd160-etm@openssh.com
902.It
903hmac-sha1-etm@openssh.com
904.It
905hmac-sha1-96-etm@openssh.com
906.It
907hmac-sha2-256-etm@openssh.com
908.It
909hmac-sha2-512-etm@openssh.com
910.It
911umac-64-etm@openssh.com
912.It
913umac-128-etm@openssh.com
914.El
915.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100916The default is:
Damien Miller22b7b492007-06-11 14:07:12 +1000917.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +1100918umac-64-etm@openssh.com,umac-128-etm@openssh.com,
919hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000920umac-64@openssh.com,umac-128@openssh.com,
921hmac-sha2-256,hmac-sha2-512
Damien Miller22b7b492007-06-11 14:07:12 +1000922.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000923.Pp
924The list of available MAC algorithms may also be obtained using the
925.Fl Q
926option of
927.Xr ssh 1
928with an argument of
929.Dq mac .
Darren Tucker45150472006-07-12 22:34:17 +1000930.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +1000931Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +1000932If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +1000933.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000934line are satisfied, the keywords on the following lines override those
935set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +1000936.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +1000937line or the end of the file.
Damien Millerfc5d6752014-02-28 10:01:28 +1100938If a keyword appears in multiple
939.Cm Match
sobrado@openbsd.org180bcb42014-08-30 16:32:25 +0000940blocks that are satisfied, only the first instance of the keyword is
Damien Millerfc5d6752014-02-28 10:01:28 +1100941applied.
Darren Tucker7a3935d2008-06-10 22:59:10 +1000942.Pp
Damien Millerd04f3572006-07-24 13:46:50 +1000943The arguments to
Darren Tucker45150472006-07-12 22:34:17 +1000944.Cm Match
Damien Millercf31f382013-10-24 21:02:56 +1100945are one or more criteria-pattern pairs or the single token
946.Cm All
947which matches all criteria.
Darren Tucker45150472006-07-12 22:34:17 +1000948The available criteria are
949.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +1000950.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +1000951.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +1000952.Cm LocalAddress ,
953.Cm LocalPort ,
Darren Tucker45150472006-07-12 22:34:17 +1000954and
955.Cm Address .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000956The match patterns may consist of single entries or comma-separated
957lists and may use the wildcard and negation operators described in the
Damien Millerfecfd112013-07-18 16:11:50 +1000958PATTERNS section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +1000959.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +1000960.Pp
961The patterns in an
962.Cm Address
963criteria may additionally contain addresses to match in CIDR
Darren Tucker6a2a4002008-06-10 23:03:04 +1000964address/masklen format, e.g.\&
Darren Tucker7a3935d2008-06-10 22:59:10 +1000965.Dq 192.0.2.0/24
966or
967.Dq 3ffe:ffff::/32 .
968Note that the mask length provided must be consistent with the address -
969it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +1000970or one with bits set in this host portion of the address.
971For example,
Darren Tucker7a3935d2008-06-10 22:59:10 +1000972.Dq 192.0.2.0/33
973and
Darren Tucker6a2a4002008-06-10 23:03:04 +1000974.Dq 192.0.2.0/8
Darren Tucker7a3935d2008-06-10 22:59:10 +1000975respectively.
976.Pp
Darren Tucker45150472006-07-12 22:34:17 +1000977Only a subset of keywords may be used on the lines following a
978.Cm Match
979keyword.
980Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +1000981.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +1100982.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +1000983.Cm AllowGroups ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +0000984.Cm AllowStreamLocalForwarding ,
Damien Miller9b439df2006-07-24 14:04:00 +1000985.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +1000986.Cm AllowUsers ,
Damien Millera6e3f012012-11-04 23:21:40 +1100987.Cm AuthenticationMethods ,
Damien Miller09d3e122012-10-31 08:58:58 +1100988.Cm AuthorizedKeysCommand ,
989.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +1100990.Cm AuthorizedKeysFile ,
Damien Millerab6de352010-06-26 09:38:45 +1000991.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +1100992.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +1000993.Cm ChrootDirectory ,
Damien Millerc24da772012-06-20 21:53:58 +1000994.Cm DenyGroups ,
995.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +1000996.Cm ForceCommand ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +0000997.Cm GatewayPorts ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +0000998.Cm GSSAPIAuthentication ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000999.Cm HostbasedAcceptedKeyTypes ,
Damien Miller25434de2008-05-19 14:29:08 +10001000.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +10001001.Cm HostbasedUsesNameFromPacketOnly ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001002.Cm IPQoS ,
Darren Tucker1d75f222007-03-01 21:31:28 +11001003.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +11001004.Cm KerberosAuthentication ,
Damien Miller307c1d12008-06-16 07:56:20 +10001005.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +10001006.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +11001007.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +11001008.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +10001009.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +11001010.Cm PermitRootLogin ,
Damien Miller5ff30c62013-10-30 22:21:50 +11001011.Cm PermitTTY ,
Damien Millerab6de352010-06-26 09:38:45 +10001012.Cm PermitTunnel ,
Damien Miller72e6b5c2014-07-04 09:00:04 +10001013.Cm PermitUserRC ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001014.Cm PubkeyAcceptedKeyTypes ,
Darren Tucker1477ea12009-10-07 08:36:05 +11001015.Cm PubkeyAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001016.Cm RekeyLimit ,
1017.Cm RevokedKeys ,
1018.Cm RhostsRSAAuthentication ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +00001019.Cm RSAAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001020.Cm StreamLocalBindMask ,
1021.Cm StreamLocalBindUnlink ,
1022.Cm TrustedUserCAKeys ,
Damien Millerd1de9952006-07-24 14:05:48 +10001023.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +11001024.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +10001025and
Damien Miller0296ae82009-02-23 11:00:24 +11001026.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +10001027.It Cm MaxAuthTries
1028Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +10001029connection.
1030Once the number of failures reaches half this value,
1031additional failures are logged.
1032The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +10001033.It Cm MaxSessions
1034Specifies the maximum number of open sessions permitted per network connection.
1035The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001036.It Cm MaxStartups
1037Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001038SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001039Additional connections will be dropped until authentication succeeds or the
1040.Cm LoginGraceTime
1041expires for a connection.
Damien Miller1f583df2013-02-12 11:02:08 +11001042The default is 10:30:100.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001043.Pp
1044Alternatively, random early drop can be enabled by specifying
1045the three colon separated values
1046.Dq start:rate:full
Damien Miller208f1ed2006-03-15 11:56:03 +11001047(e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +11001048.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001049will refuse connection attempts with a probability of
1050.Dq rate/100
1051(30%)
1052if there are currently
1053.Dq start
1054(10)
1055unauthenticated connections.
1056The probability increases linearly and all connection attempts
1057are refused if the number of unauthenticated connections reaches
1058.Dq full
1059(60).
1060.It Cm PasswordAuthentication
1061Specifies whether password authentication is allowed.
1062The default is
1063.Dq yes .
1064.It Cm PermitEmptyPasswords
1065When password authentication is allowed, it specifies whether the
1066server allows login to accounts with empty password strings.
1067The default is
1068.Dq no .
Damien Miller9b439df2006-07-24 14:04:00 +10001069.It Cm PermitOpen
1070Specifies the destinations to which TCP port forwarding is permitted.
1071The forwarding specification must be one of the following forms:
1072.Pp
1073.Bl -item -offset indent -compact
1074.It
1075.Cm PermitOpen
1076.Sm off
1077.Ar host : port
1078.Sm on
1079.It
1080.Cm PermitOpen
1081.Sm off
1082.Ar IPv4_addr : port
1083.Sm on
1084.It
1085.Cm PermitOpen
1086.Sm off
1087.Ar \&[ IPv6_addr \&] : port
1088.Sm on
1089.El
1090.Pp
Damien Millera765cf42006-07-24 14:08:13 +10001091Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +10001092An argument of
1093.Dq any
1094can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +10001095An argument of
1096.Dq none
1097can be used to prohibit all forwarding requests.
Damien Miller65bc2c42006-07-24 14:04:16 +10001098By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001099.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +11001100Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +00001101.Xr ssh 1 .
1102The argument must be
1103.Dq yes ,
1104.Dq without-password ,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001105.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001106or
1107.Dq no .
1108The default is
djm@openbsd.org88a7c592015-04-27 21:42:48 +00001109.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001110.Pp
1111If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001112.Dq without-password ,
Darren Tucker9dca0992005-02-01 19:16:45 +11001113password authentication is disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001114.Pp
1115If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001116.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001117root login with public key authentication will be allowed,
1118but only if the
1119.Ar command
1120option has been specified
1121(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +10001122normally not allowed).
1123All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001124.Pp
1125If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001126.Dq no ,
Darren Tuckerb3509012005-01-20 11:01:46 +11001127root is not allowed to log in.
Damien Millerd27b9472005-12-13 19:29:02 +11001128.It Cm PermitTunnel
1129Specifies whether
1130.Xr tun 4
1131device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +11001132The argument must be
1133.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +10001134.Dq point-to-point
1135(layer 3),
1136.Dq ethernet
1137(layer 2), or
Damien Miller7b58e802005-12-13 19:33:19 +11001138.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +10001139Specifying
1140.Dq yes
1141permits both
1142.Dq point-to-point
1143and
1144.Dq ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +11001145The default is
1146.Dq no .
djm@openbsd.org48dffd52014-09-09 09:45:36 +00001147.Pp
1148Independent of this setting, the permissions of the selected
1149.Xr tun 4
1150device must allow access to the user.
Damien Miller5ff30c62013-10-30 22:21:50 +11001151.It Cm PermitTTY
1152Specifies whether
Damien Miller63857c92013-10-30 22:31:06 +11001153.Xr pty 4
Damien Miller5ff30c62013-10-30 22:21:50 +11001154allocation is permitted.
1155The default is
1156.Dq yes .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001157.It Cm PermitUserEnvironment
1158Specifies whether
1159.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001160and
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001161.Cm environment=
1162options in
1163.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001164are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +11001165.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001166The default is
1167.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001168Enabling environment processing may enable users to bypass access
1169restrictions in some configurations using mechanisms such as
1170.Ev LD_PRELOAD .
Damien Miller72e6b5c2014-07-04 09:00:04 +10001171.It Cm PermitUserRC
1172Specifies whether any
1173.Pa ~/.ssh/rc
1174file is executed.
1175The default is
1176.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001177.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +00001178Specifies the file that contains the process ID of the
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001179SSH daemon, or
1180.Dq none
1181to not write one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001182The default is
1183.Pa /var/run/sshd.pid .
1184.It Cm Port
1185Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +11001186.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001187listens on.
1188The default is 22.
1189Multiple options of this type are permitted.
1190See also
1191.Cm ListenAddress .
1192.It Cm PrintLastLog
1193Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001194.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +11001195should print the date and time of the last user login when a user logs
1196in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001197The default is
1198.Dq yes .
1199.It Cm PrintMotd
1200Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001201.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001202should print
1203.Pa /etc/motd
1204when a user logs in interactively.
1205(On some systems it is also printed by the shell,
1206.Pa /etc/profile ,
1207or equivalent.)
1208The default is
1209.Dq yes .
1210.It Cm Protocol
1211Specifies the protocol versions
Damien Miller5b0d63f2006-03-15 11:56:56 +11001212.Xr sshd 8
Ben Lindstrom9c445542002-07-11 03:59:18 +00001213supports.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001214The possible values are
Damien Miller5b0d63f2006-03-15 11:56:56 +11001215.Sq 1
Ben Lindstrom9f049032002-06-21 00:59:05 +00001216and
Damien Miller5b0d63f2006-03-15 11:56:56 +11001217.Sq 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001218Multiple versions must be comma-separated.
1219The default is
Darren Tucker7a4a7652009-10-11 21:51:40 +11001220.Sq 2 .
Ben Lindstrom9c445542002-07-11 03:59:18 +00001221Note that the order of the protocol list does not indicate preference,
1222because the client selects among multiple protocol versions offered
1223by the server.
1224Specifying
1225.Dq 2,1
1226is identical to
1227.Dq 1,2 .
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001228.It Cm PubkeyAcceptedKeyTypes
1229Specifies the key types that will be accepted for public key authentication
1230as a comma-separated pattern list.
1231The default
1232.Dq *
1233will allow all key types.
1234The
1235.Fl Q
1236option of
1237.Xr ssh 1
1238may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001239.It Cm PubkeyAuthentication
1240Specifies whether public key authentication is allowed.
1241The default is
1242.Dq yes .
1243Note that this option applies to protocol version 2 only.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001244.It Cm RekeyLimit
1245Specifies the maximum amount of data that may be transmitted before the
1246session key is renegotiated, optionally followed a maximum amount of
1247time that may pass before the session key is renegotiated.
1248The first argument is specified in bytes and may have a suffix of
1249.Sq K ,
1250.Sq M ,
1251or
1252.Sq G
1253to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1254The default is between
1255.Sq 1G
1256and
1257.Sq 4G ,
1258depending on the cipher.
1259The optional second value is specified in seconds and may use any of the
1260units documented in the
1261.Sx TIME FORMATS
Darren Tucker64d22942013-05-16 20:31:29 +10001262section.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001263The default value for
1264.Cm RekeyLimit
1265is
1266.Dq default none ,
1267which means that rekeying is performed after the cipher's default amount
1268of data has been sent or received and no time based rekeying is done.
1269This option applies to protocol version 2 only.
Damien Miller1aed65e2010-03-04 21:53:35 +11001270.It Cm RevokedKeys
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001271Specifies revoked public keys file, or
1272.Dq none
1273to not use one.
Damien Miller1aed65e2010-03-04 21:53:35 +11001274Keys listed in this file will be refused for public key authentication.
1275Note that if this file is not readable, then public key authentication will
1276be refused for all users.
Damien Millerf3747bf2013-01-18 11:44:04 +11001277Keys may be specified as a text file, listing one public key per line, or as
1278an OpenSSH Key Revocation List (KRL) as generated by
Damien Miller72abeb72013-01-20 22:33:44 +11001279.Xr ssh-keygen 1 .
Damien Millerfecfd112013-07-18 16:11:50 +10001280For more information on KRLs, see the KEY REVOCATION LISTS section in
Damien Millerf3747bf2013-01-18 11:44:04 +11001281.Xr ssh-keygen 1 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001282.It Cm RhostsRSAAuthentication
1283Specifies whether rhosts or /etc/hosts.equiv authentication together
1284with successful RSA host authentication is allowed.
1285The default is
1286.Dq no .
1287This option applies to protocol version 1 only.
1288.It Cm RSAAuthentication
1289Specifies whether pure RSA authentication is allowed.
1290The default is
1291.Dq yes .
1292This option applies to protocol version 1 only.
1293.It Cm ServerKeyBits
1294Defines the number of bits in the ephemeral protocol version 1 server key.
Darren Tucker7499b0c2008-07-02 22:35:43 +10001295The minimum value is 512, and the default is 1024.
Damien Miller7acefbb2014-07-18 14:11:24 +10001296.It Cm StreamLocalBindMask
1297Sets the octal file creation mode mask
1298.Pq umask
1299used when creating a Unix-domain socket file for local or remote
1300port forwarding.
1301This option is only used for port forwarding to a Unix-domain socket file.
1302.Pp
1303The default value is 0177, which creates a Unix-domain socket file that is
1304readable and writable only by the owner.
1305Note that not all operating systems honor the file mode on Unix-domain
1306socket files.
1307.It Cm StreamLocalBindUnlink
1308Specifies whether to remove an existing Unix-domain socket file for local
1309or remote port forwarding before creating a new one.
1310If the socket file already exists and
1311.Cm StreamLocalBindUnlink
1312is not enabled,
1313.Nm sshd
1314will be unable to forward the port to the Unix-domain socket file.
1315This option is only used for port forwarding to a Unix-domain socket file.
1316.Pp
1317The argument must be
1318.Dq yes
1319or
1320.Dq no .
1321The default is
1322.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001323.It Cm StrictModes
1324Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001325.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001326should check file modes and ownership of the
1327user's files and home directory before accepting login.
1328This is normally desirable because novices sometimes accidentally leave their
1329directory or files world-writable.
1330The default is
1331.Dq yes .
Darren Tuckerf788a912010-01-08 17:06:47 +11001332Note that this does not apply to
1333.Cm ChrootDirectory ,
1334whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001335.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +11001336Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +10001337Arguments should be a subsystem name and a command (with optional arguments)
1338to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001339.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001340The command
1341.Xr sftp-server 8
1342implements the
1343.Dq sftp
1344file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001345.Pp
1346Alternately the name
1347.Dq internal-sftp
1348implements an in-process
1349.Dq sftp
1350server.
1351This may simplify configurations using
1352.Cm ChrootDirectory
1353to force a different filesystem root on clients.
1354.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001355By default no subsystems are defined.
1356Note that this option applies to protocol version 2 only.
1357.It Cm SyslogFacility
1358Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001359.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001360The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1361LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1362The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001363.It Cm TCPKeepAlive
1364Specifies whether the system should send TCP keepalive messages to the
1365other side.
1366If they are sent, death of the connection or crash of one
1367of the machines will be properly noticed.
1368However, this means that
1369connections will die if the route is down temporarily, and some people
1370find it annoying.
1371On the other hand, if TCP keepalives are not sent,
1372sessions may hang indefinitely on the server, leaving
1373.Dq ghost
1374users and consuming server resources.
1375.Pp
1376The default is
1377.Dq yes
1378(to send TCP keepalive messages), and the server will notice
1379if the network goes down or the client host crashes.
1380This avoids infinitely hanging sessions.
1381.Pp
1382To disable TCP keepalive messages, the value should be set to
1383.Dq no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001384.It Cm TrustedUserCAKeys
1385Specifies a file containing public keys of certificate authorities that are
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001386trusted to sign user certificates for authentication, or
1387.Dq none
1388to not use one.
Damien Miller72b33822010-03-05 07:39:01 +11001389Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001390.Ql #
1391are allowed.
1392If a certificate is presented for authentication and has its signing CA key
1393listed in this file, then it may be used for authentication for any user
1394listed in the certificate's principals list.
1395Note that certificates that lack a list of principals will not be permitted
1396for authentication using
1397.Cm TrustedUserCAKeys .
Damien Millerfecfd112013-07-18 16:11:50 +10001398For more details on certificates, see the CERTIFICATES section in
Damien Miller1aed65e2010-03-04 21:53:35 +11001399.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001400.It Cm UseDNS
1401Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001402.Xr sshd 8
Darren Tucker83d5a982005-03-31 21:33:50 +10001403should look up the remote host name and check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001404the resolved host name for the remote IP address maps back to the
1405very same IP address.
1406The default is
deraadt@openbsd.org3cd51032015-02-02 01:57:44 +00001407.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001408.It Cm UseLogin
1409Specifies whether
1410.Xr login 1
1411is used for interactive login sessions.
1412The default is
1413.Dq no .
1414Note that
1415.Xr login 1
1416is never used for remote command execution.
1417Note also, that if this is enabled,
1418.Cm X11Forwarding
1419will be disabled because
1420.Xr login 1
1421does not know how to handle
1422.Xr xauth 1
Damien Miller495dca32003-04-01 21:42:14 +10001423cookies.
1424If
Ben Lindstrom9f049032002-06-21 00:59:05 +00001425.Cm UsePrivilegeSeparation
1426is specified, it will be disabled after authentication.
Damien Miller2e193e22003-05-14 15:13:03 +10001427.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001428Enables the Pluggable Authentication Module interface.
1429If set to
1430.Dq yes
1431this will enable PAM authentication using
1432.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001433and
1434.Cm PasswordAuthentication
1435in addition to PAM account and session module processing for all
1436authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001437.Pp
1438Because PAM challenge-response authentication usually serves an equivalent
1439role to password authentication, you should disable either
1440.Cm PasswordAuthentication
1441or
1442.Cm ChallengeResponseAuthentication.
1443.Pp
1444If
1445.Cm UsePAM
1446is enabled, you will not be able to run
1447.Xr sshd 8
1448as a non-root user.
1449The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +10001450.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001451.It Cm UsePrivilegeSeparation
1452Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001453.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001454separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +10001455to deal with incoming network traffic.
1456After successful authentication, another process will be created that has
1457the privilege of the authenticated user.
1458The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +00001459escalation by containing any corruption within the unprivileged processes.
1460The default is
1461.Dq yes .
Damien Miller69ff1df2011-06-23 08:30:03 +10001462If
1463.Cm UsePrivilegeSeparation
1464is set to
1465.Dq sandbox
1466then the pre-authentication unprivileged process is subject to additional
1467restrictions.
Damien Miller23528812012-04-22 11:24:43 +10001468.It Cm VersionAddendum
1469Optionally specifies additional text to append to the SSH protocol banner
1470sent by the server upon connection.
1471The default is
1472.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001473.It Cm X11DisplayOffset
1474Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001475.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001476X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001477This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001478The default is 10.
1479.It Cm X11Forwarding
1480Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001481The argument must be
1482.Dq yes
1483or
1484.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001485The default is
1486.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +10001487.Pp
1488When X11 forwarding is enabled, there may be additional exposure to
1489the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001490.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001491proxy display is configured to listen on the wildcard address (see
1492.Cm X11UseLocalhost
Damien Miller5b0d63f2006-03-15 11:56:56 +11001493below), though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001494Additionally, the authentication spoofing and authentication data
1495verification and substitution occur on the client side.
1496The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001497display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001498forwarding (see the warnings for
1499.Cm ForwardX11
1500in
Damien Millerf1ce5052003-06-11 22:04:39 +10001501.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001502A system administrator may have a stance in which they want to
1503protect clients that may expose themselves to attack by unwittingly
1504requesting X11 forwarding, which can warrant a
1505.Dq no
1506setting.
1507.Pp
1508Note that disabling X11 forwarding does not prevent users from
1509forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001510X11 forwarding is automatically disabled if
1511.Cm UseLogin
1512is enabled.
1513.It Cm X11UseLocalhost
1514Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001515.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001516should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001517the wildcard address.
1518By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001519sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001520hostname part of the
1521.Ev DISPLAY
1522environment variable to
1523.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001524This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001525However, some older X11 clients may not function with this
1526configuration.
1527.Cm X11UseLocalhost
1528may be set to
1529.Dq no
1530to specify that the forwarding server should be bound to the wildcard
1531address.
1532The argument must be
1533.Dq yes
1534or
1535.Dq no .
1536The default is
1537.Dq yes .
1538.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001539Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001540.Xr xauth 1
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001541program, or
1542.Dq none
1543to not use one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001544The default is
1545.Pa /usr/X11R6/bin/xauth .
1546.El
Damien Millere3beba22006-03-15 11:59:25 +11001547.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001548.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001549command-line arguments and configuration file options that specify time
1550may be expressed using a sequence of the form:
1551.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001552.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001553.Sm on
1554where
1555.Ar time
1556is a positive integer value and
1557.Ar qualifier
1558is one of the following:
1559.Pp
1560.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001561.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001562seconds
1563.It Cm s | Cm S
1564seconds
1565.It Cm m | Cm M
1566minutes
1567.It Cm h | Cm H
1568hours
1569.It Cm d | Cm D
1570days
1571.It Cm w | Cm W
1572weeks
1573.El
1574.Pp
1575Each member of the sequence is added together to calculate
1576the total time value.
1577.Pp
1578Time format examples:
1579.Pp
1580.Bl -tag -width Ds -compact -offset indent
1581.It 600
1582600 seconds (10 minutes)
1583.It 10m
158410 minutes
1585.It 1h30m
15861 hour 30 minutes (90 minutes)
1587.El
1588.Sh FILES
1589.Bl -tag -width Ds
1590.It Pa /etc/ssh/sshd_config
1591Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001592.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001593This file should be writable by root only, but it is recommended
1594(though not necessary) that it be world-readable.
1595.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001596.Sh SEE ALSO
1597.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001598.Sh AUTHORS
1599OpenSSH is a derivative of the original and free
1600ssh 1.2.12 release by Tatu Ylonen.
1601Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1602Theo de Raadt and Dug Song
1603removed many bugs, re-added newer features and
1604created OpenSSH.
1605Markus Friedl contributed the support for SSH
1606protocol versions 1.5 and 2.0.
1607Niels Provos and Markus Friedl contributed support
1608for privilege separation.