1SSHD(8) BSD System Manager's Manual SSHD(8)
2
4 sshd — OpenSSH daemon
5
7 sshd [-46DdeiqTt] [-C connection_spec] [-c host_certificate_file]
8 [-E log_file] [-f config_file] [-g login_grace_time]
9 [-h host_key_file] [-o option] [-p port] [-u len]
10
12 sshd (OpenSSH Daemon) is the daemon program for ssh(1). Together these
13 programs replace rlogin and rsh, and provide secure encrypted communica‐
14 tions between two untrusted hosts over an insecure network.
15
16 sshd listens for connections from clients. It is normally started at
17 boot from /etc/rc. It forks a new daemon for each incoming connection.
18 The forked daemons handle key exchange, encryption, authentication, com‐
19 mand execution, and data exchange.
20
21 sshd can be configured using command-line options or a configuration file
22 (by default sshd_config(5)); command-line options override values speci‐
23 fied in the configuration file. sshd rereads its configuration file when
24 it receives a hangup signal, SIGHUP, by executing itself with the name
25 and options it was started with, e.g. /usr/sbin/sshd.
26
27 The options are as follows:
28
29 -4 Forces sshd to use IPv4 addresses only.
30
31 -6 Forces sshd to use IPv6 addresses only.
32
33 -C connection_spec
34 Specify the connection parameters to use for the -T extended test
35 mode. If provided, any Match directives in the configuration
36 file that would apply are applied before the configuration is
37 written to standard output. The connection parameters are sup‐
38 plied as keyword=value pairs and may be supplied in any order,
39 either with multiple -C options or as a comma-separated list.
40 The keywords are “addr,” “user”, “host”, “laddr”, “lport”, and
41 “rdomain” and correspond to source address, user, resolved source
42 host name, local address, local port number and routing domain
43 respectively.
44
45 -c host_certificate_file
46 Specifies a path to a certificate file to identify sshd during
47 key exchange. The certificate file must match a host key file
48 specified using the -h option or the HostKey configuration direc‐
49 tive.
50
51 -D When this option is specified, sshd will not detach and does not
52 become a daemon. This allows easy monitoring of sshd.
53
54 -d Debug mode. The server sends verbose debug output to standard
55 error, and does not put itself in the background. The server
56 also will not fork and will only process one connection. This
57 option is only intended for debugging for the server. Multiple
58 -d options increase the debugging level. Maximum is 3.
59
60 -E log_file
61 Append debug logs to log_file instead of the system log.
62
63 -e Write debug logs to standard error instead of the system log.
64
65 -f config_file
66 Specifies the name of the configuration file. The default is
67 /etc/ssh/sshd_config. sshd refuses to start if there is no con‐
68 figuration file.
69
70 -g login_grace_time
71 Gives the grace time for clients to authenticate themselves
72 (default 120 seconds). If the client fails to authenticate the
73 user within this many seconds, the server disconnects and exits.
74 A value of zero indicates no limit.
75
76 -h host_key_file
77 Specifies a file from which a host key is read. This option must
78 be given if sshd is not run as root (as the normal host key files
79 are normally not readable by anyone but root). The default is
80 /etc/ssh/ssh_host_ecdsa_key, /etc/ssh/ssh_host_ed25519_key and
81 /etc/ssh/ssh_host_rsa_key. It is possible to have multiple host
82 key files for the different host key algorithms.
83
84 -i Specifies that sshd is being run from inetd(8).
85
86 -o option
87 Can be used to give options in the format used in the configura‐
88 tion file. This is useful for specifying options for which there
89 is no separate command-line flag. For full details of the
90 options, and their values, see sshd_config(5).
91
92 -p port
93 Specifies the port on which the server listens for connections
94 (default 22). Multiple port options are permitted. Ports speci‐
95 fied in the configuration file with the Port option are ignored
96 when a command-line port is specified. Ports specified using the
97 ListenAddress option override command-line ports.
98
99 -q Quiet mode. Nothing is sent to the system log. Normally the
100 beginning, authentication, and termination of each connection is
101 logged.
102
103 -T Extended test mode. Check the validity of the configuration
104 file, output the effective configuration to stdout and then exit.
105 Optionally, Match rules may be applied by specifying the connec‐
106 tion parameters using one or more -C options.
107
108 -t Test mode. Only check the validity of the configuration file and
109 sanity of the keys. This is useful for updating sshd reliably as
110 configuration options may change.
111
112 -u len This option is used to specify the size of the field in the utmp
113 structure that holds the remote host name. If the resolved host
114 name is longer than len, the dotted decimal value will be used
115 instead. This allows hosts with very long host names that over‐
116 flow this field to still be uniquely identified. Specifying -u0
117 indicates that only dotted decimal addresses should be put into
118 the utmp file. -u0 may also be used to prevent sshd from making
119 DNS requests unless the authentication mechanism or configuration
120 requires it. Authentication mechanisms that may require DNS
121 include HostbasedAuthentication and using a from="pattern-list"
122 option in a key file. Configuration options that require DNS
123 include using a USER@HOST pattern in AllowUsers or DenyUsers.
124
126 The OpenSSH SSH daemon supports SSH protocol 2 only. Each host has a
127 host-specific key, used to identify the host. Whenever a client con‐
128 nects, the daemon responds with its public host key. The client compares
129 the host key against its own database to verify that it has not changed.
130 Forward secrecy is provided through a Diffie-Hellman key agreement. This
131 key agreement results in a shared session key. The rest of the session
132 is encrypted using a symmetric cipher. The client selects the encryption
133 algorithm to use from those offered by the server. Additionally, session
134 integrity is provided through a cryptographic message authentication code
135 (MAC).
136
137 Finally, the server and the client enter an authentication dialog. The
138 client tries to authenticate itself using host-based authentication, pub‐
139 lic key authentication, GSSAPI authentication, challenge-response authen‐
140 tication, or password authentication.
141
142 Regardless of the authentication type, the account is checked to ensure
143 that it is accessible. An account is not accessible if it is locked,
144 listed in DenyUsers or its group is listed in DenyGroups . The defini‐
145 tion of a locked account is system dependent. Some platforms have their
146 own account database (eg AIX) and some modify the passwd field ( ‘*LK*’
147 on Solaris and UnixWare, ‘*’ on HP-UX, containing ‘Nologin’ on Tru64, a
148 leading ‘*LOCKED*’ on FreeBSD and a leading ‘!’ on most Linuxes). If
149 there is a requirement to disable password authentication for the account
150 while allowing still public-key, then the passwd field should be set to
151 something other than these values (eg ‘NP’ or ‘*NP*’ ).
152
153 If the client successfully authenticates itself, a dialog for preparing
154 the session is entered. At this time the client may request things like
155 allocating a pseudo-tty, forwarding X11 connections, forwarding TCP con‐
156 nections, or forwarding the authentication agent connection over the
157 secure channel.
158
159 After this, the client either requests a shell or execution of a command.
160 The sides then enter session mode. In this mode, either side may send
161 data at any time, and such data is forwarded to/from the shell or command
162 on the server side, and the user terminal in the client side.
163
164 When the user program terminates and all forwarded X11 and other connec‐
165 tions have been closed, the server sends command exit status to the
166 client, and both sides exit.
167
169 When a user successfully logs in, sshd does the following:
170
171 1. If the login is on a tty, and no command has been specified,
172 prints last login time and /etc/motd (unless prevented in the
173 configuration file or by ~/.hushlogin; see the FILES section).
174
175 2. If the login is on a tty, records login time.
176
177 3. Checks /etc/nologin; if it exists, prints contents and quits
178 (unless root).
179
180 4. Changes to run with normal user privileges.
181
182 5. Sets up basic environment.
183
184 6. Reads the file ~/.ssh/environment, if it exists, and users are
185 allowed to change their environment. See the
186 PermitUserEnvironment option in sshd_config(5).
187
188 7. Changes to user's home directory.
189
190 8. If ~/.ssh/rc exists and the sshd_config(5) PermitUserRC option
191 is set, runs it; else if /etc/ssh/sshrc exists, runs it; oth‐
192 erwise runs xauth. The “rc” files are given the X11 authenti‐
193 cation protocol and cookie in standard input. See SSHRC,
194 below.
195
196 9. Runs user's shell or command. All commands are run under the
197 user's login shell as specified in the system password data‐
198 base.
199
201 If the file ~/.ssh/rc exists, sh(1) runs it after reading the environment
202 files but before starting the user's shell or command. It must not pro‐
203 duce any output on stdout; stderr must be used instead. If X11 forward‐
204 ing is in use, it will receive the "proto cookie" pair in its standard
205 input (and DISPLAY in its environment). The script must call xauth(1)
206 because sshd will not run xauth automatically to add X11 cookies.
207
208 The primary purpose of this file is to run any initialization routines
209 which may be needed before the user's home directory becomes accessible;
210 AFS is a particular example of such an environment.
211
212 This file will probably contain some initialization code followed by
213 something similar to:
214
215 if read proto cookie && [ -n "$DISPLAY" ]; then
216 if [ `echo $DISPLAY | cut -c1-10` = 'localhost:' ]; then
217 # X11UseLocalhost=yes
218 echo add unix:`echo $DISPLAY |
219 cut -c11-` $proto $cookie
220 else
221 # X11UseLocalhost=no
222 echo add $DISPLAY $proto $cookie
223 fi | xauth -q -
224 fi
225
226 If this file does not exist, /etc/ssh/sshrc is run, and if that does not
227 exist either, xauth is used to add the cookie.
228
230 AuthorizedKeysFile specifies the files containing public keys for public
231 key authentication; if this option is not specified, the default is
232 ~/.ssh/authorized_keys and ~/.ssh/authorized_keys2. Each line of the
233 file contains one key (empty lines and lines starting with a ‘#’ are
234 ignored as comments). Public keys consist of the following space-sepa‐
235 rated fields: options, keytype, base64-encoded key, comment. The options
236 field is optional. The supported key types are:
237
238 sk-ecdsa-sha2-nistp256@openssh.com
239 ecdsa-sha2-nistp256
240 ecdsa-sha2-nistp384
241 ecdsa-sha2-nistp521
242 sk-ssh-ed25519@openssh.com
243 ssh-ed25519
244 ssh-dss
245 ssh-rsa
246
247 The comment field is not used for anything (but may be convenient for the
248 user to identify the key).
249
250 Note that lines in this file can be several hundred bytes long (because
251 of the size of the public key encoding) up to a limit of 8 kilobytes,
252 which permits RSA keys up to 16 kilobits. You don't want to type them
253 in; instead, copy the id_dsa.pub, id_ecdsa.pub, id_ecdsa_sk.pub,
254 id_ed25519.pub, id_ed25519_sk.pub, or the id_rsa.pub file and edit it.
255
256 sshd enforces a minimum RSA key modulus size of 1024 bits.
257
258 The options (if present) consist of comma-separated option specifica‐
259 tions. No spaces are permitted, except within double quotes. The fol‐
260 lowing option specifications are supported (note that option keywords are
261 case-insensitive):
262
263 agent-forwarding
264 Enable authentication agent forwarding previously disabled by the
265 restrict option.
266
267 cert-authority
268 Specifies that the listed key is a certification authority (CA)
269 that is trusted to validate signed certificates for user authen‐
270 tication.
271
272 Certificates may encode access restrictions similar to these key
273 options. If both certificate restrictions and key options are
274 present, the most restrictive union of the two is applied.
275
276 command="command"
277 Specifies that the command is executed whenever this key is used
278 for authentication. The command supplied by the user (if any) is
279 ignored. The command is run on a pty if the client requests a
280 pty; otherwise it is run without a tty. If an 8-bit clean chan‐
281 nel is required, one must not request a pty or should specify
282 no-pty. A quote may be included in the command by quoting it
283 with a backslash.
284
285 This option might be useful to restrict certain public keys to
286 perform just a specific operation. An example might be a key
287 that permits remote backups but nothing else. Note that the
288 client may specify TCP and/or X11 forwarding unless they are
289 explicitly prohibited, e.g. using the restrict key option.
290
291 The command originally supplied by the client is available in the
292 SSH_ORIGINAL_COMMAND environment variable. Note that this option
293 applies to shell, command or subsystem execution. Also note that
294 this command may be superseded by a sshd_config(5) ForceCommand
295 directive.
296
297 If a command is specified and a forced-command is embedded in a
298 certificate used for authentication, then the certificate will be
299 accepted only if the two commands are identical.
300
301 environment="NAME=value"
302 Specifies that the string is to be added to the environment when
303 logging in using this key. Environment variables set this way
304 override other default environment values. Multiple options of
305 this type are permitted. Environment processing is disabled by
306 default and is controlled via the PermitUserEnvironment option.
307
308 expiry-time="timespec"
309 Specifies a time after which the key will not be accepted. The
310 time may be specified as a YYYYMMDD date or a YYYYMMDDHHMM[SS]
311 time in the system time-zone.
312
313 from="pattern-list"
314 Specifies that in addition to public key authentication, either
315 the canonical name of the remote host or its IP address must be
316 present in the comma-separated list of patterns. See PATTERNS in
317 ssh_config(5) for more information on patterns.
318
319 In addition to the wildcard matching that may be applied to host‐
320 names or addresses, a from stanza may match IP addresses using
321 CIDR address/masklen notation.
322
323 The purpose of this option is to optionally increase security:
324 public key authentication by itself does not trust the network or
325 name servers or anything (but the key); however, if somebody
326 somehow steals the key, the key permits an intruder to log in
327 from anywhere in the world. This additional option makes using a
328 stolen key more difficult (name servers and/or routers would have
329 to be compromised in addition to just the key).
330
331 no-agent-forwarding
332 Forbids authentication agent forwarding when this key is used for
333 authentication.
334
335 no-port-forwarding
336 Forbids TCP forwarding when this key is used for authentication.
337 Any port forward requests by the client will return an error.
338 This might be used, e.g. in connection with the command option.
339
340 no-pty Prevents tty allocation (a request to allocate a pty will fail).
341
342 no-user-rc
343 Disables execution of ~/.ssh/rc.
344
345 no-X11-forwarding
346 Forbids X11 forwarding when this key is used for authentication.
347 Any X11 forward requests by the client will return an error.
348
349 permitlisten="[host:]port"
350 Limit remote port forwarding with the ssh(1) -R option such that
351 it may only listen on the specified host (optional) and port.
352 IPv6 addresses can be specified by enclosing the address in
353 square brackets. Multiple permitlisten options may be applied
354 separated by commas. Hostnames may include wildcards as
355 described in the PATTERNS section in ssh_config(5). A port spec‐
356 ification of * matches any port. Note that the setting of
357 GatewayPorts may further restrict listen addresses. Note that
358 ssh(1) will send a hostname of “localhost” if a listen host was
359 not specified when the forwarding was requested, and that this
360 name is treated differently to the explicit localhost addresses
361 “127.0.0.1” and “::1”.
362
363 permitopen="host:port"
364 Limit local port forwarding with the ssh(1) -L option such that
365 it may only connect to the specified host and port. IPv6
366 addresses can be specified by enclosing the address in square
367 brackets. Multiple permitopen options may be applied separated
368 by commas. No pattern matching or name lookup is performed on
369 the specified hostnames, they must be literal host names and/or
370 addresses. A port specification of * matches any port.
371
372 port-forwarding
373 Enable port forwarding previously disabled by the restrict
374 option.
375
376 principals="principals"
377 On a cert-authority line, specifies allowed principals for cer‐
378 tificate authentication as a comma-separated list. At least one
379 name from the list must appear in the certificate's list of prin‐
380 cipals for the certificate to be accepted. This option is
381 ignored for keys that are not marked as trusted certificate sign‐
382 ers using the cert-authority option.
383
384 pty Permits tty allocation previously disabled by the restrict
385 option.
386
387 no-touch-required
388 Do not require demonstration of user presence for signatures made
389 using this key. This option only makes sense for the FIDO
390 authenticator algorithms ecdsa-sk and ed25519-sk.
391
392 verify-required
393 Require that signatures made using this key attest that they ver‐
394 ified the user, e.g. via a PIN. This option only makes sense for
395 the FIDO authenticator algorithms ecdsa-sk and ed25519-sk.
396
397 restrict
398 Enable all restrictions, i.e. disable port, agent and X11 for‐
399 warding, as well as disabling PTY allocation and execution of
400 ~/.ssh/rc. If any future restriction capabilities are added to
401 authorized_keys files they will be included in this set.
402
403 tunnel="n"
404 Force a tun(4) device on the server. Without this option, the
405 next available device will be used if the client requests a tun‐
406 nel.
407
408 user-rc
409 Enables execution of ~/.ssh/rc previously disabled by the
410 restrict option.
411
412 X11-forwarding
413 Permits X11 forwarding previously disabled by the restrict
414 option.
415
416 An example authorized_keys file:
417
418 # Comments allowed at start of line
419 ssh-rsa AAAAB3Nza...LiPk== user@example.net
420 from="*.sales.example.net,!pc.sales.example.net" ssh-rsa
421 AAAAB2...19Q== john@example.net
422 command="dump /home",no-pty,no-port-forwarding ssh-rsa
423 AAAAC3...51R== example.net
424 permitopen="192.0.2.1:80",permitopen="192.0.2.2:25" ssh-rsa
425 AAAAB5...21S==
426 permitlisten="localhost:8080",permitopen="localhost:22000" ssh-rsa
427 AAAAB5...21S==
428 tunnel="0",command="sh /etc/netstart tun0" ssh-rsa AAAA...==
429 jane@example.net
430 restrict,command="uptime" ssh-rsa AAAA1C8...32Tv==
431 user@example.net
432 restrict,pty,command="nethack" ssh-rsa AAAA1f8...IrrC5==
433 user@example.net
434 no-touch-required sk-ecdsa-sha2-nistp256@openssh.com AAAAInN...Ko==
435 user@example.net
436
438 The /etc/ssh/ssh_known_hosts and ~/.ssh/known_hosts files contain host
439 public keys for all known hosts. The global file should be prepared by
440 the administrator (optional), and the per-user file is maintained auto‐
441 matically: whenever the user connects to an unknown host, its key is
442 added to the per-user file.
443
444 Each line in these files contains the following fields: markers
445 (optional), hostnames, keytype, base64-encoded key, comment. The fields
446 are separated by spaces.
447
448 The marker is optional, but if it is present then it must be one of
449 “@cert-authority”, to indicate that the line contains a certification
450 authority (CA) key, or “@revoked”, to indicate that the key contained on
451 the line is revoked and must not ever be accepted. Only one marker
452 should be used on a key line.
453
454 Hostnames is a comma-separated list of patterns (‘*’ and ‘?’ act as wild‐
455 cards); each pattern in turn is matched against the host name. When sshd
456 is authenticating a client, such as when using HostbasedAuthentication,
457 this will be the canonical client host name. When ssh(1) is authenticat‐
458 ing a server, this will be the host name given by the user, the value of
459 the ssh(1) HostkeyAlias if it was specified, or the canonical server
460 hostname if the ssh(1) CanonicalizeHostname option was used.
461
462 A pattern may also be preceded by ‘!’ to indicate negation: if the host
463 name matches a negated pattern, it is not accepted (by that line) even if
464 it matched another pattern on the line. A hostname or address may
465 optionally be enclosed within ‘[’ and ‘]’ brackets then followed by ‘:’
466 and a non-standard port number.
467
468 Alternately, hostnames may be stored in a hashed form which hides host
469 names and addresses should the file's contents be disclosed. Hashed
470 hostnames start with a ‘|’ character. Only one hashed hostname may
471 appear on a single line and none of the above negation or wildcard opera‐
472 tors may be applied.
473
474 The keytype and base64-encoded key are taken directly from the host key;
475 they can be obtained, for example, from /etc/ssh/ssh_host_rsa_key.pub.
476 The optional comment field continues to the end of the line, and is not
477 used.
478
479 Lines starting with ‘#’ and empty lines are ignored as comments.
480
481 When performing host authentication, authentication is accepted if any
482 matching line has the proper key; either one that matches exactly or, if
483 the server has presented a certificate for authentication, the key of the
484 certification authority that signed the certificate. For a key to be
485 trusted as a certification authority, it must use the “@cert-authority”
486 marker described above.
487
488 The known hosts file also provides a facility to mark keys as revoked,
489 for example when it is known that the associated private key has been
490 stolen. Revoked keys are specified by including the “@revoked” marker at
491 the beginning of the key line, and are never accepted for authentication
492 or as certification authorities, but instead will produce a warning from
493 ssh(1) when they are encountered.
494
495 It is permissible (but not recommended) to have several lines or differ‐
496 ent host keys for the same names. This will inevitably happen when short
497 forms of host names from different domains are put in the file. It is
498 possible that the files contain conflicting information; authentication
499 is accepted if valid information can be found from either file.
500
501 Note that the lines in these files are typically hundreds of characters
502 long, and you definitely don't want to type in the host keys by hand.
503 Rather, generate them by a script, ssh-keyscan(1) or by taking, for exam‐
504 ple, /etc/ssh/ssh_host_rsa_key.pub and adding the host names at the
505 front. ssh-keygen(1) also offers some basic automated editing for
506 ~/.ssh/known_hosts including removing hosts matching a host name and con‐
507 verting all host names to their hashed representations.
508
509 An example ssh_known_hosts file:
510
511 # Comments allowed at start of line
512 closenet,...,192.0.2.53 1024 37 159...93 closenet.example.net
513 cvs.example.net,192.0.2.10 ssh-rsa AAAA1234.....=
514 # A hashed hostname
515 |1|JfKTdBh7rNbXkVAQCRp4OQoPfmI=|USECr3SWf1JUPsms5AqfD5QfxkM= ssh-rsa
516 AAAA1234.....=
517 # A revoked key
518 @revoked * ssh-rsa AAAAB5W...
519 # A CA key, accepted for any host in *.mydomain.com or *.mydomain.org
520 @cert-authority *.mydomain.org,*.mydomain.com ssh-rsa AAAAB5W...
521
523 ~/.hushlogin
524 This file is used to suppress printing the last login time and
525 /etc/motd, if PrintLastLog and PrintMotd, respectively, are
526 enabled. It does not suppress printing of the banner specified
527 by Banner.
528
529 ~/.rhosts
530 This file is used for host-based authentication (see ssh(1) for
531 more information). On some machines this file may need to be
532 world-readable if the user's home directory is on an NFS parti‐
533 tion, because sshd reads it as root. Additionally, this file
534 must be owned by the user, and must not have write permissions
535 for anyone else. The recommended permission for most machines is
536 read/write for the user, and not accessible by others.
537
538 ~/.shosts
539 This file is used in exactly the same way as .rhosts, but allows
540 host-based authentication without permitting login with
541 rlogin/rsh.
542
543 ~/.k5login
544 ~/.k5users
545 These files enforce GSSAPI/Kerberos authentication access con‐
546 trol. Further details are described in ksu(1). The location of
547 the k5login file depends on the configuration option
548 k5login_directory in the krb5.conf(5).
549
550 ~/.ssh/
551 This directory is the default location for all user-specific con‐
552 figuration and authentication information. There is no general
553 requirement to keep the entire contents of this directory secret,
554 but the recommended permissions are read/write/execute for the
555 user, and not accessible by others.
556
557 ~/.ssh/authorized_keys
558 Lists the public keys (DSA, ECDSA, Ed25519, RSA) that can be used
559 for logging in as this user. The format of this file is
560 described above. The content of the file is not highly sensi‐
561 tive, but the recommended permissions are read/write for the
562 user, and not accessible by others.
563
564 If this file, the ~/.ssh directory, or the user's home directory
565 are writable by other users, then the file could be modified or
566 replaced by unauthorized users. In this case, sshd will not
567 allow it to be used unless the StrictModes option has been set to
568 “no”.
569
570 ~/.ssh/environment
571 This file is read into the environment at login (if it exists).
572 It can only contain empty lines, comment lines (that start with
573 ‘#’), and assignment lines of the form name=value. The file
574 should be writable only by the user; it need not be readable by
575 anyone else. Environment processing is disabled by default and
576 is controlled via the PermitUserEnvironment option.
577
578 ~/.ssh/known_hosts
579 Contains a list of host keys for all hosts the user has logged
580 into that are not already in the systemwide list of known host
581 keys. The format of this file is described above. This file
582 should be writable only by root/the owner and can, but need not
583 be, world-readable.
584
585 ~/.ssh/rc
586 Contains initialization routines to be run before the user's home
587 directory becomes accessible. This file should be writable only
588 by the user, and need not be readable by anyone else.
589
590 /etc/hosts.equiv
591 This file is for host-based authentication (see ssh(1)). It
592 should only be writable by root.
593
594 /etc/ssh/moduli
595 Contains Diffie-Hellman groups used for the "Diffie-Hellman Group
596 Exchange" key exchange method. The file format is described in
597 moduli(5). If no usable groups are found in this file then fixed
598 internal groups will be used.
599
600 /etc/motd
601 See motd(5).
602
603 /etc/nologin
604 If this file exists, sshd refuses to let anyone except root log
605 in. The contents of the file are displayed to anyone trying to
606 log in, and non-root connections are refused. The file should be
607 world-readable.
608
609 /etc/ssh/shosts.equiv
610 This file is used in exactly the same way as hosts.equiv, but
611 allows host-based authentication without permitting login with
612 rlogin/rsh.
613
614 /etc/ssh/ssh_host_ecdsa_key
615 /etc/ssh/ssh_host_ed25519_key
616 /etc/ssh/ssh_host_rsa_key
617 These files contain the private parts of the host keys. These
618 files should only be owned by root, readable only by root, and
619 not accessible to others. Note that sshd does not start if these
620 files are group/world-accessible.
621
622 /etc/ssh/ssh_host_ecdsa_key.pub
623 /etc/ssh/ssh_host_ed25519_key.pub
624 /etc/ssh/ssh_host_rsa_key.pub
625 These files contain the public parts of the host keys. These
626 files should be world-readable but writable only by root. Their
627 contents should match the respective private parts. These files
628 are not really used for anything; they are provided for the con‐
629 venience of the user so their contents can be copied to known
630 hosts files. These files are created using ssh-keygen(1).
631
632 /etc/ssh/ssh_known_hosts
633 Systemwide list of known host keys. This file should be prepared
634 by the system administrator to contain the public host keys of
635 all machines in the organization. The format of this file is
636 described above. This file should be writable only by root/the
637 owner and should be world-readable.
638
639 /etc/ssh/sshd_config
640 Contains configuration data for sshd. The file format and con‐
641 figuration options are described in sshd_config(5).
642
643 /etc/ssh/sshrc
644 Similar to ~/.ssh/rc, it can be used to specify machine-specific
645 login-time initializations globally. This file should be
646 writable only by root, and should be world-readable.
647
648 /var/empty/sshd
649 chroot(2) directory used by sshd during privilege separation in
650 the pre-authentication phase. The directory should not contain
651 any files and must be owned by root and not group or world-
652 writable.
653
654 /var/run/sshd.pid
655 Contains the process ID of the sshd listening for connections (if
656 there are several daemons running concurrently for different
657 ports, this contains the process ID of the one started last).
658 The content of this file is not sensitive; it can be world-read‐
659 able.
660
662 IPv6 address can be used everywhere where IPv4 address. In all entries
663 must be the IPv6 address enclosed in square brackets. Note: The square
664 brackets are metacharacters for the shell and must be escaped in shell.
665
667 scp(1), sftp(1), ssh(1), ssh-add(1), ssh-agent(1), ssh-keygen(1),
668 ssh-keyscan(1), chroot(2), login.conf(5), moduli(5), sshd_config(5),
669 inetd(8), sftp-server(8)
670
672 OpenSSH is a derivative of the original and free ssh 1.2.12 release by
673 Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo
674 de Raadt and Dug Song removed many bugs, re-added newer features and cre‐
675 ated OpenSSH. Markus Friedl contributed the support for SSH protocol
676 versions 1.5 and 2.0. Niels Provos and Markus Friedl contributed support
677 for privilege separation.
678
679BSD August 27, 2020 BSD