blob: b5d361e1d1e700cfb4cbf757ee9583a15e93ece1 [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.org4577ade2016-09-28 20:32:42 +000036.\" $OpenBSD: sshd_config.5,v 1.236 2016/09/28 20:32:42 djm Exp $
37.Dd $Mdocdate: September 28 2016 $
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.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +000073The
dtucker@openbsd.org85b96ef2015-04-28 10:17:58 +000074.Ev TERM
jmc@openbsd.orgc1d5bcf2015-04-28 13:47:38 +000075environment variable is always sent whenever the client
djm@openbsd.org732d61f2015-06-05 03:44:14 +000076requests a pseudo-terminal as it is required by the protocol.
Darren Tucker46bc0752004-05-02 22:11:30 +100077Variables are specified by name, which may contain the wildcard characters
Damien Miller208f1ed2006-03-15 11:56:03 +110078.Ql *
Darren Tucker46bc0752004-05-02 22:11:30 +100079and
80.Ql \&? .
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100081Multiple environment variables may be separated by whitespace or spread
Darren Tucker46bc0752004-05-02 22:11:30 +100082across multiple
83.Cm AcceptEnv
84directives.
Darren Tucker1e0c9bf2004-05-02 22:12:48 +100085Be warned that some environment variables could be used to bypass restricted
Darren Tucker46bc0752004-05-02 22:11:30 +100086user environments.
87For this reason, care should be taken in the use of this directive.
88The default is not to accept any environment variables.
Darren Tucker0f383232005-01-20 10:57:56 +110089.It Cm AddressFamily
90Specifies which address family should be used by
Damien Millerf4f22b52006-03-15 11:57:25 +110091.Xr sshd 8 .
Darren Tucker0f383232005-01-20 10:57:56 +110092Valid arguments are
93.Dq any ,
94.Dq inet
Damien Miller5b0d63f2006-03-15 11:56:56 +110095(use IPv4 only), or
Darren Tucker0f383232005-01-20 10:57:56 +110096.Dq inet6
97(use IPv6 only).
98The default is
99.Dq any .
Damien Millere9890192008-05-19 14:59:02 +1000100.It Cm AllowAgentForwarding
101Specifies whether
102.Xr ssh-agent 1
103forwarding is permitted.
104The default is
105.Dq yes .
106Note that disabling agent forwarding does not improve security
107unless users are also denied shell access, as they can always install
108their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000109.It Cm AllowGroups
110This keyword can be followed by a list of group name patterns, separated
111by spaces.
112If specified, login is allowed only for users whose primary
113group or supplementary group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000114Only group names are valid; a numerical group ID is not recognized.
115By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100116The allow/deny directives are processed in the following order:
117.Cm DenyUsers ,
118.Cm AllowUsers ,
119.Cm DenyGroups ,
120and finally
121.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100122.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000123See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100124.Xr ssh_config 5
125for more information on patterns.
Damien Miller7acefbb2014-07-18 14:11:24 +1000126.It Cm AllowStreamLocalForwarding
127Specifies whether StreamLocal (Unix-domain socket) forwarding is permitted.
128The available options are
129.Dq yes
130or
131.Dq all
132to allow StreamLocal forwarding,
133.Dq no
134to prevent all StreamLocal forwarding,
135.Dq local
136to allow local (from the perspective of
137.Xr ssh 1 )
138forwarding only or
139.Dq remote
140to allow remote forwarding only.
141The default is
142.Dq yes .
143Note that disabling StreamLocal forwarding does not improve security unless
144users are also denied shell access, as they can always install their
145own forwarders.
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +0000146.It Cm AllowTcpForwarding
147Specifies whether TCP forwarding is permitted.
148The available options are
149.Dq yes
150or
151.Dq all
152to allow TCP forwarding,
153.Dq no
154to prevent all TCP forwarding,
155.Dq local
156to allow local (from the perspective of
157.Xr ssh 1 )
158forwarding only or
159.Dq remote
160to allow remote forwarding only.
161The default is
162.Dq yes .
163Note that disabling TCP forwarding does not improve security unless
164users are also denied shell access, as they can always install their
165own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000166.It Cm AllowUsers
167This keyword can be followed by a list of user name patterns, separated
168by spaces.
Damien Miller5a93add2003-01-24 11:34:52 +1100169If specified, login is allowed only for user names that
Ben Lindstrom9f049032002-06-21 00:59:05 +0000170match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000171Only user names are valid; a numerical user ID is not recognized.
172By default, login is allowed for all users.
173If the pattern takes the form USER@HOST then USER and HOST
174are separately checked, restricting logins to particular
175users from particular hosts.
jmc@openbsd.orgee1e0a12016-04-27 13:53:48 +0000176HOST criteria may additionally contain addresses to match in CIDR
177address/masklen format.
Damien Millerac73e512006-03-15 11:58:49 +1100178The allow/deny directives are processed in the following order:
179.Cm DenyUsers ,
180.Cm AllowUsers ,
181.Cm DenyGroups ,
182and finally
183.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100184.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000185See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100186.Xr ssh_config 5
187for more information on patterns.
Damien Millera6e3f012012-11-04 23:21:40 +1100188.It Cm AuthenticationMethods
189Specifies the authentication methods that must be successfully completed
190for a user to be granted access.
191This option must be followed by one or more comma-separated lists of
djm@openbsd.orgb64faeb2016-06-17 05:03:40 +0000192authentication method names, or by the single string
193.Dq any
194to indicate the default behaviour of accepting any single authentication
jmc@openbsd.orgad23a752016-06-17 06:33:30 +0000195method.
djm@openbsd.orgb64faeb2016-06-17 05:03:40 +0000196if the default is overridden, then successful authentication requires
197completion of every method in at least one of these lists.
Damien Millera6e3f012012-11-04 23:21:40 +1100198.Pp
199For example, an argument of
200.Dq publickey,password publickey,keyboard-interactive
201would require the user to complete public key authentication, followed by
202either password or keyboard interactive authentication.
203Only methods that are next in one or more lists are offered at each stage,
204so for this example, it would not be possible to attempt password or
205keyboard-interactive authentication before public key.
206.Pp
Damien Miller91a55f22013-04-23 15:18:10 +1000207For keyboard interactive authentication it is also possible to
208restrict authentication to a specific device by appending a
209colon followed by the device identifier
210.Dq bsdauth ,
211.Dq pam ,
212or
213.Dq skey ,
214depending on the server configuration.
215For example,
216.Dq keyboard-interactive:bsdauth
217would restrict keyboard interactive authentication to the
218.Dq bsdauth
219device.
220.Pp
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000221If the
222.Dq publickey
jmc@openbsd.org449e11b2014-12-22 08:24:17 +0000223method is listed more than once,
djm@openbsd.orgf69b69b2014-12-22 07:51:30 +0000224.Xr sshd 8
225verifies that keys that have been used successfully are not reused for
226subsequent authentications.
227For example, an
228.Cm AuthenticationMethods
229of
230.Dq publickey,publickey
231will require successful authentication using two different public keys.
232.Pp
Damien Millera6e3f012012-11-04 23:21:40 +1100233Note that each authentication method listed should also be explicitly enabled
234in the configuration.
djm@openbsd.orgb64faeb2016-06-17 05:03:40 +0000235The default
236.Dq any
237is not to require multiple authentication; successful completion
Damien Millera6e3f012012-11-04 23:21:40 +1100238of a single authentication method is sufficient.
Damien Miller09d3e122012-10-31 08:58:58 +1100239.It Cm AuthorizedKeysCommand
Damien Millerf33580e2012-11-04 22:22:52 +1100240Specifies a program to be used to look up the user's public keys.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000241The program must be owned by root, not writable by group or others and
242specified by an absolute path.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000243Arguments to
244.Cm AuthorizedKeysCommand
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000245accept the tokens described in the
246.Sx TOKENS
247section.
248If no arguments are specified then the username of the target user is used.
djm@openbsd.org24232a32015-05-21 06:38:35 +0000249.Pp
250The program should produce on standard output zero or
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000251more lines of authorized_keys output (see
252.Sx AUTHORIZED_KEYS
253in
Damien Millerf33580e2012-11-04 22:22:52 +1100254.Xr sshd 8 ) .
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000255If a key supplied by
256.Cm AuthorizedKeysCommand
257does not successfully authenticate
Damien Miller09d3e122012-10-31 08:58:58 +1100258and authorize the user then public key authentication continues using the usual
259.Cm AuthorizedKeysFile
260files.
261By default, no AuthorizedKeysCommand is run.
262.It Cm AuthorizedKeysCommandUser
263Specifies the user under whose account the AuthorizedKeysCommand is run.
Damien Miller09d3e122012-10-31 08:58:58 +1100264It is recommended to use a dedicated user that has no other role on the host
265than running authorized keys commands.
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000266If
djm@openbsd.orgd663bea2014-12-11 05:25:06 +0000267.Cm AuthorizedKeysCommand
djm@openbsd.orgf1c4d8e2014-12-22 08:04:23 +0000268is specified but
269.Cm AuthorizedKeysCommandUser
270is not, then
271.Xr sshd 8
272will refuse to start.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000273.It Cm AuthorizedKeysFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000274Specifies the file that contains the public keys used for user authentication.
Damien Miller6018a362010-07-02 13:35:19 +1000275The format is described in the
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000276.Sx AUTHORIZED_KEYS FILE FORMAT
Damien Miller6018a362010-07-02 13:35:19 +1000277section of
278.Xr sshd 8 .
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000279Arguments to
Ben Lindstrom9f049032002-06-21 00:59:05 +0000280.Cm AuthorizedKeysFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000281accept the tokens described in the
282.Sx TOKENS
283section.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000284After expansion,
285.Cm AuthorizedKeysFile
286is taken to be an absolute path or one relative to the user's home
287directory.
Damien Millerb9132fc2011-05-29 21:41:40 +1000288Multiple files may be listed, separated by whitespace.
djm@openbsd.org2bca8a42015-09-11 03:13:36 +0000289Alternately this option may be set to
290.Dq none
291to skip checking for user keys in files.
Damien Millerb9132fc2011-05-29 21:41:40 +1000292The default is
293.Dq .ssh/authorized_keys .ssh/authorized_keys2 .
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000294.It Cm AuthorizedPrincipalsCommand
295Specifies a program to be used to generate the list of allowed
296certificate principals as per
297.Cm AuthorizedPrincipalsFile .
298The program must be owned by root, not writable by group or others and
299specified by an absolute path.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000300Arguments to
301.Cm AuthorizedPrincipalsCommand
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000302accept the tokens described in the
303.Sx TOKENS
304section.
305If no arguments are specified then the username of the target user is used.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000306.Pp
307The program should produce on standard output zero or
308more lines of
309.Cm AuthorizedPrincipalsFile
310output.
311If either
312.Cm AuthorizedPrincipalsCommand
313or
314.Cm AuthorizedPrincipalsFile
315is specified, then certificates offered by the client for authentication
316must contain a principal that is listed.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000317By default, no
318.Cm AuthorizedPrincipalsCommand
319is run.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000320.It Cm AuthorizedPrincipalsCommandUser
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000321Specifies the user under whose account the
322.Cm AuthorizedPrincipalsCommand
323is run.
djm@openbsd.orgbcc50d82015-05-21 06:43:30 +0000324It is recommended to use a dedicated user that has no other role on the host
325than running authorized principals commands.
326If
327.Cm AuthorizedPrincipalsCommand
328is specified but
329.Cm AuthorizedPrincipalsCommandUser
330is not, then
331.Xr sshd 8
332will refuse to start.
Damien Miller30da3442010-05-10 11:58:03 +1000333.It Cm AuthorizedPrincipalsFile
334Specifies a file that lists principal names that are accepted for
335certificate authentication.
336When using certificates signed by a key listed in
337.Cm TrustedUserCAKeys ,
338this file lists names, one of which must appear in the certificate for it
339to be accepted for authentication.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000340Names are listed one per line preceded by key options (as described in
341.Sx AUTHORIZED_KEYS FILE FORMAT
342in
Damien Millerd59dab82010-07-02 13:37:17 +1000343.Xr sshd 8 ) .
Damien Miller6018a362010-07-02 13:35:19 +1000344Empty lines and comments starting with
Damien Miller30da3442010-05-10 11:58:03 +1000345.Ql #
346are ignored.
347.Pp
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000348Arguments to
Damien Miller30da3442010-05-10 11:58:03 +1000349.Cm AuthorizedPrincipalsFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000350accept the tokens described in the
351.Sx TOKENS
352section.
Damien Miller30da3442010-05-10 11:58:03 +1000353After expansion,
354.Cm AuthorizedPrincipalsFile
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000355is taken to be an absolute path or one relative to the user's home directory.
Damien Miller8fef9eb2012-04-22 11:25:10 +1000356The default is
357.Dq none ,
358i.e. not to use a principals file \(en in this case, the username
Damien Miller30da3442010-05-10 11:58:03 +1000359of the user must appear in a certificate's principals list for it to be
360accepted.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000361.Pp
Damien Miller30da3442010-05-10 11:58:03 +1000362Note that
363.Cm AuthorizedPrincipalsFile
364is only used when authentication proceeds using a CA listed in
365.Cm TrustedUserCAKeys
366and is not consulted for certification authorities trusted via
367.Pa ~/.ssh/authorized_keys ,
368though the
369.Cm principals=
370key option offers a similar facility (see
371.Xr sshd 8
372for details).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000373.It Cm Banner
Ben Lindstrom9f049032002-06-21 00:59:05 +0000374The contents of the specified file are sent to the remote user before
375authentication is allowed.
Damien Miller4890e532007-09-17 11:57:38 +1000376If the argument is
377.Dq none
378then no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000379By default, no banner is displayed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000380.It Cm ChallengeResponseAuthentication
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000381Specifies whether challenge-response authentication is allowed (e.g. via
Damien Millere8c9f262014-10-03 09:24:56 +1000382PAM or through authentication styles supported in
Damien Miller9c7bf8d2009-08-28 10:27:08 +1000383.Xr login.conf 5 )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000384The default is
385.Dq yes .
Damien Millerd8cb1f12008-02-10 22:40:12 +1100386.It Cm ChrootDirectory
Darren Tuckerb8c884a2010-01-08 18:53:43 +1100387Specifies the pathname of a directory to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100388.Xr chroot 2
389to after authentication.
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000390At session startup
391.Xr sshd 8
392checks that all components of the pathname are root-owned directories
393which are not writable by any other user or group.
Darren Tucker51dbe502009-06-21 17:56:51 +1000394After the chroot,
395.Xr sshd 8
396changes the working directory to the user's home directory.
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +0000397Arguments to
398.Cm ChrootDirectory
399accept the tokens described in the
400.Sx TOKENS
401section.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100402.Pp
403The
404.Cm ChrootDirectory
405must contain the necessary files and directories to support the
Darren Tuckeraf501cf2009-06-21 17:53:04 +1000406user's session.
Damien Millerd8cb1f12008-02-10 22:40:12 +1100407For an interactive session this requires at least a shell, typically
408.Xr sh 1 ,
409and basic
410.Pa /dev
411nodes such as
412.Xr null 4 ,
413.Xr zero 4 ,
414.Xr stdin 4 ,
415.Xr stdout 4 ,
416.Xr stderr 4 ,
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000417and
Damien Millerd8cb1f12008-02-10 22:40:12 +1100418.Xr tty 4
419devices.
420For file transfer sessions using
Darren Tuckerf92077f2009-06-21 17:56:25 +1000421.Dq sftp ,
Damien Millerd8cb1f12008-02-10 22:40:12 +1100422no additional configuration of the environment is necessary if the
Darren Tuckerf92077f2009-06-21 17:56:25 +1000423in-process sftp server is used,
Damien Miller426117b2014-07-30 12:33:20 +1000424though sessions which use logging may require
Darren Tucker00fcd712009-06-21 17:56:00 +1000425.Pa /dev/log
Damien Miller426117b2014-07-30 12:33:20 +1000426inside the chroot directory on some operating systems (see
Darren Tucker00fcd712009-06-21 17:56:00 +1000427.Xr sftp-server 8
428for details).
Damien Millerd8cb1f12008-02-10 22:40:12 +1100429.Pp
jmc@openbsd.orga5a3e332015-01-22 21:00:42 +0000430For safety, it is very important that the directory hierarchy be
deraadt@openbsd.orgdcff5812015-01-22 20:24:41 +0000431prevented from modification by other processes on the system (especially
432those outside the jail).
433Misconfiguration can lead to unsafe environments which
434.Xr sshd 8
435cannot detect.
436.Pp
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000437The default is
438.Dq none ,
439indicating not to
Damien Millerd8cb1f12008-02-10 22:40:12 +1100440.Xr chroot 2 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000441.It Cm Ciphers
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000442Specifies the ciphers allowed.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000443Multiple ciphers must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000444If the specified value begins with a
445.Sq +
446character, then the specified ciphers will be appended to the default set
447instead of replacing them.
448.Pp
Damien Miller0fde8ac2013-11-21 14:12:23 +1100449The supported ciphers are:
450.Pp
Damien Millerc1621c82014-04-20 13:22:46 +1000451.Bl -item -compact -offset indent
452.It
4533des-cbc
454.It
455aes128-cbc
456.It
457aes192-cbc
458.It
459aes256-cbc
460.It
461aes128-ctr
462.It
463aes192-ctr
464.It
465aes256-ctr
466.It
467aes128-gcm@openssh.com
468.It
469aes256-gcm@openssh.com
470.It
471arcfour
472.It
473arcfour128
474.It
475arcfour256
476.It
477blowfish-cbc
478.It
479cast128-cbc
480.It
481chacha20-poly1305@openssh.com
482.El
Damien Miller0fde8ac2013-11-21 14:12:23 +1100483.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +1100484The default is:
Damien Millerc1621c82014-04-20 13:22:46 +1000485.Bd -literal -offset indent
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000486chacha20-poly1305@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +1000487aes128-ctr,aes192-ctr,aes256-ctr,
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +0000488aes128-gcm@openssh.com,aes256-gcm@openssh.com
Ben Lindstrom9f049032002-06-21 00:59:05 +0000489.Ed
Damien Miller0fde8ac2013-11-21 14:12:23 +1100490.Pp
491The list of available ciphers may also be obtained using the
492.Fl Q
493option of
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000494.Xr ssh 1
495with an argument of
496.Dq cipher .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000497.It Cm ClientAliveCountMax
Damien Millerb7977702006-01-03 18:47:31 +1100498Sets the number of client alive messages (see below) which may be
Ben Lindstrom9f049032002-06-21 00:59:05 +0000499sent without
Damien Miller5b0d63f2006-03-15 11:56:56 +1100500.Xr sshd 8
Damien Millerfbf486b2003-05-23 18:44:23 +1000501receiving any messages back from the client.
502If this threshold is reached while client alive messages are being sent,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100503sshd will disconnect the client, terminating the session.
Damien Millerfbf486b2003-05-23 18:44:23 +1000504It is important to note that the use of client alive messages is very
505different from
Damien Miller12c150e2003-12-17 16:31:10 +1100506.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000507(below).
508The client alive messages are sent through the encrypted channel
509and therefore will not be spoofable.
510The TCP keepalive option enabled by
Damien Miller12c150e2003-12-17 16:31:10 +1100511.Cm TCPKeepAlive
Damien Millerfbf486b2003-05-23 18:44:23 +1000512is spoofable.
513The client alive mechanism is valuable when the client or
Ben Lindstrom9f049032002-06-21 00:59:05 +0000514server depend on knowing when a connection has become inactive.
515.Pp
Damien Millerfbf486b2003-05-23 18:44:23 +1000516The default value is 3.
517If
Ben Lindstrom9f049032002-06-21 00:59:05 +0000518.Cm ClientAliveInterval
Damien Millerb7977702006-01-03 18:47:31 +1100519(see below) is set to 15, and
Ben Lindstrom9f049032002-06-21 00:59:05 +0000520.Cm ClientAliveCountMax
Damien Miller5b0d63f2006-03-15 11:56:56 +1100521is left at the default, unresponsive SSH clients
Ben Lindstrom9f049032002-06-21 00:59:05 +0000522will be disconnected after approximately 45 seconds.
Damien Miller1594ad52005-05-26 12:12:19 +1000523.It Cm ClientAliveInterval
524Sets a timeout interval in seconds after which if no data has been received
525from the client,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100526.Xr sshd 8
Damien Miller1594ad52005-05-26 12:12:19 +1000527will send a message through the encrypted
528channel to request a response from the client.
529The default
530is 0, indicating that these messages will not be sent to the client.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000531.It Cm Compression
djm@openbsd.org4577ade2016-09-28 20:32:42 +0000532Specifies whether compression is enabled after
Damien Miller9786e6e2005-07-26 21:54:56 +1000533the user has authenticated successfully.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000534The argument must be
Damien Miller9786e6e2005-07-26 21:54:56 +1000535.Dq yes ,
djm@openbsd.org4577ade2016-09-28 20:32:42 +0000536.Dq delayed
537(a legacy synonym for
538.Dq yes )
Ben Lindstrom9f049032002-06-21 00:59:05 +0000539or
540.Dq no .
541The default is
djm@openbsd.org4577ade2016-09-28 20:32:42 +0000542.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000543.It Cm DenyGroups
544This keyword can be followed by a list of group name patterns, separated
545by spaces.
546Login is disallowed for users whose primary group or supplementary
547group list matches one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000548Only group names are valid; a numerical group ID is not recognized.
549By default, login is allowed for all groups.
Damien Millerac73e512006-03-15 11:58:49 +1100550The allow/deny directives are processed in the following order:
551.Cm DenyUsers ,
552.Cm AllowUsers ,
553.Cm DenyGroups ,
554and finally
555.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100556.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000557See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100558.Xr ssh_config 5
559for more information on patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000560.It Cm DenyUsers
561This keyword can be followed by a list of user name patterns, separated
562by spaces.
563Login is disallowed for user names that match one of the patterns.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000564Only user names are valid; a numerical user ID is not recognized.
565By default, login is allowed for all users.
566If the pattern takes the form USER@HOST then USER and HOST
567are separately checked, restricting logins to particular
568users from particular hosts.
jmc@openbsd.orgee1e0a12016-04-27 13:53:48 +0000569HOST criteria may additionally contain addresses to match in CIDR
570address/masklen format.
Damien Millerac73e512006-03-15 11:58:49 +1100571The allow/deny directives are processed in the following order:
572.Cm DenyUsers ,
573.Cm AllowUsers ,
574.Cm DenyGroups ,
575and finally
576.Cm AllowGroups .
Damien Miller0c2079d2006-03-15 11:54:21 +1100577.Pp
Damien Millerfecfd112013-07-18 16:11:50 +1000578See PATTERNS in
Damien Miller0c2079d2006-03-15 11:54:21 +1100579.Xr ssh_config 5
580for more information on patterns.
djm@openbsd.org56d1c832014-12-21 22:27:55 +0000581.It Cm FingerprintHash
582Specifies the hash algorithm used when logging key fingerprints.
583Valid options are:
584.Dq md5
585and
586.Dq sha256 .
587The default is
588.Dq sha256 .
Damien Millere2754432006-07-24 14:06:47 +1000589.It Cm ForceCommand
590Forces the execution of the command specified by
591.Cm ForceCommand ,
Damien Millera1b48cc2008-03-27 11:02:02 +1100592ignoring any command supplied by the client and
593.Pa ~/.ssh/rc
594if present.
Damien Millere2754432006-07-24 14:06:47 +1000595The command is invoked by using the user's login shell with the -c option.
596This applies to shell, command, or subsystem execution.
597It is most useful inside a
598.Cm Match
599block.
600The command originally supplied by the client is available in the
601.Ev SSH_ORIGINAL_COMMAND
602environment variable.
Damien Millercdb6e652008-02-10 22:47:24 +1100603Specifying a command of
604.Dq internal-sftp
605will force the use of an in-process sftp server that requires no support
606files when used with
607.Cm ChrootDirectory .
djm@openbsd.org9fd04682015-11-13 04:38:06 +0000608The default is
609.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000610.It Cm GatewayPorts
611Specifies whether remote hosts are allowed to connect to ports
612forwarded for the client.
613By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +1100614.Xr sshd 8
Damien Miller495dca32003-04-01 21:42:14 +1000615binds remote port forwardings to the loopback address.
616This prevents other remote hosts from connecting to forwarded ports.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000617.Cm GatewayPorts
Damien Miller5b0d63f2006-03-15 11:56:56 +1100618can be used to specify that sshd
Damien Millerf91ee4c2005-03-01 21:24:33 +1100619should allow remote port forwardings to bind to non-loopback addresses, thus
620allowing other hosts to connect.
621The argument may be
622.Dq no
623to force remote port forwardings to be available to the local host only,
Ben Lindstrom9f049032002-06-21 00:59:05 +0000624.Dq yes
Damien Millerf91ee4c2005-03-01 21:24:33 +1100625to force remote port forwardings to bind to the wildcard address, or
626.Dq clientspecified
627to allow the client to select the address to which the forwarding is bound.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000628The default is
629.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000630.It Cm GSSAPIAuthentication
Damien Miller9b7b03b2003-09-02 22:57:05 +1000631Specifies whether user authentication based on GSSAPI is allowed.
Damien Millera8e06ce2003-11-21 23:48:55 +1100632The default is
Darren Tucker0efd1552003-08-26 11:49:55 +1000633.Dq no .
Darren Tucker0efd1552003-08-26 11:49:55 +1000634.It Cm GSSAPICleanupCredentials
635Specifies whether to automatically destroy the user's credentials cache
636on logout.
637The default is
638.Dq yes .
djm@openbsd.orgd7c31da2015-05-22 03:50:02 +0000639.It Cm GSSAPIStrictAcceptorCheck
640Determines whether to be strict about the identity of the GSSAPI acceptor
641a client authenticates against.
642If set to
643.Dq yes
644then the client must authenticate against the
645.Pa host
646service on the current hostname.
647If set to
648.Dq no
649then the client may authenticate against any service key stored in the
650machine's default store.
651This facility is provided to assist with operation on multi homed machines.
652The default is
653.Dq yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000654.It Cm HostbasedAcceptedKeyTypes
655Specifies the key types that will be accepted for hostbased authentication
656as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000657Alternately if the specified value begins with a
658.Sq +
659character, then the specified key types will be appended to the default set
660instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000661The default for this option is:
662.Bd -literal -offset 3n
663ecdsa-sha2-nistp256-cert-v01@openssh.com,
664ecdsa-sha2-nistp384-cert-v01@openssh.com,
665ecdsa-sha2-nistp521-cert-v01@openssh.com,
666ssh-ed25519-cert-v01@openssh.com,
667ssh-rsa-cert-v01@openssh.com,
668ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +0000669ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000670.Ed
671.Pp
djm@openbsd.org1f729f02015-01-13 07:39:19 +0000672The
673.Fl Q
674option of
675.Xr ssh 1
676may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000677.It Cm HostbasedAuthentication
678Specifies whether rhosts or /etc/hosts.equiv authentication together
679with successful public key client host authentication is allowed
Damien Miller1faa7132006-03-15 11:55:31 +1100680(host-based authentication).
Ben Lindstrom9f049032002-06-21 00:59:05 +0000681The default is
682.Dq no .
Damien Millerb594f382006-08-30 11:06:34 +1000683.It Cm HostbasedUsesNameFromPacketOnly
684Specifies whether or not the server will attempt to perform a reverse
685name lookup when matching the name in the
686.Pa ~/.shosts ,
687.Pa ~/.rhosts ,
688and
689.Pa /etc/hosts.equiv
690files during
691.Cm HostbasedAuthentication .
692A setting of
693.Dq yes
694means that
695.Xr sshd 8
696uses the name supplied by the client rather than
697attempting to resolve the name from the TCP connection itself.
698The default is
699.Dq no .
Damien Miller0a80ca12010-02-27 07:55:05 +1100700.It Cm HostCertificate
701Specifies a file containing a public host certificate.
702The certificate's public key must match a private host key already specified
703by
704.Cm HostKey .
705The default behaviour of
706.Xr sshd 8
707is not to load any certificates.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000708.It Cm HostKey
709Specifies a file containing a private host key
710used by SSH.
naddy@openbsd.orgffe65492016-08-15 12:32:04 +0000711The defaults are
Damien Millereb8b60e2010-08-31 22:41:14 +1000712.Pa /etc/ssh/ssh_host_dsa_key ,
Damien Miller8ba0ead2013-12-18 17:46:27 +1100713.Pa /etc/ssh/ssh_host_ecdsa_key ,
714.Pa /etc/ssh/ssh_host_ed25519_key
Ben Lindstrom9f049032002-06-21 00:59:05 +0000715and
naddy@openbsd.orgffe65492016-08-15 12:32:04 +0000716.Pa /etc/ssh/ssh_host_rsa_key .
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000717.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000718Note that
Damien Miller5b0d63f2006-03-15 11:56:56 +1100719.Xr sshd 8
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000720will refuse to use a file if it is group/world-accessible
721and that the
722.Cm HostKeyAlgorithms
723option restricts which of the keys are actually used by
724.Xr sshd 8 .
725.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +0000726It is possible to have multiple host key files.
Damien Miller85b45e02013-07-20 13:21:52 +1000727It is also possible to specify public host key files instead.
728In this case operations on the private key will be delegated
729to an
730.Xr ssh-agent 1 .
731.It Cm HostKeyAgent
732Identifies the UNIX-domain socket used to communicate
733with an agent that has access to the private host keys.
markus@openbsd.org1a75d142016-05-04 14:29:58 +0000734If the string
Damien Miller85b45e02013-07-20 13:21:52 +1000735.Dq SSH_AUTH_SOCK
736is specified, the location of the socket will be read from the
737.Ev SSH_AUTH_SOCK
738environment variable.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000739.It Cm HostKeyAlgorithms
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000740Specifies the host key algorithms
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000741that the server offers.
742The default for this option is:
743.Bd -literal -offset 3n
744ecdsa-sha2-nistp256-cert-v01@openssh.com,
745ecdsa-sha2-nistp384-cert-v01@openssh.com,
746ecdsa-sha2-nistp521-cert-v01@openssh.com,
747ssh-ed25519-cert-v01@openssh.com,
748ssh-rsa-cert-v01@openssh.com,
749ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +0000750ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +0000751.Ed
752.Pp
753The list of available key types may also be obtained using the
754.Fl Q
755option of
756.Xr ssh 1
757with an argument of
758.Dq key .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000759.It Cm IgnoreRhosts
760Specifies that
761.Pa .rhosts
762and
763.Pa .shosts
764files will not be used in
Ben Lindstrom9f049032002-06-21 00:59:05 +0000765.Cm HostbasedAuthentication .
766.Pp
767.Pa /etc/hosts.equiv
768and
769.Pa /etc/shosts.equiv
770are still used.
771The default is
772.Dq yes .
773.It Cm IgnoreUserKnownHosts
774Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +1100775.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000776should ignore the user's
Damien Miller167ea5d2005-05-26 12:04:02 +1000777.Pa ~/.ssh/known_hosts
Ben Lindstrom9f049032002-06-21 00:59:05 +0000778during
Ben Lindstrom9f049032002-06-21 00:59:05 +0000779.Cm HostbasedAuthentication .
780The default is
781.Dq no .
Damien Miller0dac6fb2010-11-20 15:19:38 +1100782.It Cm IPQoS
783Specifies the IPv4 type-of-service or DSCP class for the connection.
784Accepted values are
785.Dq af11 ,
786.Dq af12 ,
787.Dq af13 ,
Damien Millerf6e758c2011-09-22 21:37:13 +1000788.Dq af21 ,
Damien Miller0dac6fb2010-11-20 15:19:38 +1100789.Dq af22 ,
790.Dq af23 ,
791.Dq af31 ,
792.Dq af32 ,
793.Dq af33 ,
794.Dq af41 ,
795.Dq af42 ,
796.Dq af43 ,
797.Dq cs0 ,
798.Dq cs1 ,
799.Dq cs2 ,
800.Dq cs3 ,
801.Dq cs4 ,
802.Dq cs5 ,
803.Dq cs6 ,
804.Dq cs7 ,
805.Dq ef ,
806.Dq lowdelay ,
807.Dq throughput ,
808.Dq reliability ,
809or a numeric value.
Damien Miller928362d2010-12-26 14:26:45 +1100810This option may take one or two arguments, separated by whitespace.
Damien Miller0dac6fb2010-11-20 15:19:38 +1100811If one argument is specified, it is used as the packet class unconditionally.
812If two values are specified, the first is automatically selected for
813interactive sessions and the second for non-interactive sessions.
814The default is
815.Dq lowdelay
816for interactive sessions and
817.Dq throughput
818for non-interactive sessions.
Damien Millere1e480a2014-02-04 11:13:17 +1100819.It Cm KbdInteractiveAuthentication
820Specifies whether to allow keyboard-interactive authentication.
821The argument to this keyword must be
822.Dq yes
823or
824.Dq no .
825The default is to use whatever value
826.Cm ChallengeResponseAuthentication
827is set to
828(by default
829.Dq yes ) .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000830.It Cm KerberosAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000831Specifies whether the password provided by the user for
Ben Lindstrom9f049032002-06-21 00:59:05 +0000832.Cm PasswordAuthentication
Damien Miller1a0c0b92003-09-02 22:51:17 +1000833will be validated through the Kerberos KDC.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000834To use this option, the server needs a
835Kerberos servtab which allows the verification of the KDC's identity.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100836The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000837.Dq no .
Damien Miller8448e662004-03-08 23:13:15 +1100838.It Cm KerberosGetAFSToken
Darren Tuckere2dd2d52005-10-03 18:19:06 +1000839If AFS is active and the user has a Kerberos 5 TGT, attempt to acquire
Damien Miller8448e662004-03-08 23:13:15 +1100840an AFS token before accessing the user's home directory.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100841The default is
Damien Miller8448e662004-03-08 23:13:15 +1100842.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000843.It Cm KerberosOrLocalPasswd
Damien Miller5b0d63f2006-03-15 11:56:56 +1100844If password authentication through Kerberos fails then
Ben Lindstrom9f049032002-06-21 00:59:05 +0000845the password will be validated via any additional local mechanism
846such as
847.Pa /etc/passwd .
Damien Miller5b0d63f2006-03-15 11:56:56 +1100848The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000849.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000850.It Cm KerberosTicketCleanup
851Specifies whether to automatically destroy the user's ticket cache
852file on logout.
Damien Miller5b0d63f2006-03-15 11:56:56 +1100853The default is
Ben Lindstrom9f049032002-06-21 00:59:05 +0000854.Dq yes .
Damien Millerd5f62bf2010-09-24 22:11:14 +1000855.It Cm KexAlgorithms
856Specifies the available KEX (Key Exchange) algorithms.
857Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000858Alternately if the specified value begins with a
859.Sq +
860character, then the specified methods will be appended to the default set
861instead of replacing them.
Damien Millerc1621c82014-04-20 13:22:46 +1000862The supported algorithms are:
863.Pp
864.Bl -item -compact -offset indent
865.It
djm@openbsd.org16277fc2016-09-22 17:55:13 +0000866curve25519-sha256
867.It
Damien Millerc1621c82014-04-20 13:22:46 +1000868curve25519-sha256@libssh.org
869.It
870diffie-hellman-group1-sha1
871.It
872diffie-hellman-group14-sha1
873.It
874diffie-hellman-group-exchange-sha1
875.It
876diffie-hellman-group-exchange-sha256
877.It
878ecdh-sha2-nistp256
879.It
880ecdh-sha2-nistp384
881.It
882ecdh-sha2-nistp521
883.El
884.Pp
885The default is:
Damien Miller6575c3a2013-12-18 17:47:02 +1100886.Bd -literal -offset indent
djm@openbsd.org16277fc2016-09-22 17:55:13 +0000887curve25519-sha256,curve25519-sha256@libssh.org,
Damien Miller6575c3a2013-12-18 17:47:02 +1100888ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,
889diffie-hellman-group-exchange-sha256,
Damien Millerc1621c82014-04-20 13:22:46 +1000890diffie-hellman-group14-sha1
Damien Miller6575c3a2013-12-18 17:47:02 +1100891.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +0000892.Pp
893The list of available key exchange algorithms may also be obtained using the
894.Fl Q
895option of
896.Xr ssh 1
897with an argument of
898.Dq kex .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000899.It Cm ListenAddress
900Specifies the local addresses
Damien Miller5b0d63f2006-03-15 11:56:56 +1100901.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +0000902should listen on.
903The following forms may be used:
904.Pp
905.Bl -item -offset indent -compact
906.It
907.Cm ListenAddress
908.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000909.Ar host | Ar IPv4_addr | Ar IPv6_addr
Ben Lindstrom9f049032002-06-21 00:59:05 +0000910.Sm on
911.It
912.Cm ListenAddress
913.Sm off
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000914.Ar host | Ar IPv4_addr : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000915.Sm on
916.It
917.Cm ListenAddress
918.Sm off
919.Oo
jmc@openbsd.org08c0eeb2014-11-22 19:21:03 +0000920.Ar host | Ar IPv6_addr Oc : Ar port
Ben Lindstrom9f049032002-06-21 00:59:05 +0000921.Sm on
922.El
923.Pp
924If
925.Ar port
926is not specified,
dtucker@openbsd.org531a57a2015-04-29 03:48:56 +0000927sshd will listen on the address and all
Ben Lindstrom9f049032002-06-21 00:59:05 +0000928.Cm Port
Damien Millerfbf486b2003-05-23 18:44:23 +1000929options specified.
930The default is to listen on all local addresses.
Damien Miller495dca32003-04-01 21:42:14 +1000931Multiple
Ben Lindstrom9f049032002-06-21 00:59:05 +0000932.Cm ListenAddress
Damien Millerfbf486b2003-05-23 18:44:23 +1000933options are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000934.It Cm LoginGraceTime
935The server disconnects after this time if the user has not
936successfully logged in.
937If the value is 0, there is no time limit.
Damien Millerc1348632002-09-05 14:35:14 +1000938The default is 120 seconds.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000939.It Cm LogLevel
940Gives the verbosity level that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +1100941.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +0000942The possible values are:
Damien Miller5b0d63f2006-03-15 11:56:56 +1100943QUIET, FATAL, ERROR, INFO, VERBOSE, DEBUG, DEBUG1, DEBUG2, and DEBUG3.
Damien Miller495dca32003-04-01 21:42:14 +1000944The default is INFO.
945DEBUG and DEBUG1 are equivalent.
946DEBUG2 and DEBUG3 each specify higher levels of debugging output.
947Logging with a DEBUG level violates the privacy of users and is not recommended.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000948.It Cm MACs
949Specifies the available MAC (message authentication code) algorithms.
jmc@openbsd.orga685ae82016-02-17 07:38:19 +0000950The MAC algorithm is used for data integrity protection.
Ben Lindstrom9f049032002-06-21 00:59:05 +0000951Multiple algorithms must be comma-separated.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +0000952If the specified value begins with a
953.Sq +
954character, then the specified algorithms will be appended to the default set
955instead of replacing them.
956.Pp
Damien Milleraf43a7a2012-12-12 10:46:31 +1100957The algorithms that contain
958.Dq -etm
959calculate the MAC after encryption (encrypt-then-mac).
960These are considered safer and their use recommended.
Damien Millerc1621c82014-04-20 13:22:46 +1000961The supported MACs are:
962.Pp
963.Bl -item -compact -offset indent
964.It
965hmac-md5
966.It
967hmac-md5-96
968.It
969hmac-ripemd160
970.It
971hmac-sha1
972.It
973hmac-sha1-96
974.It
975hmac-sha2-256
976.It
977hmac-sha2-512
978.It
979umac-64@openssh.com
980.It
981umac-128@openssh.com
982.It
983hmac-md5-etm@openssh.com
984.It
985hmac-md5-96-etm@openssh.com
986.It
987hmac-ripemd160-etm@openssh.com
988.It
989hmac-sha1-etm@openssh.com
990.It
991hmac-sha1-96-etm@openssh.com
992.It
993hmac-sha2-256-etm@openssh.com
994.It
995hmac-sha2-512-etm@openssh.com
996.It
997umac-64-etm@openssh.com
998.It
999umac-128-etm@openssh.com
1000.El
1001.Pp
Damien Miller5b0d63f2006-03-15 11:56:56 +11001002The default is:
Damien Miller22b7b492007-06-11 14:07:12 +10001003.Bd -literal -offset indent
Damien Milleraf43a7a2012-12-12 10:46:31 +11001004umac-64-etm@openssh.com,umac-128-etm@openssh.com,
1005hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001006hmac-sha1-etm@openssh.com,
Damien Millerc1621c82014-04-20 13:22:46 +10001007umac-64@openssh.com,umac-128@openssh.com,
djm@openbsd.orge4c918a2016-02-11 02:56:32 +00001008hmac-sha2-256,hmac-sha2-512,hmac-sha1
Damien Miller22b7b492007-06-11 14:07:12 +10001009.Ed
djm@openbsd.org8f6784f2014-12-22 09:05:17 +00001010.Pp
1011The list of available MAC algorithms may also be obtained using the
1012.Fl Q
1013option of
1014.Xr ssh 1
1015with an argument of
1016.Dq mac .
Darren Tucker45150472006-07-12 22:34:17 +10001017.It Cm Match
Damien Millerd04f3572006-07-24 13:46:50 +10001018Introduces a conditional block.
Damien Miller8c234032006-07-24 14:05:08 +10001019If all of the criteria on the
Darren Tucker45150472006-07-12 22:34:17 +10001020.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001021line are satisfied, the keywords on the following lines override those
1022set in the global section of the config file, until either another
Darren Tucker45150472006-07-12 22:34:17 +10001023.Cm Match
Damien Miller8c234032006-07-24 14:05:08 +10001024line or the end of the file.
Damien Millerfc5d6752014-02-28 10:01:28 +11001025If a keyword appears in multiple
1026.Cm Match
sobrado@openbsd.org180bcb42014-08-30 16:32:25 +00001027blocks that are satisfied, only the first instance of the keyword is
Damien Millerfc5d6752014-02-28 10:01:28 +11001028applied.
Darren Tucker7a3935d2008-06-10 22:59:10 +10001029.Pp
Damien Millerd04f3572006-07-24 13:46:50 +10001030The arguments to
Darren Tucker45150472006-07-12 22:34:17 +10001031.Cm Match
Damien Millercf31f382013-10-24 21:02:56 +11001032are one or more criteria-pattern pairs or the single token
1033.Cm All
1034which matches all criteria.
Darren Tucker45150472006-07-12 22:34:17 +10001035The available criteria are
1036.Cm User ,
Damien Miller565ca3f2006-08-19 00:23:15 +10001037.Cm Group ,
Darren Tucker45150472006-07-12 22:34:17 +10001038.Cm Host ,
Darren Tuckerfbcf8272012-05-19 19:37:01 +10001039.Cm LocalAddress ,
1040.Cm LocalPort ,
Darren Tucker45150472006-07-12 22:34:17 +10001041and
1042.Cm Address .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001043The match patterns may consist of single entries or comma-separated
1044lists and may use the wildcard and negation operators described in the
Damien Millerfecfd112013-07-18 16:11:50 +10001045PATTERNS section of
Darren Tuckerb06cc4a2008-06-10 22:59:53 +10001046.Xr ssh_config 5 .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001047.Pp
1048The patterns in an
1049.Cm Address
1050criteria may additionally contain addresses to match in CIDR
Darren Tucker6a2a4002008-06-10 23:03:04 +10001051address/masklen format, e.g.\&
Darren Tucker7a3935d2008-06-10 22:59:10 +10001052.Dq 192.0.2.0/24
1053or
jca@openbsd.org42d47ad2016-08-12 19:19:04 +00001054.Dq 2001:db8::/32 .
Darren Tucker7a3935d2008-06-10 22:59:10 +10001055Note that the mask length provided must be consistent with the address -
1056it is an error to specify a mask length that is too long for the address
Darren Tucker6a2a4002008-06-10 23:03:04 +10001057or one with bits set in this host portion of the address.
1058For example,
Darren Tucker7a3935d2008-06-10 22:59:10 +10001059.Dq 192.0.2.0/33
1060and
Darren Tucker6a2a4002008-06-10 23:03:04 +10001061.Dq 192.0.2.0/8
Darren Tucker7a3935d2008-06-10 22:59:10 +10001062respectively.
1063.Pp
Darren Tucker45150472006-07-12 22:34:17 +10001064Only a subset of keywords may be used on the lines following a
1065.Cm Match
1066keyword.
1067Available keywords are
Damien Millerf8268502012-06-20 21:54:15 +10001068.Cm AcceptEnv ,
Damien Miller17819012009-01-28 16:20:17 +11001069.Cm AllowAgentForwarding ,
Damien Millerf8268502012-06-20 21:54:15 +10001070.Cm AllowGroups ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001071.Cm AllowStreamLocalForwarding ,
Damien Miller9b439df2006-07-24 14:04:00 +10001072.Cm AllowTcpForwarding ,
Damien Millerc24da772012-06-20 21:53:58 +10001073.Cm AllowUsers ,
Damien Millera6e3f012012-11-04 23:21:40 +11001074.Cm AuthenticationMethods ,
Damien Miller09d3e122012-10-31 08:58:58 +11001075.Cm AuthorizedKeysCommand ,
1076.Cm AuthorizedKeysCommandUser ,
Damien Millerf33580e2012-11-04 22:22:52 +11001077.Cm AuthorizedKeysFile ,
djm@openbsd.orgb6b91082015-11-13 02:57:46 +00001078.Cm AuthorizedPrincipalsCommand ,
1079.Cm AuthorizedPrincipalsCommandUser ,
Damien Millerab6de352010-06-26 09:38:45 +10001080.Cm AuthorizedPrincipalsFile ,
Darren Tucker1629c072007-02-19 22:25:37 +11001081.Cm Banner ,
Damien Miller797e3d12008-05-19 14:27:42 +10001082.Cm ChrootDirectory ,
Damien Millerc24da772012-06-20 21:53:58 +10001083.Cm DenyGroups ,
1084.Cm DenyUsers ,
Damien Millere2754432006-07-24 14:06:47 +10001085.Cm ForceCommand ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001086.Cm GatewayPorts ,
djm@openbsd.orgbd49da22015-02-20 23:46:01 +00001087.Cm GSSAPIAuthentication ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001088.Cm HostbasedAcceptedKeyTypes ,
Damien Miller25434de2008-05-19 14:29:08 +10001089.Cm HostbasedAuthentication ,
Damien Millerab6de352010-06-26 09:38:45 +10001090.Cm HostbasedUsesNameFromPacketOnly ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001091.Cm IPQoS ,
Darren Tucker1d75f222007-03-01 21:31:28 +11001092.Cm KbdInteractiveAuthentication ,
Damien Miller5737e362007-03-06 21:21:18 +11001093.Cm KerberosAuthentication ,
Damien Miller307c1d12008-06-16 07:56:20 +10001094.Cm MaxAuthTries ,
Damien Millerc62a5af2008-06-16 07:55:46 +10001095.Cm MaxSessions ,
Darren Tucker1629c072007-02-19 22:25:37 +11001096.Cm PasswordAuthentication ,
Damien Miller51bde602008-11-03 19:23:10 +11001097.Cm PermitEmptyPasswords ,
Damien Millerd1de9952006-07-24 14:05:48 +10001098.Cm PermitOpen ,
Darren Tucker15f94272008-01-01 20:36:56 +11001099.Cm PermitRootLogin ,
Damien Miller5ff30c62013-10-30 22:21:50 +11001100.Cm PermitTTY ,
Damien Millerab6de352010-06-26 09:38:45 +10001101.Cm PermitTunnel ,
Damien Miller72e6b5c2014-07-04 09:00:04 +10001102.Cm PermitUserRC ,
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001103.Cm PubkeyAcceptedKeyTypes ,
Darren Tucker1477ea12009-10-07 08:36:05 +11001104.Cm PubkeyAuthentication ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001105.Cm RekeyLimit ,
1106.Cm RevokedKeys ,
djm@openbsd.org18a208d2015-02-20 22:40:32 +00001107.Cm StreamLocalBindMask ,
1108.Cm StreamLocalBindUnlink ,
1109.Cm TrustedUserCAKeys ,
Damien Millerd1de9952006-07-24 14:05:48 +10001110.Cm X11DisplayOffset ,
Damien Miller19913842009-02-23 10:53:58 +11001111.Cm X11Forwarding
Darren Tucker45150472006-07-12 22:34:17 +10001112and
Damien Miller0296ae82009-02-23 11:00:24 +11001113.Cm X11UseLocalHost .
Darren Tucker89413db2004-05-24 10:36:23 +10001114.It Cm MaxAuthTries
1115Specifies the maximum number of authentication attempts permitted per
Damien Miller26213e52004-06-30 22:39:34 +10001116connection.
1117Once the number of failures reaches half this value,
1118additional failures are logged.
1119The default is 6.
Damien Miller7207f642008-05-19 15:34:50 +10001120.It Cm MaxSessions
djm@openbsd.orgcac3b662016-02-05 02:37:56 +00001121Specifies the maximum number of open shell, login or subsystem (e.g. sftp)
1122sessions permitted per network connection.
1123Multiple sessions may be established by clients that support connection
1124multiplexing.
1125Setting
1126.Cm MaxSessions
1127to 1 will effectively disable session multiplexing, whereas setting it to 0
1128will prevent all shell, login and subsystem sessions while still permitting
1129forwarding.
Damien Miller7207f642008-05-19 15:34:50 +10001130The default is 10.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001131.It Cm MaxStartups
1132Specifies the maximum number of concurrent unauthenticated connections to the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001133SSH daemon.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001134Additional connections will be dropped until authentication succeeds or the
1135.Cm LoginGraceTime
1136expires for a connection.
Damien Miller1f583df2013-02-12 11:02:08 +11001137The default is 10:30:100.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001138.Pp
1139Alternatively, random early drop can be enabled by specifying
1140the three colon separated values
1141.Dq start:rate:full
Damien Miller208f1ed2006-03-15 11:56:03 +11001142(e.g. "10:30:60").
Damien Millerf4f22b52006-03-15 11:57:25 +11001143.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001144will refuse connection attempts with a probability of
1145.Dq rate/100
1146(30%)
1147if there are currently
1148.Dq start
1149(10)
1150unauthenticated connections.
1151The probability increases linearly and all connection attempts
1152are refused if the number of unauthenticated connections reaches
1153.Dq full
1154(60).
1155.It Cm PasswordAuthentication
1156Specifies whether password authentication is allowed.
1157The default is
1158.Dq yes .
1159.It Cm PermitEmptyPasswords
1160When password authentication is allowed, it specifies whether the
1161server allows login to accounts with empty password strings.
1162The default is
1163.Dq no .
Damien Miller9b439df2006-07-24 14:04:00 +10001164.It Cm PermitOpen
1165Specifies the destinations to which TCP port forwarding is permitted.
1166The forwarding specification must be one of the following forms:
1167.Pp
1168.Bl -item -offset indent -compact
1169.It
1170.Cm PermitOpen
1171.Sm off
1172.Ar host : port
1173.Sm on
1174.It
1175.Cm PermitOpen
1176.Sm off
1177.Ar IPv4_addr : port
1178.Sm on
1179.It
1180.Cm PermitOpen
1181.Sm off
1182.Ar \&[ IPv6_addr \&] : port
1183.Sm on
1184.El
1185.Pp
Damien Millera765cf42006-07-24 14:08:13 +10001186Multiple forwards may be specified by separating them with whitespace.
Damien Miller9b439df2006-07-24 14:04:00 +10001187An argument of
1188.Dq any
1189can be used to remove all restrictions and permit any forwarding requests.
Darren Tuckerba9ea322012-05-19 19:37:33 +10001190An argument of
1191.Dq none
1192can be used to prohibit all forwarding requests.
jmc@openbsd.org32d921c2016-07-19 12:59:16 +00001193The wildcard
dtucker@openbsd.orgd7eabc82016-07-19 11:38:53 +00001194.Dq *
jmc@openbsd.org32d921c2016-07-19 12:59:16 +00001195can be used for host or port to allow all hosts or ports, respectively.
Damien Miller65bc2c42006-07-24 14:04:16 +10001196By default all port forwarding requests are permitted.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001197.It Cm PermitRootLogin
Darren Tuckerb3509012005-01-20 11:01:46 +11001198Specifies whether root can log in using
Ben Lindstrom9f049032002-06-21 00:59:05 +00001199.Xr ssh 1 .
1200The argument must be
1201.Dq yes ,
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001202.Dq prohibit-password ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001203.Dq without-password ,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001204.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001205or
1206.Dq no .
1207The default is
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001208.Dq prohibit-password .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001209.Pp
1210If this option is set to
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001211.Dq prohibit-password
1212or
Damien Miller5b0d63f2006-03-15 11:56:56 +11001213.Dq without-password ,
deraadt@openbsd.org1dc8d932015-08-06 14:53:21 +00001214password and keyboard-interactive authentication are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001215.Pp
1216If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001217.Dq forced-commands-only ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001218root login with public key authentication will be allowed,
1219but only if the
1220.Ar command
1221option has been specified
1222(which may be useful for taking remote backups even if root login is
Damien Millerfbf486b2003-05-23 18:44:23 +10001223normally not allowed).
1224All other authentication methods are disabled for root.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001225.Pp
1226If this option is set to
Damien Miller5b0d63f2006-03-15 11:56:56 +11001227.Dq no ,
Darren Tuckerb3509012005-01-20 11:01:46 +11001228root is not allowed to log in.
jmc@openbsd.orgf219fc82016-09-07 18:39:24 +00001229.It Cm PermitTTY
1230Specifies whether
1231.Xr pty 4
1232allocation is permitted.
1233The default is
1234.Dq yes .
Damien Millerd27b9472005-12-13 19:29:02 +11001235.It Cm PermitTunnel
1236Specifies whether
1237.Xr tun 4
1238device forwarding is allowed.
Damien Miller7b58e802005-12-13 19:33:19 +11001239The argument must be
1240.Dq yes ,
Damien Miller991dba42006-07-10 20:16:27 +10001241.Dq point-to-point
1242(layer 3),
1243.Dq ethernet
1244(layer 2), or
Damien Miller7b58e802005-12-13 19:33:19 +11001245.Dq no .
Damien Miller991dba42006-07-10 20:16:27 +10001246Specifying
1247.Dq yes
1248permits both
1249.Dq point-to-point
1250and
1251.Dq ethernet .
Damien Millerd27b9472005-12-13 19:29:02 +11001252The default is
1253.Dq no .
djm@openbsd.org48dffd52014-09-09 09:45:36 +00001254.Pp
1255Independent of this setting, the permissions of the selected
1256.Xr tun 4
1257device must allow access to the user.
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001258.It Cm PermitUserEnvironment
1259Specifies whether
1260.Pa ~/.ssh/environment
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001261and
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001262.Cm environment=
1263options in
1264.Pa ~/.ssh/authorized_keys
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001265are processed by
Damien Miller5b0d63f2006-03-15 11:56:56 +11001266.Xr sshd 8 .
Ben Lindstrom5d860f02002-08-01 01:28:38 +00001267The default is
1268.Dq no .
Ben Lindstrombd9bf382002-08-20 18:54:20 +00001269Enabling environment processing may enable users to bypass access
1270restrictions in some configurations using mechanisms such as
1271.Ev LD_PRELOAD .
Damien Miller72e6b5c2014-07-04 09:00:04 +10001272.It Cm PermitUserRC
1273Specifies whether any
1274.Pa ~/.ssh/rc
1275file is executed.
1276The default is
1277.Dq yes .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001278.It Cm PidFile
Ben Lindstrom959de992002-06-23 00:35:25 +00001279Specifies the file that contains the process ID of the
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001280SSH daemon, or
1281.Dq none
1282to not write one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001283The default is
1284.Pa /var/run/sshd.pid .
1285.It Cm Port
1286Specifies the port number that
Damien Miller5b0d63f2006-03-15 11:56:56 +11001287.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001288listens on.
1289The default is 22.
1290Multiple options of this type are permitted.
1291See also
1292.Cm ListenAddress .
1293.It Cm PrintLastLog
1294Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001295.Xr sshd 8
Darren Tucker7cc5c232004-11-05 20:06:59 +11001296should print the date and time of the last user login when a user logs
1297in interactively.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001298The default is
1299.Dq yes .
1300.It Cm PrintMotd
1301Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001302.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001303should print
1304.Pa /etc/motd
1305when a user logs in interactively.
1306(On some systems it is also printed by the shell,
1307.Pa /etc/profile ,
1308or equivalent.)
1309The default is
1310.Dq yes .
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001311.It Cm PubkeyAcceptedKeyTypes
1312Specifies the key types that will be accepted for public key authentication
1313as a comma-separated pattern list.
djm@openbsd.orgf9eca242015-07-30 00:01:34 +00001314Alternately if the specified value begins with a
1315.Sq +
1316character, then the specified key types will be appended to the default set
1317instead of replacing them.
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001318The default for this option is:
1319.Bd -literal -offset 3n
1320ecdsa-sha2-nistp256-cert-v01@openssh.com,
1321ecdsa-sha2-nistp384-cert-v01@openssh.com,
1322ecdsa-sha2-nistp521-cert-v01@openssh.com,
1323ssh-ed25519-cert-v01@openssh.com,
1324ssh-rsa-cert-v01@openssh.com,
1325ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,
djm@openbsd.org3a13cb52016-02-17 08:57:34 +00001326ssh-ed25519,ssh-rsa
markus@openbsd.org3a1638d2015-07-10 06:21:53 +00001327.Ed
1328.Pp
djm@openbsd.org1f729f02015-01-13 07:39:19 +00001329The
1330.Fl Q
1331option of
1332.Xr ssh 1
1333may be used to list supported key types.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001334.It Cm PubkeyAuthentication
1335Specifies whether public key authentication is allowed.
1336The default is
1337.Dq yes .
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001338.It Cm RekeyLimit
1339Specifies the maximum amount of data that may be transmitted before the
1340session key is renegotiated, optionally followed a maximum amount of
1341time that may pass before the session key is renegotiated.
1342The first argument is specified in bytes and may have a suffix of
1343.Sq K ,
1344.Sq M ,
1345or
1346.Sq G
1347to indicate Kilobytes, Megabytes, or Gigabytes, respectively.
1348The default is between
1349.Sq 1G
1350and
1351.Sq 4G ,
1352depending on the cipher.
1353The optional second value is specified in seconds and may use any of the
1354units documented in the
1355.Sx TIME FORMATS
Darren Tucker64d22942013-05-16 20:31:29 +10001356section.
Darren Tucker5f96f3b2013-05-16 20:29:28 +10001357The default value for
1358.Cm RekeyLimit
1359is
1360.Dq default none ,
1361which means that rekeying is performed after the cipher's default amount
1362of data has been sent or received and no time based rekeying is done.
Damien Miller1aed65e2010-03-04 21:53:35 +11001363.It Cm RevokedKeys
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001364Specifies revoked public keys file, or
1365.Dq none
1366to not use one.
Damien Miller1aed65e2010-03-04 21:53:35 +11001367Keys listed in this file will be refused for public key authentication.
1368Note that if this file is not readable, then public key authentication will
1369be refused for all users.
Damien Millerf3747bf2013-01-18 11:44:04 +11001370Keys may be specified as a text file, listing one public key per line, or as
1371an OpenSSH Key Revocation List (KRL) as generated by
Damien Miller72abeb72013-01-20 22:33:44 +11001372.Xr ssh-keygen 1 .
Damien Millerfecfd112013-07-18 16:11:50 +10001373For more information on KRLs, see the KEY REVOCATION LISTS section in
Damien Millerf3747bf2013-01-18 11:44:04 +11001374.Xr ssh-keygen 1 .
Damien Miller7acefbb2014-07-18 14:11:24 +10001375.It Cm StreamLocalBindMask
1376Sets the octal file creation mode mask
1377.Pq umask
1378used when creating a Unix-domain socket file for local or remote
1379port forwarding.
1380This option is only used for port forwarding to a Unix-domain socket file.
1381.Pp
1382The default value is 0177, which creates a Unix-domain socket file that is
1383readable and writable only by the owner.
1384Note that not all operating systems honor the file mode on Unix-domain
1385socket files.
1386.It Cm StreamLocalBindUnlink
1387Specifies whether to remove an existing Unix-domain socket file for local
1388or remote port forwarding before creating a new one.
1389If the socket file already exists and
1390.Cm StreamLocalBindUnlink
1391is not enabled,
1392.Nm sshd
1393will be unable to forward the port to the Unix-domain socket file.
1394This option is only used for port forwarding to a Unix-domain socket file.
1395.Pp
1396The argument must be
1397.Dq yes
1398or
1399.Dq no .
1400The default is
1401.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001402.It Cm StrictModes
1403Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001404.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001405should check file modes and ownership of the
1406user's files and home directory before accepting login.
1407This is normally desirable because novices sometimes accidentally leave their
1408directory or files world-writable.
1409The default is
1410.Dq yes .
Darren Tuckerf788a912010-01-08 17:06:47 +11001411Note that this does not apply to
1412.Cm ChrootDirectory ,
1413whose permissions and ownership are checked unconditionally.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001414.It Cm Subsystem
Damien Miller208f1ed2006-03-15 11:56:03 +11001415Configures an external subsystem (e.g. file transfer daemon).
Damien Miller917f9b62006-07-10 20:36:47 +10001416Arguments should be a subsystem name and a command (with optional arguments)
1417to execute upon subsystem request.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001418.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001419The command
1420.Xr sftp-server 8
1421implements the
1422.Dq sftp
1423file transfer subsystem.
Damien Millerd8cb1f12008-02-10 22:40:12 +11001424.Pp
1425Alternately the name
1426.Dq internal-sftp
1427implements an in-process
1428.Dq sftp
1429server.
1430This may simplify configurations using
1431.Cm ChrootDirectory
1432to force a different filesystem root on clients.
1433.Pp
Ben Lindstrom9f049032002-06-21 00:59:05 +00001434By default no subsystems are defined.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001435.It Cm SyslogFacility
1436Gives the facility code that is used when logging messages from
Damien Millerf4f22b52006-03-15 11:57:25 +11001437.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001438The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1, LOCAL2,
1439LOCAL3, LOCAL4, LOCAL5, LOCAL6, LOCAL7.
1440The default is AUTH.
Damien Miller12c150e2003-12-17 16:31:10 +11001441.It Cm TCPKeepAlive
1442Specifies whether the system should send TCP keepalive messages to the
1443other side.
1444If they are sent, death of the connection or crash of one
1445of the machines will be properly noticed.
1446However, this means that
1447connections will die if the route is down temporarily, and some people
1448find it annoying.
1449On the other hand, if TCP keepalives are not sent,
1450sessions may hang indefinitely on the server, leaving
1451.Dq ghost
1452users and consuming server resources.
1453.Pp
1454The default is
1455.Dq yes
1456(to send TCP keepalive messages), and the server will notice
1457if the network goes down or the client host crashes.
1458This avoids infinitely hanging sessions.
1459.Pp
1460To disable TCP keepalive messages, the value should be set to
1461.Dq no .
Damien Miller1aed65e2010-03-04 21:53:35 +11001462.It Cm TrustedUserCAKeys
1463Specifies a file containing public keys of certificate authorities that are
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001464trusted to sign user certificates for authentication, or
1465.Dq none
1466to not use one.
Damien Miller72b33822010-03-05 07:39:01 +11001467Keys are listed one per line; empty lines and comments starting with
Damien Miller1aed65e2010-03-04 21:53:35 +11001468.Ql #
1469are allowed.
1470If a certificate is presented for authentication and has its signing CA key
1471listed in this file, then it may be used for authentication for any user
1472listed in the certificate's principals list.
1473Note that certificates that lack a list of principals will not be permitted
1474for authentication using
1475.Cm TrustedUserCAKeys .
Damien Millerfecfd112013-07-18 16:11:50 +10001476For more details on certificates, see the CERTIFICATES section in
Damien Miller1aed65e2010-03-04 21:53:35 +11001477.Xr ssh-keygen 1 .
Damien Miller3a961dc2003-06-03 10:25:48 +10001478.It Cm UseDNS
1479Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001480.Xr sshd 8
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001481should look up the remote host name, and to check that
Damien Miller3a961dc2003-06-03 10:25:48 +10001482the resolved host name for the remote IP address maps back to the
1483very same IP address.
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001484.Pp
1485If this option is set to
1486.Dq no
1487(the default) then only addresses and not host names may be used in
djm@openbsd.org0235a5f2016-03-17 17:19:43 +00001488.Pa ~/.ssh/authorized_keys
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001489.Cm from
1490and
jmc@openbsd.org1f8d3d62015-08-14 15:32:41 +00001491.Nm
djm@openbsd.orgc63c9a62015-07-20 00:30:01 +00001492.Cm Match
1493.Cm Host
1494directives.
Damien Miller2e193e22003-05-14 15:13:03 +10001495.It Cm UsePAM
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001496Enables the Pluggable Authentication Module interface.
1497If set to
1498.Dq yes
1499this will enable PAM authentication using
1500.Cm ChallengeResponseAuthentication
Darren Tuckera4904f72006-02-23 21:35:30 +11001501and
1502.Cm PasswordAuthentication
1503in addition to PAM account and session module processing for all
1504authentication types.
Darren Tucker1dcff9a2004-05-13 16:51:40 +10001505.Pp
1506Because PAM challenge-response authentication usually serves an equivalent
1507role to password authentication, you should disable either
1508.Cm PasswordAuthentication
1509or
1510.Cm ChallengeResponseAuthentication.
1511.Pp
1512If
1513.Cm UsePAM
1514is enabled, you will not be able to run
1515.Xr sshd 8
1516as a non-root user.
1517The default is
Darren Tucker6c0c0702003-10-09 14:13:53 +10001518.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001519.It Cm UsePrivilegeSeparation
1520Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001521.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001522separates privileges by creating an unprivileged child process
Damien Miller495dca32003-04-01 21:42:14 +10001523to deal with incoming network traffic.
1524After successful authentication, another process will be created that has
1525the privilege of the authenticated user.
1526The goal of privilege separation is to prevent privilege
Ben Lindstrom9f049032002-06-21 00:59:05 +00001527escalation by containing any corruption within the unprivileged processes.
sobrado@openbsd.orgbdcb73f2015-10-07 14:45:30 +00001528The argument must be
1529.Dq yes ,
1530.Dq no ,
1531or
1532.Dq sandbox .
Damien Miller69ff1df2011-06-23 08:30:03 +10001533If
1534.Cm UsePrivilegeSeparation
1535is set to
1536.Dq sandbox
1537then the pre-authentication unprivileged process is subject to additional
1538restrictions.
sobrado@openbsd.orgbdcb73f2015-10-07 14:45:30 +00001539The default is
1540.Dq sandbox .
Damien Miller23528812012-04-22 11:24:43 +10001541.It Cm VersionAddendum
1542Optionally specifies additional text to append to the SSH protocol banner
1543sent by the server upon connection.
1544The default is
1545.Dq none .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001546.It Cm X11DisplayOffset
1547Specifies the first display number available for
Damien Miller5b0d63f2006-03-15 11:56:56 +11001548.Xr sshd 8 Ns 's
Ben Lindstrom9f049032002-06-21 00:59:05 +00001549X11 forwarding.
Damien Miller5b0d63f2006-03-15 11:56:56 +11001550This prevents sshd from interfering with real X11 servers.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001551The default is 10.
1552.It Cm X11Forwarding
1553Specifies whether X11 forwarding is permitted.
Damien Miller101c4a72002-09-19 11:51:21 +10001554The argument must be
1555.Dq yes
1556or
1557.Dq no .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001558The default is
1559.Dq no .
Damien Miller101c4a72002-09-19 11:51:21 +10001560.Pp
1561When X11 forwarding is enabled, there may be additional exposure to
1562the server and to client displays if the
Damien Miller5b0d63f2006-03-15 11:56:56 +11001563.Xr sshd 8
Damien Miller101c4a72002-09-19 11:51:21 +10001564proxy display is configured to listen on the wildcard address (see
1565.Cm X11UseLocalhost
Damien Miller5b0d63f2006-03-15 11:56:56 +11001566below), though this is not the default.
Damien Miller101c4a72002-09-19 11:51:21 +10001567Additionally, the authentication spoofing and authentication data
1568verification and substitution occur on the client side.
1569The security risk of using X11 forwarding is that the client's X11
Damien Miller5b0d63f2006-03-15 11:56:56 +11001570display server may be exposed to attack when the SSH client requests
Damien Miller101c4a72002-09-19 11:51:21 +10001571forwarding (see the warnings for
1572.Cm ForwardX11
1573in
Damien Millerf1ce5052003-06-11 22:04:39 +10001574.Xr ssh_config 5 ) .
Damien Miller101c4a72002-09-19 11:51:21 +10001575A system administrator may have a stance in which they want to
1576protect clients that may expose themselves to attack by unwittingly
1577requesting X11 forwarding, which can warrant a
1578.Dq no
1579setting.
1580.Pp
1581Note that disabling X11 forwarding does not prevent users from
1582forwarding X11 traffic, as users can always install their own forwarders.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001583.It Cm X11UseLocalhost
1584Specifies whether
Damien Miller5b0d63f2006-03-15 11:56:56 +11001585.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001586should bind the X11 forwarding server to the loopback address or to
Damien Miller495dca32003-04-01 21:42:14 +10001587the wildcard address.
1588By default,
Damien Miller5b0d63f2006-03-15 11:56:56 +11001589sshd binds the forwarding server to the loopback address and sets the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001590hostname part of the
1591.Ev DISPLAY
1592environment variable to
1593.Dq localhost .
Ben Lindstrom15b61202002-08-20 18:44:24 +00001594This prevents remote hosts from connecting to the proxy display.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001595However, some older X11 clients may not function with this
1596configuration.
1597.Cm X11UseLocalhost
1598may be set to
1599.Dq no
1600to specify that the forwarding server should be bound to the wildcard
1601address.
1602The argument must be
1603.Dq yes
1604or
1605.Dq no .
1606The default is
1607.Dq yes .
1608.It Cm XAuthLocation
Damien Miller05913ba2002-09-04 16:51:03 +10001609Specifies the full pathname of the
Ben Lindstrom9f049032002-06-21 00:59:05 +00001610.Xr xauth 1
dtucker@openbsd.org6cc7cfa2015-04-16 23:25:50 +00001611program, or
1612.Dq none
1613to not use one.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001614The default is
1615.Pa /usr/X11R6/bin/xauth .
1616.El
Damien Millere3beba22006-03-15 11:59:25 +11001617.Sh TIME FORMATS
Damien Millerf4f22b52006-03-15 11:57:25 +11001618.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001619command-line arguments and configuration file options that specify time
1620may be expressed using a sequence of the form:
1621.Sm off
Ben Lindstrom1f8cf4f2002-08-20 18:43:27 +00001622.Ar time Op Ar qualifier ,
Ben Lindstrom9f049032002-06-21 00:59:05 +00001623.Sm on
1624where
1625.Ar time
1626is a positive integer value and
1627.Ar qualifier
1628is one of the following:
1629.Pp
1630.Bl -tag -width Ds -compact -offset indent
Damien Miller393821a2006-07-24 14:04:53 +10001631.It Aq Cm none
Ben Lindstrom9f049032002-06-21 00:59:05 +00001632seconds
1633.It Cm s | Cm S
1634seconds
1635.It Cm m | Cm M
1636minutes
1637.It Cm h | Cm H
1638hours
1639.It Cm d | Cm D
1640days
1641.It Cm w | Cm W
1642weeks
1643.El
1644.Pp
1645Each member of the sequence is added together to calculate
1646the total time value.
1647.Pp
1648Time format examples:
1649.Pp
1650.Bl -tag -width Ds -compact -offset indent
1651.It 600
1652600 seconds (10 minutes)
1653.It 10m
165410 minutes
1655.It 1h30m
16561 hour 30 minutes (90 minutes)
1657.El
jmc@openbsd.orgde6a1752016-09-22 19:19:01 +00001658.Sh TOKENS
1659Arguments to some keywords can make use of tokens,
1660which are expanded at runtime:
1661.Pp
1662.Bl -tag -width XXXX -offset indent -compact
1663.It %%
1664A literal
1665.Sq % .
1666.It %F
1667The fingerprint of the CA key.
1668.It %f
1669The fingerprint of the key or certificate.
1670.It %h
1671The home directory of the user.
1672.It %i
1673The key ID in the certificate.
1674.It %K
1675The base64-encoded CA key.
1676.It %k
1677The base64-encoded key or certificate for authentication.
1678.It %s
1679The serial number of the certificate.
1680.It \&%T
1681The type of the CA key.
1682.It %t
1683The key or certificate type.
1684.It %u
1685The username.
1686.El
1687.Pp
1688.Cm AuthorizedKeysCommand
1689accepts the tokens %%, %f, %h, %t, and %u.
1690.Pp
1691.Cm AuthorizedKeysFile
1692accepts the tokens %%, %h, and %u.
1693.Pp
1694.Cm AuthorizedPrincipalsCommand
1695accepts the tokens %%, %F, %f, %K, %k, %h, %i, %s, %T, %t, and %u.
1696.Pp
1697.Cm AuthorizedPrincipalsFile
1698accepts the tokens %%, %h, and %u.
1699.Pp
1700.Cm ChrootDirectory
1701accepts the tokens %%, %h, and %u.
Ben Lindstrom9f049032002-06-21 00:59:05 +00001702.Sh FILES
1703.Bl -tag -width Ds
1704.It Pa /etc/ssh/sshd_config
1705Contains configuration data for
Damien Millerf4f22b52006-03-15 11:57:25 +11001706.Xr sshd 8 .
Ben Lindstrom9f049032002-06-21 00:59:05 +00001707This file should be writable by root only, but it is recommended
1708(though not necessary) that it be world-readable.
1709.El
Damien Millerf1ce5052003-06-11 22:04:39 +10001710.Sh SEE ALSO
1711.Xr sshd 8
Ben Lindstrom9f049032002-06-21 00:59:05 +00001712.Sh AUTHORS
1713OpenSSH is a derivative of the original and free
1714ssh 1.2.12 release by Tatu Ylonen.
1715Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
1716Theo de Raadt and Dug Song
1717removed many bugs, re-added newer features and
1718created OpenSSH.
1719Markus Friedl contributed the support for SSH
1720protocol versions 1.5 and 2.0.
1721Niels Provos and Markus Friedl contributed support
1722for privilege separation.