6057 login(1) "Last login" hostname is too short
Reviewed by: Gary Mills <gary_mills@fastmail.fm>
Reviewed by: Albert Lee <trisk@omniti.com>
Reviewed by: Jason King <jason.brian.king@gmail.com>
Reviewed by: Alex Wilson <alex.wilson@joyent.com>
1 SSHD_CONFIG(4) File Formats and Configurations SSHD_CONFIG(4)
2
3
4
5 NAME
6 sshd_config - sshd configuration file
7
8 SYNOPSIS
9 /etc/ssh/sshd_config
10
11
12 DESCRIPTION
13 The sshd(1M) daemon reads configuration data from /etc/ssh/sshd_config
14 (or the file specified with sshd -f on the command line). The file
15 contains keyword-value pairs, one per line. A line starting with a hash
16 mark (#) and empty lines are interpreted as comments.
17
18
19 The sshd_config file supports the following keywords. Unless otherwise
20 noted, keywords and their arguments are case-insensitive.
21
22 AllowGroups
23 This keyword can be followed by a number of group names, separated
24 by spaces. If specified, login is allowed only for users whose
25 primary group or supplementary group list matches one of the
26 patterns. Asterisk (*) and question mark (?) can be used as
27 wildcards in the patterns. Only group names are valid; a numerical
28 group ID is not recognized. By default, login is allowed regardless
29 of the primary group.
30
31
32 AllowTcpForwarding
33 Specifies whether TCP forwarding is permitted. The default is yes.
34 Disabling TCP forwarding does not improve security unless users are
35 also denied shell access, as they can always install their own
36 forwarders.
37
38
39 AllowUsers
40 This keyword can be followed by a number of user names, separated
41 by spaces. If specified, login is allowed only for user names that
42 match one of the patterns. Asterisk (*) and question mark (?) can
43 be used as wildcards in the patterns. Only user names are valid; a
44 numerical user ID is not recognized. By default login is allowed
45 regardless of the user name.
46
47 If a specified pattern takes the form user@host then user and host
48 are checked separately, restricting logins to particular users from
49 particular hosts.
50
51
52 AuthorizedKeysFile
53 Specifies the file that contains the public keys that can be used
54 for user authentication. AuthorizedKeysFile can contain tokens of
55 the form %T, which are substituted during connection set-up. The
56 following tokens are defined: %% is replaced by a literal %, %h is
57 replaced by the home directory of the user being authenticated and
58 %u is replaced by the username of that user. After expansion,
59 AuthorizedKeysFile is taken to be an absolute path or one relative
60 to the user's home directory. The default is .ssh/authorized_keys.
61
62
63 Banner
64 In some jurisdictions, sending a warning message before
65 authentication can be relevant for getting legal protection. The
66 contents of the specified file are sent to the remote user before
67 authentication is allowed. This option is only available for
68 protocol version 2. By default, no banner is displayed.
69
70
71 ChrootDirectory
72 Specifies a path to chroot(2) to after authentication. This path,
73 and all its components, must be root-owned directories that are not
74 writable by any other user or group.
75
76 The server always tries to change to the user's home directory
77 locally under the chrooted environment but a failure to do so is
78 not considered an error. In addition, the path might contain the
79 following tokens that are expanded at runtime once the connecting
80 user has been authenticated: %% is replaced by a literal %, %h is
81 replaced by the home directory of the user being authenticated, and
82 %u is replaced by the username of that user.
83
84 The ChrootDirectory must contain the necessary files and
85 directories to support the user's session. For an interactive SSH
86 session this requires at least a user's shell, shared libraries
87 needed by the shell, dynamic linker, and possibly basic /dev nodes
88 such as null, zero, stdin, stdout, stderr, random, and tty.
89 Additionally, terminal databases are needed for screen oriented
90 applications. For file transfer sessions using sftp with the SSH
91 protocol version 2, no additional configuration of the environment
92 is necessary if the in-process sftp server is used. See Subsystem
93 for details.
94
95 The default is not to chroot(2).
96
97
98 Ciphers
99 Specifies the ciphers allowed for protocol version 2. Cipher
100 ordering on the server side is not relevant. Multiple ciphers must
101 be comma separated.
102
103 Valid ciphers are: aes128-ctr, aes192-ctr, aes256-ctr, aes128-cbc,
104 aes192-cbc, aes256-cbc, arcfour, arcfour128, arcfour256, 3des-cbc,
105 and blowfish-cbc.
106
107 The default cipher list is:
108
109 aes128-ctr,aes192-ctr,aes256-ctr,arcfour128,
110 arcfour256,arcfour
111
112
113 Using CBC modes on the server side is not recommended due to
114 potential security issues in connection with the SSH protocol
115 version 2.
116
117
118 ClientAliveCountMax
119 Sets the number of client alive messages, (see
120 ClientAliveInterval), that can be sent without sshd receiving any
121 messages back from the client. If this threshold is reached while
122 client alive messages are being sent, sshd disconnects the client,
123 terminating the session. The use of client alive messages is very
124 different from TCPKeepAlive. The client alive messages are sent
125 through the encrypted channel and therefore are not spoofable. The
126 TCP keepalive option enabled by TCPKeepAlive is spoofable. The
127 client alive mechanism is valuable when a client or server depend
128 on knowing when a connection has become inactive.
129
130 The default value is 3. If ClientAliveInterval is set to 15, and
131 ClientAliveCountMax is left at the default, unresponsive ssh
132 clients are disconnected after approximately 45 seconds.
133
134
135 ClientAliveInterval
136 Sets a timeout interval in seconds after which, if no data has been
137 received from the client, sshd sends a message through the
138 encrypted channel to request a response from the client. The
139 default is 0, indicating that these messages are not sent to the
140 client. This option applies only to protocol version 2.
141
142
143 Compression
144 Controls whether the server allows the client to negotiate the use
145 of compression. The default is yes.
146
147
148 DenyGroups
149 Can be followed by a number of group names, separated by spaces.
150 Users whose primary group matches one of the patterns are not
151 allowed to log in. Asterisk (*) and question mark (?) can be used
152 as wildcards in the patterns. Only group names are valid; a
153 numerical group ID is not recognized. By default, login is allowed
154 regardless of the primary group.
155
156
157 DenyUsers
158 Can be followed by a number of user names, separated by spaces.
159 Login is disallowed for user names that match one of the patterns.
160 Asterisk (*) and question mark (?) can be used as wildcards in the
161 patterns. Only user names are valid; a numerical user ID is not
162 recognized. By default, login is allowed regardless of the user
163 name.
164
165 If a specified pattern takes the form user@host then user and host
166 are checked separately, disallowing logins to particular users from
167 particular hosts.
168
169
170 GatewayPorts
171 Specifies whether remote hosts are allowed to connect to ports
172 forwarded for the client. By default, sshd binds remote port
173 forwardings to the loopback address. This prevents other remote
174 hosts from connecting to forwarded ports. GatewayPorts can be used
175 to specify that sshd should bind remote port forwardings to the
176 wildcard address, thus allowing remote hosts to connect to
177 forwarded ports.
178
179 The argument can be no to force remote port forwardings to be
180 available to the local host only, yes to force remote port
181 forwardings to bind to the wildcard address, or clientspecified to
182 allow the client to select the address to which the forwarding is
183 bound. The default is no. See also RemoteForward in ssh_config(4).
184
185
186 GSSAPIAuthentication
187 Enables/disables GSS-API user authentication. The default is yes.
188
189 Currently sshd authorizes client user principals to user accounts
190 as follows: if the principal name matches the requested user
191 account, then the principal is authorized. Otherwise, GSS-API
192 authentication fails.
193
194
195 GSSAPIKeyExchange
196 Enables/disables GSS-API-authenticated key exchanges. The default
197 is yes.
198
199 This option also enables the use of the GSS-API to authenticate the
200 user to server after the key exchange. GSS-API key exchange can
201 succeed but the subsequent authentication using the GSS-API fail if
202 the server does not authorize the user's GSS principal name to the
203 target user account.
204
205 Currently sshd authorizes client user principals to user accounts
206 as follows: if the principal name matches the requested user
207 account, then the principal is authorized. Otherwise, GSS-API
208 authentication fails.
209
210
211 GSSAPIStoreDelegatedCredentials
212 Enables/disables the use of delegated GSS-API credentials on the
213 server-side. The default is yes.
214
215 Specifically, this option, when enabled, causes the server to store
216 delegated GSS-API credentials in the user's default GSS-API
217 credential store (which for the Kerberos V mechanism means
218 /tmp/krb5cc_<uid>).
219
220 Note -
221
222 sshd does not take any steps to explicitly destroy stored
223 delegated GSS-API credentials upon logout. It is the
224 responsibility of PAM modules to destroy credentials associated
225 with a session.
226
227
228 HostbasedAuthentication
229 Specifies whether to try rhosts-based authentication with public
230 key authentication. The argument must be yes or no. The default is
231 no. This option applies to protocol version 2 only and is similar
232 to RhostsRSAAuthentication. See sshd(1M) for guidelines on setting
233 up host-based authentication.
234
235
236 HostbasedUsesNameFromPacketOnly
237 Controls which hostname is searched for in the files ~/.shosts,
238 /etc/shosts.equiv, and /etc/hosts.equiv. If this parameter is set
239 to yes, the server uses the name the client claimed for itself and
240 signed with that host's key. If set to no, the default, the server
241 uses the name to which the client's IP address resolves.
242
243 Setting this parameter to no disables host-based authentication
244 when using NAT or when the client gets to the server indirectly
245 through a port-forwarding firewall.
246
247
248 HostKey
249 Specifies the file containing the private host key used by SSH. The
250 default is /etc/ssh/ssh_host_key for protocol version 1, and
251 /etc/ssh/ssh_host_rsa_key and /etc/ssh/ssh_host_dsa_key for
252 protocol version 2. sshd refuses to use a file if it is
253 group/world-accessible. It is possible to have multiple host key
254 files. rsa1 keys are used for version 1 and dsa or rsa are used
255 for version 2 of the SSH protocol.
256
257
258 IgnoreRhosts
259 Specifies that .rhosts and .shosts files are not used in
260 authentication. /etc/hosts.equiv and /etc/shosts.equiv are still
261 used. The default is yes. This parameter applies to both protocol
262 versions 1 and 2.
263
264
265 IgnoreUserKnownHosts
266 Specifies whether sshd should ignore the user's
267 $HOME/.ssh/known_hosts during RhostsRSAAuthentication. The default
268 is no. This parameter applies to both protocol versions 1 and 2.
269
270
271 KbdInteractiveAuthentication
272 Specifies whether authentication by means of the "keyboard-
273 interactive" authentication method (and PAM) is allowed. Defaults
274 to yes. (Deprecated: this parameter can only be set to yes.)
275
276
277 TCPKeepAlive
278 Specifies whether the system should send keepalive messages to the
279 other side. If they are sent, death of the connection or crash of
280 one of the machines is properly noticed. However, this means that
281 connections die if the route is down temporarily, which can be an
282 annoyance. On the other hand, if keepalives are not sent, sessions
283 can hang indefinitely on the server, leaving ghost users and
284 consuming server resources.
285
286 The default is yes (to send keepalives), and the server notices if
287 the network goes down or the client host reboots. This avoids
288 infinitely hanging sessions.
289
290 To disable keepalives, the value should be set to no in both the
291 server and the client configuration files.
292
293
294 KeyRegenerationInterval
295 In protocol version 1, the ephemeral server key is automatically
296 regenerated after this many seconds (if it has been used). The
297 purpose of regeneration is to prevent decrypting captured sessions
298 by later breaking into the machine and stealing the keys. The key
299 is never stored anywhere. If the value is 0, the key is never
300 regenerated. The default is 3600 (seconds).
301
302
303 ListenAddress
304 Specifies what local address sshd should listen on. The following
305 forms can be used:
306
307 ListenAddress host|IPv4_addr|IPv6_addr
308 ListenAddress host|IPv4_addr:port
309 ListenAddress [host|IPv6_addr]:port
310
311 If port is not specified, sshd listens on the address and all prior
312 Port options specified. The default is to listen on all local
313 addresses. Multiple ListenAddress options are permitted.
314 Additionally, any Port options must precede this option for non-
315 port qualified addresses.
316
317 The default is to listen on all local addresses. Multiple options
318 of this type are permitted. Additionally, the Ports options must
319 precede this option.
320
321
322 LoginGraceTime
323 The server disconnects after this time (in seconds) if the user has
324 not successfully logged in. If the value is 0, there is no time
325 limit. The default is 120 (seconds).
326
327
328 LogLevel
329 Gives the verbosity level that is used when logging messages from
330 sshd. The possible values are: QUIET, FATAL, ERROR, INFO, VERBOSE,
331 DEBUG, DEBUG1, DEBUG2, and DEBUG3. The default is INFO. DEBUG2 and
332 DEBUG3 each specify higher levels of debugging output. Logging with
333 level DEBUG violates the privacy of users and is not recommended.
334
335
336 LookupClientHostnames
337 Specifies whether or not to lookup the names of client's addresses.
338 Defaults to yes.
339
340
341 MACs
342 Specifies the available MAC (message authentication code)
343 algorithms. The MAC algorithm is used in protocol version 2 for
344 data integrity protection. Multiple algorithms must be comma-
345 separated. The default is hmac-md5,hmac-sha1,hmac-sha1-96,hmac-
346 md5-96.
347
348
349 MaxStartups
350 Specifies the maximum number of concurrent unauthenticated
351 connections to the sshd daemon. Additional connections are dropped
352 until authentication succeeds or the LoginGraceTime expires for a
353 connection. The default is 10.
354
355 Alternatively, random early drop can be enabled by specifying the
356 three colon-separated values start:rate:full (for example,
357 10:30:60). Referring to this example, sshd refuse connection
358 attempts with a probability of rate/100 (30% in our example) if
359 there are currently 10 (from the start field) unauthenticated
360 connections. The probability increases linearly and all connection
361 attempts are refused if the number of unauthenticated connections
362 reaches full (60 in our example).
363
364
365 PasswordAuthentication
366 Specifies whether password authentication is allowed. The default
367 is yes. This option applies to both protocol versions 1 and 2.
368
369
370 PermitEmptyPasswords
371 When password or keyboard-interactive authentication is allowed, it
372 specifies whether the server allows login to accounts with empty
373 password strings.
374
375 If not set then the /etc/default/login PASSREQ value is used
376 instead.
377
378 PASSREQ=no is equivalent to PermitEmptyPasswords yes. PASSREQ=yes
379 is equivalent to PermitEmptyPasswords no. If neither
380 PermitEmptyPasswords or PASSREQ are set the default is no.
381
382
383 PermitRootLogin
384 Specifies whether the root can log in using ssh(1). The argument
385 must be yes, without-password, forced-commands-only, or no.
386 without-password means that root cannot be authenticated using the
387 "password" or "keyboard-interactive" methods (see description of
388 KbdInteractiveAuthentication). forced-commands-only means that
389 authentication is allowed only for publickey (for SSHv2, or RSA,
390 for SSHv1) and only if the matching authorized_keys entry for root
391 has a command=<cmd> option.
392
393 In Solaris, the default /etc/ssh/sshd_config file is shipped with
394 PermitRootLogin set to no. If unset by the administrator, then
395 CONSOLE parameter from /etc/default/login supplies the default
396 value as follows: if the CONSOLE parameter is not commented out (it
397 can even be empty, that is, "CONSOLE="), then without-password is
398 used as default value. If CONSOLE is commented out, then the
399 default for PermitRootLogin is yes.
400
401 The without-password and forced-commands-only settings are useful
402 for, for example, performing remote administration and backups
403 using trusted public keys for authentication of the remote client,
404 without allowing access to the root account using passwords.
405
406
407 PermitUserEnvironment
408 Specifies whether a user's ~/.ssh/environment on the server side
409 and environment options in the AuthorizedKeysFile file are
410 processed by sshd. The default is no. Enabling environment
411 processing can enable users to bypass access restrictions in some
412 configurations using mechanisms such as LD_PRELOAD.
413
414 Environment setting from a relevant entry in AuthorizedKeysFile
415 file is processed only if the user was authenticated using the
416 public key authentication method. Of the two files used, values of
417 variables set in ~/.ssh/environment are of higher priority.
418
419
420 PidFile
421 Allows you to specify an alternative to /var/run/sshd.pid, the
422 default file for storing the PID of the sshd listening for
423 connections. See sshd(1M).
424
425
426 Port
427 Specifies the port number that sshd listens on. The default is 22.
428 Multiple options of this type are permitted. See also
429 ListenAddress.
430
431
432 PrintLastLog
433 Specifies whether sshd should display the date and time when the
434 user last logged in. The default is yes.
435
436
437 PrintMotd
438 Specifies whether sshd should display the contents of /etc/motd
439 when a user logs in interactively. (On some systems it is also
440 displayed by the shell or a shell startup file, such as
441 /etc/profile.) The default is yes.
442
443
444 Protocol
445 Specifies the protocol versions sshd should support in order of
446 preference. The possible values are 1 and 2. Multiple versions must
447 be comma-separated. The default is 2,1. This means that ssh tries
448 version 2 and falls back to version 1 if version 2 is not
449 available.
450
451
452 PubkeyAuthentication
453 Specifies whether public key authentication is allowed. The default
454 is yes. This option applies to protocol version 2 only.
455
456
457 RhostsAuthentication
458 Specifies whether authentication using rhosts or /etc/hosts.equiv
459 files is sufficient. Normally, this method should not be permitted
460 because it is insecure. RhostsRSAAuthentication should be used
461 instead, because it performs RSA-based host authentication in
462 addition to normal rhosts or /etc/hosts.equiv authentication. The
463 default is no. This parameter applies only to protocol version 1.
464
465
466 RhostsRSAAuthentication
467 Specifies whether rhosts or /etc/hosts.equiv authentication
468 together with successful RSA host authentication is allowed. The
469 default is no. This parameter applies only to protocol version 1.
470
471
472 RSAAuthentication
473 Specifies whether pure RSA authentication is allowed. The default
474 is yes. This option applies to protocol version 1 only.
475
476
477 ServerKeyBits
478 Defines the number of bits in the ephemeral protocol version 1
479 server key. The minimum value is 512, and the default is 768.
480
481
482 StrictModes
483 Specifies whether sshd should check file modes and ownership of the
484 user's files and home directory before accepting login. This is
485 normally desirable because novices sometimes accidentally leave
486 their directory or files world-writable. The default is yes.
487
488
489 Subsystem
490 Configures an external subsystem (for example, a file transfer
491 daemon). Arguments should be a subsystem name and a command to
492 execute upon subsystem request. The command sftp-server(1M)
493 implements the sftp file transfer subsystem.
494
495 Alternately, the name internal-sftp implements an in-process sftp
496 server. This can simplify configurations using ChrootDirectory to
497 force a different filesystem root on clients.
498
499 By default, no subsystems are defined. This option applies to
500 protocol version 2 only.
501
502
503 SyslogFacility
504 Gives the facility code that is used when logging messages from
505 sshd. The possible values are: DAEMON, USER, AUTH, LOCAL0, LOCAL1,
506 LOCAL2, LOCAL3, LOCAL4, LOCAL5, LOCAL6, and LOCAL7. The default is
507 AUTH.
508
509
510 UseOpenSSLEngine
511 Specifies whether sshd should use the OpenSSL PKCS#11 engine for
512 offloading cryptographic operations to the Cryptographic Framework.
513 Cryptographic operations are accelerated according to the available
514 installed plug-ins. When no suitable plug-ins are present this
515 option does not have an effect. The default is yes.
516
517
518 VerifyReverseMapping
519 Specifies whether sshd should try to verify the remote host name
520 and check that the resolved host name for the remote IP address
521 maps back to the very same IP address. (A yes setting means
522 "verify".) Setting this parameter to no can be useful where DNS
523 servers might be down and thus cause sshd to spend much time trying
524 to resolve the client's IP address to a name. This feature is
525 useful for Internet-facing servers. The default is no.
526
527
528 X11DisplayOffset
529 Specifies the first display number available for sshd's X11
530 forwarding. This prevents sshd from interfering with real X11
531 servers. The default is 10.
532
533
534 X11Forwarding
535 Specifies whether X11 forwarding is permitted. The default is yes.
536 Disabling X11 forwarding does not improve security in any way, as
537 users can always install their own forwarders.
538
539 When X11 forwarding is enabled, there can be additional exposure to
540 the server and to client displays if the sshd proxy display is
541 configured to listen on the wildcard address (see X11UseLocalhost).
542 However, this is not the default. Additionally, the authentication
543 spoofing and authentication data verification and substitution
544 occur on the client side. The security risk of using X11 forwarding
545 is that the client's X11 display server can be exposed to attack
546 when the ssh client requests forwarding (see the warnings for
547 ForwardX11 in ssh_config(4)). A system administrator who wants to
548 protect clients that expose themselves to attack by unwittingly
549 requesting X11 forwarding, should specify a no setting.
550
551 Disabling X11 forwarding does not prevent users from forwarding X11
552 traffic, as users can always install their own forwarders.
553
554
555 X11UseLocalhost
556 Specifies whether sshd should bind the X11 forwarding server to the
557 loopback address or to the wildcard address. By default, sshd binds
558 the forwarding server to the loopback address and sets the hostname
559 part of the DISPLAY environment variable to localhost. This
560 prevents remote hosts from connecting to the proxy display.
561 However, some older X11 clients might not function with this
562 configuration. X11UseLocalhost can be set to no to specify that the
563 forwarding server should be bound to the wildcard address. The
564 argument must be yes or no. The default is yes.
565
566
567 XAuthLocation
568 Specifies the location of the xauth(1) program. The default is
569 /usr/X11/bin/xauth and sshd attempts to open it when X11 forwarding
570 is enabled.
571
572
573 Time Formats
574 sshd command-line arguments and configuration file options that specify
575 time can be expressed using a sequence of the form: time[qualifier,]
576 where time is a positive integer value and qualifier is one of the
577 following:
578
579 <none>
580 seconds
581
582
583 s | S
584 seconds
585
586
587 m | M
588 minutes
589
590
591 h | H
592 hours
593
594
595 d | D
596 days
597
598
599 w |
600 weeks
601
602
603
604 Each element of the sequence is added together to calculate the total
605 time value. For example:
606
607 600
608 600 seconds (10 minutes)
609
610
611 10m
612 10 minutes
613
614
615 1h30m
616 1 hour, 30 minutes (90 minutes)
617
618
619 FILES
620 /etc/ssh/sshd_config
621 Contains configuration data for sshd. This file
622 should be writable by root only, but it is
623 recommended (though not necessary) that it be
624 world-readable.
625
626
627 ATTRIBUTES
628 See attributes(5) for descriptions of the following attributes:
629
630
631
632
633 +--------------------+-----------------+
634 | ATTRIBUTE TYPE | ATTRIBUTE VALUE |
635 +--------------------+-----------------+
636 |Interface Stability | Uncommitted |
637 +--------------------+-----------------+
638
639 SEE ALSO
640 login(1), sshd(1M), chroot(2), ssh_config(4), attributes(5),
641 kerberos(5)
642
643 AUTHORS
644 OpenSSH is a derivative of the original and free ssh 1.2.12 release by
645 Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos,
646 Theo de Raadt, and Dug Song removed many bugs, re-added recent
647 features, and created OpenSSH. Markus Friedl contributed the support
648 for SSH protocol versions 1.5 and 2.0. Niels Provos and Markus Friedl
649 contributed support for privilege separation.
650
651
652
653 January 17, 2013 SSHD_CONFIG(4)
--- EOF ---