summaryrefslogtreecommitdiff
path: root/sshd.8
diff options
context:
space:
mode:
Diffstat (limited to 'sshd.8')
-rw-r--r--sshd.8125
1 files changed, 34 insertions, 91 deletions
diff --git a/sshd.8 b/sshd.8
index 4e7556736..38a72540d 100644
--- a/sshd.8
+++ b/sshd.8
@@ -33,8 +33,8 @@
33.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 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. 34.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35.\" 35.\"
36.\" $OpenBSD: sshd.8,v 1.284 2016/02/17 07:38:19 jmc Exp $ 36.\" $OpenBSD: sshd.8,v 1.287 2016/11/30 02:57:40 djm Exp $
37.Dd $Mdocdate: February 17 2016 $ 37.Dd $Mdocdate: November 30 2016 $
38.Dt SSHD 8 38.Dt SSHD 8
39.Os 39.Os
40.Sh NAME 40.Sh NAME
@@ -44,14 +44,12 @@
44.Nm sshd 44.Nm sshd
45.Bk -words 45.Bk -words
46.Op Fl 46DdeiqTt 46.Op Fl 46DdeiqTt
47.Op Fl b Ar bits
48.Op Fl C Ar connection_spec 47.Op Fl C Ar connection_spec
49.Op Fl c Ar host_certificate_file 48.Op Fl c Ar host_certificate_file
50.Op Fl E Ar log_file 49.Op Fl E Ar log_file
51.Op Fl f Ar config_file 50.Op Fl f Ar config_file
52.Op Fl g Ar login_grace_time 51.Op Fl g Ar login_grace_time
53.Op Fl h Ar host_key_file 52.Op Fl h Ar host_key_file
54.Op Fl k Ar key_gen_time
55.Op Fl o Ar option 53.Op Fl o Ar option
56.Op Fl p Ar port 54.Op Fl p Ar port
57.Op Fl u Ar len 55.Op Fl u Ar len
@@ -99,9 +97,6 @@ to use IPv4 addresses only.
99Forces 97Forces
100.Nm 98.Nm
101to use IPv6 addresses only. 99to use IPv6 addresses only.
102.It Fl b Ar bits
103Specifies the number of bits in the ephemeral protocol version 1
104server key (default 1024).
105.It Fl C Ar connection_spec 100.It Fl C Ar connection_spec
106Specify the connection parameters to use for the 101Specify the connection parameters to use for the
107.Fl T 102.Fl T
@@ -172,36 +167,18 @@ This option must be given if
172is not run as root (as the normal 167is not run as root (as the normal
173host key files are normally not readable by anyone but root). 168host key files are normally not readable by anyone but root).
174The default is 169The default is
175.Pa /etc/ssh/ssh_host_key
176for protocol version 1, and
177.Pa /etc/ssh/ssh_host_dsa_key , 170.Pa /etc/ssh/ssh_host_dsa_key ,
178.Pa /etc/ssh/ssh_host_ecdsa_key . 171.Pa /etc/ssh/ssh_host_ecdsa_key ,
179.Pa /etc/ssh/ssh_host_ed25519_key 172.Pa /etc/ssh/ssh_host_ed25519_key
180and 173and
181.Pa /etc/ssh/ssh_host_rsa_key 174.Pa /etc/ssh/ssh_host_rsa_key .
182for protocol version 2.
183It is possible to have multiple host key files for 175It is possible to have multiple host key files for
184the different protocol versions and host key algorithms. 176the different host key algorithms.
185.It Fl i 177.It Fl i
186Specifies that 178Specifies that
187.Nm 179.Nm
188is being run from 180is being run from
189.Xr inetd 8 . 181.Xr inetd 8 .
190If SSH protocol 1 is enabled,
191.Nm
192should not normally be run
193from inetd because it needs to generate the server key before it can
194respond to the client, and this may take some time.
195Clients may have to wait too long if the key was regenerated every time.
196.It Fl k Ar key_gen_time
197Specifies how often the ephemeral protocol version 1 server key is
198regenerated (default 3600 seconds, or one hour).
199The motivation for regenerating the key fairly
200often is that the key is not stored anywhere, and after about an hour
201it becomes impossible to recover the key for decrypting intercepted
202communications even if the machine is cracked into or physically
203seized.
204A value of zero indicates that the key will never be regenerated.
205.It Fl o Ar option 182.It Fl o Ar option
206Can be used to give options in the format used in the configuration file. 183Can be used to give options in the format used in the configuration file.
207This is useful for specifying options for which there is no separate 184This is useful for specifying options for which there is no separate
@@ -260,8 +237,7 @@ may also be used to prevent
260from making DNS requests unless the authentication 237from making DNS requests unless the authentication
261mechanism or configuration requires it. 238mechanism or configuration requires it.
262Authentication mechanisms that may require DNS include 239Authentication mechanisms that may require DNS include
263.Cm RhostsRSAAuthentication , 240.Cm HostbasedAuthentication
264.Cm HostbasedAuthentication ,
265and using a 241and using a
266.Cm from="pattern-list" 242.Cm from="pattern-list"
267option in a key file. 243option in a key file.
@@ -272,42 +248,14 @@ or
272.Cm DenyUsers . 248.Cm DenyUsers .
273.El 249.El
274.Sh AUTHENTICATION 250.Sh AUTHENTICATION
275The OpenSSH SSH daemon supports SSH protocols 1 and 2. 251The OpenSSH SSH daemon supports SSH protocol 2 only.
276The default is to use protocol 2 only,
277though this can be changed via the
278.Cm Protocol
279option in
280.Xr sshd_config 5 .
281Protocol 1 should not be used
282and is only offered to support legacy devices.
283.Pp
284Each host has a host-specific key, 252Each host has a host-specific key,
285used to identify the host. 253used to identify the host.
286Partial forward security for protocol 1 is provided through
287an additional server key,
288normally 1024 bits,
289generated when the server starts.
290This key is normally regenerated every hour if it has been used, and
291is never stored on disk.
292Whenever a client connects, the daemon responds with its public 254Whenever a client connects, the daemon responds with its public
293host and server keys. 255host key.
294The client compares the 256The client compares the
295RSA host key against its own database to verify that it has not changed. 257host key against its own database to verify that it has not changed.
296The client then generates a 256-bit random number. 258Forward security is provided through a Diffie-Hellman key agreement.
297It encrypts this
298random number using both the host key and the server key, and sends
299the encrypted number to the server.
300Both sides then use this
301random number as a session key which is used to encrypt all further
302communications in the session.
303The rest of the session is encrypted
304using a conventional cipher, currently Blowfish or 3DES, with 3DES
305being used by default.
306The client selects the encryption algorithm
307to use from those offered by the server.
308.Pp
309For protocol 2,
310forward security is provided through a Diffie-Hellman key agreement.
311This key agreement results in a shared session key. 259This key agreement results in a shared session key.
312The rest of the session is encrypted using a symmetric cipher, currently 260The rest of the session is encrypted using a symmetric cipher, currently
313128-bit AES, Blowfish, 3DES, CAST128, Arcfour, 192-bit AES, or 256-bit AES. 261128-bit AES, Blowfish, 3DES, CAST128, Arcfour, 192-bit AES, or 256-bit AES.
@@ -480,32 +428,25 @@ key (empty lines and lines starting with a
480.Ql # 428.Ql #
481are ignored as 429are ignored as
482comments). 430comments).
483Protocol 1 public keys consist of the following space-separated fields: 431Public keys consist of the following space-separated fields:
484options, bits, exponent, modulus, comment.
485Protocol 2 public key consist of:
486options, keytype, base64-encoded key, comment. 432options, keytype, base64-encoded key, comment.
487The options field is optional; 433The options field is optional.
488its presence is determined by whether the line starts 434The keytype is
489with a number or not (the options field never starts with a number).
490The bits, exponent, modulus, and comment fields give the RSA key for
491protocol version 1; the
492comment field is not used for anything (but may be convenient for the
493user to identify the key).
494For protocol version 2 the keytype is
495.Dq ecdsa-sha2-nistp256 , 435.Dq ecdsa-sha2-nistp256 ,
496.Dq ecdsa-sha2-nistp384 , 436.Dq ecdsa-sha2-nistp384 ,
497.Dq ecdsa-sha2-nistp521 , 437.Dq ecdsa-sha2-nistp521 ,
498.Dq ssh-ed25519 , 438.Dq ssh-ed25519 ,
499.Dq ssh-dss 439.Dq ssh-dss
500or 440or
501.Dq ssh-rsa . 441.Dq ssh-rsa ;
442the comment field is not used for anything (but may be convenient for the
443user to identify the key).
502.Pp 444.Pp
503Note that lines in this file are usually several hundred bytes long 445Note that lines in this file can be several hundred bytes long
504(because of the size of the public key encoding) up to a limit of 446(because of the size of the public key encoding) up to a limit of
5058 kilobytes, which permits DSA keys up to 8 kilobits and RSA 4478 kilobytes, which permits DSA keys up to 8 kilobits and RSA
506keys up to 16 kilobits. 448keys up to 16 kilobits.
507You don't want to type them in; instead, copy the 449You don't want to type them in; instead, copy the
508.Pa identity.pub ,
509.Pa id_dsa.pub , 450.Pa id_dsa.pub ,
510.Pa id_ecdsa.pub , 451.Pa id_ecdsa.pub ,
511.Pa id_ed25519.pub , 452.Pa id_ed25519.pub ,
@@ -514,8 +455,7 @@ or the
514file and edit it. 455file and edit it.
515.Pp 456.Pp
516.Nm 457.Nm
517enforces a minimum RSA key modulus size for protocol 1 458enforces a minimum RSA key modulus size of 768 bits.
518and protocol 2 keys of 768 bits.
519.Pp 459.Pp
520The options (if present) consist of comma-separated option 460The options (if present) consist of comma-separated option
521specifications. 461specifications.
@@ -544,19 +484,27 @@ If an 8-bit clean channel is required,
544one must not request a pty or should specify 484one must not request a pty or should specify
545.Cm no-pty . 485.Cm no-pty .
546A quote may be included in the command by quoting it with a backslash. 486A quote may be included in the command by quoting it with a backslash.
487.Pp
547This option might be useful 488This option might be useful
548to restrict certain public keys to perform just a specific operation. 489to restrict certain public keys to perform just a specific operation.
549An example might be a key that permits remote backups but nothing else. 490An example might be a key that permits remote backups but nothing else.
550Note that the client may specify TCP and/or X11 491Note that the client may specify TCP and/or X11
551forwarding unless they are explicitly prohibited. 492forwarding unless they are explicitly prohibited, e.g. using the
493.Cm restrict
494key option.
495.Pp
552The command originally supplied by the client is available in the 496The command originally supplied by the client is available in the
553.Ev SSH_ORIGINAL_COMMAND 497.Ev SSH_ORIGINAL_COMMAND
554environment variable. 498environment variable.
555Note that this option applies to shell, command or subsystem execution. 499Note that this option applies to shell, command or subsystem execution.
556Also note that this command may be superseded by either a 500Also note that this command may be superseded by a
557.Xr sshd_config 5 501.Xr sshd_config 5
558.Cm ForceCommand 502.Cm ForceCommand
559directive or a command embedded in a certificate. 503directive.
504.Pp
505If a command is specified and a forced-command is embedded in a certificate
506used for authentication, then the certificate will be accepted only if the
507two commands are identical.
560.It Cm environment="NAME=value" 508.It Cm environment="NAME=value"
561Specifies that the string is to be added to the environment when 509Specifies that the string is to be added to the environment when
562logging in using this key. 510logging in using this key.
@@ -567,9 +515,6 @@ Environment processing is disabled by default and is
567controlled via the 515controlled via the
568.Cm PermitUserEnvironment 516.Cm PermitUserEnvironment
569option. 517option.
570This option is automatically disabled if
571.Cm UseLogin
572is enabled.
573.It Cm from="pattern-list" 518.It Cm from="pattern-list"
574Specifies that in addition to public key authentication, either the canonical 519Specifies that in addition to public key authentication, either the canonical
575name of the remote host or its IP address must be present in the 520name of the remote host or its IP address must be present in the
@@ -693,7 +638,7 @@ maintained automatically: whenever the user connects from an unknown host,
693its key is added to the per-user file. 638its key is added to the per-user file.
694.Pp 639.Pp
695Each line in these files contains the following fields: markers (optional), 640Each line in these files contains the following fields: markers (optional),
696hostnames, bits, exponent, modulus, comment. 641hostnames, keytype, base64-encoded key, comment.
697The fields are separated by spaces. 642The fields are separated by spaces.
698.Pp 643.Pp
699The marker is optional, but if it is present then it must be one of 644The marker is optional, but if it is present then it must be one of
@@ -734,9 +679,9 @@ character.
734Only one hashed hostname may appear on a single line and none of the above 679Only one hashed hostname may appear on a single line and none of the above
735negation or wildcard operators may be applied. 680negation or wildcard operators may be applied.
736.Pp 681.Pp
737Bits, exponent, and modulus are taken directly from the RSA host key; they 682The keytype and base64-encoded key are taken directly from the host key; they
738can be obtained, for example, from 683can be obtained, for example, from
739.Pa /etc/ssh/ssh_host_key.pub . 684.Pa /etc/ssh/ssh_host_rsa_key.pub .
740The optional comment field continues to the end of the line, and is not used. 685The optional comment field continues to the end of the line, and is not used.
741.Pp 686.Pp
742Lines starting with 687Lines starting with
@@ -775,8 +720,8 @@ Note that the lines in these files are typically hundreds of characters
775long, and you definitely don't want to type in the host keys by hand. 720long, and you definitely don't want to type in the host keys by hand.
776Rather, generate them by a script, 721Rather, generate them by a script,
777.Xr ssh-keyscan 1 722.Xr ssh-keyscan 1
778or by taking 723or by taking, for example,
779.Pa /etc/ssh/ssh_host_key.pub 724.Pa /etc/ssh/ssh_host_rsa_key.pub
780and adding the host names at the front. 725and adding the host names at the front.
781.Xr ssh-keygen 1 726.Xr ssh-keygen 1
782also offers some basic automated editing for 727also offers some basic automated editing for
@@ -921,7 +866,6 @@ This file is used in exactly the same way as
921but allows host-based authentication without permitting login with 866but allows host-based authentication without permitting login with
922rlogin/rsh. 867rlogin/rsh.
923.Pp 868.Pp
924.It Pa /etc/ssh/ssh_host_key
925.It Pa /etc/ssh/ssh_host_dsa_key 869.It Pa /etc/ssh/ssh_host_dsa_key
926.It Pa /etc/ssh/ssh_host_ecdsa_key 870.It Pa /etc/ssh/ssh_host_ecdsa_key
927.It Pa /etc/ssh/ssh_host_ed25519_key 871.It Pa /etc/ssh/ssh_host_ed25519_key
@@ -933,7 +877,6 @@ Note that
933.Nm 877.Nm
934does not start if these files are group/world-accessible. 878does not start if these files are group/world-accessible.
935.Pp 879.Pp
936.It Pa /etc/ssh/ssh_host_key.pub
937.It Pa /etc/ssh/ssh_host_dsa_key.pub 880.It Pa /etc/ssh/ssh_host_dsa_key.pub
938.It Pa /etc/ssh/ssh_host_ecdsa_key.pub 881.It Pa /etc/ssh/ssh_host_ecdsa_key.pub
939.It Pa /etc/ssh/ssh_host_ed25519_key.pub 882.It Pa /etc/ssh/ssh_host_ed25519_key.pub