summaryrefslogtreecommitdiff
path: root/ssh.1
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2003-10-02 16:19:47 +1000
committerDarren Tucker <dtucker@zip.com.au>2003-10-02 16:19:47 +1000
commit6177695c0b4e5cc3fbcbcbf6d041781465bc4680 (patch)
treecd37dd65f13618e2cb470dcd761aa3c695336d91 /ssh.1
parent8fca6b57b488cb2f8cd71186e0f8e17c431f7980 (diff)
- jmc@cvs.openbsd.org 2003/09/29 11:40:51
[ssh.1] - add list of options to -o and .Xr ssh_config(5) - some other cleanup requested by deraadt@; ok deraadt@ markus@
Diffstat (limited to 'ssh.1')
-rw-r--r--ssh.1483
1 files changed, 275 insertions, 208 deletions
diff --git a/ssh.1 b/ssh.1
index c81cb42c6..21e573b6d 100644
--- a/ssh.1
+++ b/ssh.1
@@ -34,7 +34,7 @@
34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 34.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 35.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36.\" 36.\"
37.\" $OpenBSD: ssh.1,v 1.175 2003/07/22 13:35:22 markus Exp $ 37.\" $OpenBSD: ssh.1,v 1.176 2003/09/29 11:40:51 jmc Exp $
38.Dd September 25, 1999 38.Dd September 25, 1999
39.Dt SSH 1 39.Dt SSH 1
40.Os 40.Os
@@ -43,22 +43,14 @@
43.Nd OpenSSH SSH client (remote login program) 43.Nd OpenSSH SSH client (remote login program)
44.Sh SYNOPSIS 44.Sh SYNOPSIS
45.Nm ssh 45.Nm ssh
46.Op Fl l Ar login_name 46.Op Fl 1246AaCfgkNnqsTtVvXx
47.Ar hostname | user@hostname
48.Op Ar command
49.Pp
50.Nm ssh
51.Bk -words
52.Op Fl afgknqstvxACNTVX1246
53.Op Fl b Ar bind_address 47.Op Fl b Ar bind_address
54.Op Fl c Ar cipher_spec 48.Op Fl c Ar cipher_spec
49.Op Fl D Ar port
55.Op Fl e Ar escape_char 50.Op Fl e Ar escape_char
56.Op Fl i Ar identity_file
57.Op Fl l Ar login_name
58.Op Fl m Ar mac_spec
59.Op Fl o Ar option
60.Op Fl p Ar port
61.Op Fl F Ar configfile 51.Op Fl F Ar configfile
52.Op Fl i Ar identity_file
53.Bk -words
62.Oo Fl L Xo 54.Oo Fl L Xo
63.Sm off 55.Sm off
64.Ar port : 56.Ar port :
@@ -68,7 +60,12 @@
68.Xc 60.Xc
69.Oc 61.Oc
70.Ek 62.Ek
63.Op Fl l Ar login_name
64.Op Fl m Ar mac_spec
65.Op Fl o Ar option
71.Bk -words 66.Bk -words
67.Op Fl p Ar port
68.Ek
72.Oo Fl R Xo 69.Oo Fl R Xo
73.Sm off 70.Sm off
74.Ar port : 71.Ar port :
@@ -77,29 +74,34 @@
77.Sm on 74.Sm on
78.Xc 75.Xc
79.Oc 76.Oc
80.Op Fl D Ar port 77.Oo Ar user Ns @ Oc Ns Ar hostname
81.Ar hostname | user@hostname
82.Op Ar command 78.Op Ar command
83.Ek
84.Sh DESCRIPTION 79.Sh DESCRIPTION
85.Nm 80.Nm
86(SSH client) is a program for logging into a remote machine and for 81(SSH client) is a program for logging into a remote machine and for
87executing commands on a remote machine. 82executing commands on a remote machine.
88It is intended to replace 83It is intended to replace rlogin and rsh,
89rlogin and rsh, and provide secure encrypted communications between 84and provide secure encrypted communications between
90two untrusted hosts over an insecure network. 85two untrusted hosts over an insecure network.
91X11 connections and 86X11 connections and arbitrary TCP/IP ports
92arbitrary TCP/IP ports can also be forwarded over the secure channel. 87can also be forwarded over the secure channel.
93.Pp 88.Pp
94.Nm 89.Nm
95connects and logs into the specified 90connects and logs into the specified
96.Ar hostname . 91.Ar hostname
92(with optional
93.Ar user
94name).
97The user must prove 95The user must prove
98his/her identity to the remote machine using one of several methods 96his/her identity to the remote machine using one of several methods
99depending on the protocol version used: 97depending on the protocol version used.
100.Pp 98.Pp
99If
100.Ar command
101is specified,
102.Ar command
103is executed on the remote host instead of a login shell.
101.Ss SSH protocol version 1 104.Ss SSH protocol version 1
102.Pp
103First, if the machine the user logs in from is listed in 105First, if the machine the user logs in from is listed in
104.Pa /etc/hosts.equiv 106.Pa /etc/hosts.equiv
105or 107or
@@ -107,9 +109,9 @@ or
107on the remote machine, and the user names are 109on the remote machine, and the user names are
108the same on both sides, the user is immediately permitted to log in. 110the same on both sides, the user is immediately permitted to log in.
109Second, if 111Second, if
110.Pa \&.rhosts 112.Pa .rhosts
111or 113or
112.Pa \&.shosts 114.Pa .shosts
113exists in the user's home directory on the 115exists in the user's home directory on the
114remote machine and contains a line containing the name of the client 116remote machine and contains a line containing the name of the client
115machine and the name of the user on that machine, the user is 117machine and the name of the user on that machine, the user is
@@ -118,9 +120,9 @@ This form of authentication alone is normally not
118allowed by the server because it is not secure. 120allowed by the server because it is not secure.
119.Pp 121.Pp
120The second authentication method is the 122The second authentication method is the
121.Pa rhosts 123.Em rhosts
122or 124or
123.Pa hosts.equiv 125.Em hosts.equiv
124method combined with RSA-based host authentication. 126method combined with RSA-based host authentication.
125It means that if the login would be permitted by 127It means that if the login would be permitted by
126.Pa $HOME/.rhosts , 128.Pa $HOME/.rhosts ,
@@ -135,7 +137,7 @@ and
135.Pa $HOME/.ssh/known_hosts 137.Pa $HOME/.ssh/known_hosts
136in the 138in the
137.Sx FILES 139.Sx FILES
138section), only then login is permitted. 140section), only then is login permitted.
139This authentication method closes security holes due to IP 141This authentication method closes security holes due to IP
140spoofing, DNS spoofing and routing spoofing. 142spoofing, DNS spoofing and routing spoofing.
141[Note to the administrator: 143[Note to the administrator:
@@ -154,24 +156,23 @@ RSA is one such system.
154The idea is that each user creates a public/private 156The idea is that each user creates a public/private
155key pair for authentication purposes. 157key pair for authentication purposes.
156The server knows the public key, and only the user knows the private key. 158The server knows the public key, and only the user knows the private key.
159.Pp
157The file 160The file
158.Pa $HOME/.ssh/authorized_keys 161.Pa $HOME/.ssh/authorized_keys
159lists the public keys that are permitted for logging 162lists the public keys that are permitted for logging in.
160in.
161When the user logs in, the 163When the user logs in, the
162.Nm 164.Nm
163program tells the server which key pair it would like to use for 165program tells the server which key pair it would like to use for
164authentication. 166authentication.
165The server checks if this key is permitted, and if 167The server checks if this key is permitted, and if so,
166so, sends the user (actually the 168sends the user (actually the
167.Nm 169.Nm
168program running on behalf of the user) a challenge, a random number, 170program running on behalf of the user) a challenge, a random number,
169encrypted by the user's public key. 171encrypted by the user's public key.
170The challenge can only be 172The challenge can only be decrypted using the proper private key.
171decrypted using the proper private key. 173The user's client then decrypts the challenge using the private key,
172The user's client then decrypts the 174proving that he/she knows the private key
173challenge using the private key, proving that he/she knows the private 175but without disclosing it to the server.
174key but without disclosing it to the server.
175.Pp 176.Pp
176.Nm 177.Nm
177implements the RSA authentication protocol automatically. 178implements the RSA authentication protocol automatically.
@@ -179,7 +180,7 @@ The user creates his/her RSA key pair by running
179.Xr ssh-keygen 1 . 180.Xr ssh-keygen 1 .
180This stores the private key in 181This stores the private key in
181.Pa $HOME/.ssh/identity 182.Pa $HOME/.ssh/identity
182and the public key in 183and stores the public key in
183.Pa $HOME/.ssh/identity.pub 184.Pa $HOME/.ssh/identity.pub
184in the user's home directory. 185in the user's home directory.
185The user should then copy the 186The user should then copy the
@@ -193,8 +194,9 @@ file corresponds to the conventional
193file, and has one key 194file, and has one key
194per line, though the lines can be very long). 195per line, though the lines can be very long).
195After this, the user can log in without giving the password. 196After this, the user can log in without giving the password.
196RSA authentication is much 197RSA authentication is much more secure than
197more secure than rhosts authentication. 198.Em rhosts
199authentication.
198.Pp 200.Pp
199The most convenient way to use RSA authentication may be with an 201The most convenient way to use RSA authentication may be with an
200authentication agent. 202authentication agent.
@@ -208,16 +210,14 @@ prompts the user for a password.
208The password is sent to the remote 210The password is sent to the remote
209host for checking; however, since all communications are encrypted, 211host for checking; however, since all communications are encrypted,
210the password cannot be seen by someone listening on the network. 212the password cannot be seen by someone listening on the network.
211.Pp
212.Ss SSH protocol version 2 213.Ss SSH protocol version 2
213.Pp 214When a user connects using protocol version 2,
214When a user connects using protocol version 2
215similar authentication methods are available. 215similar authentication methods are available.
216Using the default values for 216Using the default values for
217.Cm PreferredAuthentications , 217.Cm PreferredAuthentications ,
218the client will try to authenticate first using the hostbased method; 218the client will try to authenticate first using the hostbased method;
219if this method fails public key authentication is attempted, 219if this method fails, public key authentication is attempted,
220and finally if this method fails keyboard-interactive and 220and finally if this method fails, keyboard-interactive and
221password authentication are tried. 221password authentication are tried.
222.Pp 222.Pp
223The public key method is similar to RSA authentication described 223The public key method is similar to RSA authentication described
@@ -233,8 +233,8 @@ and grants access if both the key is found and the signature is correct.
233The session identifier is derived from a shared Diffie-Hellman value 233The session identifier is derived from a shared Diffie-Hellman value
234and is only known to the client and the server. 234and is only known to the client and the server.
235.Pp 235.Pp
236If public key authentication fails or is not available a password 236If public key authentication fails or is not available, a password
237can be sent encrypted to the remote host for proving the user's identity. 237can be sent encrypted to the remote host to prove the user's identity.
238.Pp 238.Pp
239Additionally, 239Additionally,
240.Nm 240.Nm
@@ -245,9 +245,7 @@ Protocol 2 provides additional mechanisms for confidentiality
245and integrity (hmac-md5, hmac-sha1). 245and integrity (hmac-md5, hmac-sha1).
246Note that protocol 1 lacks a strong mechanism for ensuring the 246Note that protocol 1 lacks a strong mechanism for ensuring the
247integrity of the connection. 247integrity of the connection.
248.Pp
249.Ss Login session and remote execution 248.Ss Login session and remote execution
250.Pp
251When the user's identity has been accepted by the server, the server 249When the user's identity has been accepted by the server, the server
252either executes the given command, or logs into the machine and gives 250either executes the given command, or logs into the machine and gives
253the user a normal shell on the remote machine. 251the user a normal shell on the remote machine.
@@ -257,23 +255,20 @@ the remote command or shell will be automatically encrypted.
257If a pseudo-terminal has been allocated (normal login session), the 255If a pseudo-terminal has been allocated (normal login session), the
258user may use the escape characters noted below. 256user may use the escape characters noted below.
259.Pp 257.Pp
260If no pseudo tty has been allocated, the 258If no pseudo-tty has been allocated,
261session is transparent and can be used to reliably transfer binary 259the session is transparent and can be used to reliably transfer binary data.
262data.
263On most systems, setting the escape character to 260On most systems, setting the escape character to
264.Dq none 261.Dq none
265will also make the session transparent even if a tty is used. 262will also make the session transparent even if a tty is used.
266.Pp 263.Pp
267The session terminates when the command or shell on the remote 264The session terminates when the command or shell on the remote
268machine exits and all X11 and TCP/IP connections have been closed. 265machine exits and all X11 and TCP/IP connections have been closed.
269The exit status of the remote program is returned as the exit status 266The exit status of the remote program is returned as the exit status of
270of
271.Nm ssh . 267.Nm ssh .
272.Pp
273.Ss Escape Characters 268.Ss Escape Characters
274.Pp 269When a pseudo-terminal has been requested,
275When a pseudo terminal has been requested, ssh supports a number of functions 270.Nm
276through the use of an escape character. 271supports a number of functions through the use of an escape character.
277.Pp 272.Pp
278A single tilde character can be sent as 273A single tilde character can be sent as
279.Ic ~~ 274.Ic ~~
@@ -291,37 +286,37 @@ The supported escapes (assuming the default
291are: 286are:
292.Bl -tag -width Ds 287.Bl -tag -width Ds
293.It Cm ~. 288.It Cm ~.
294Disconnect 289Disconnect.
295.It Cm ~^Z 290.It Cm ~^Z
296Background ssh 291Background
292.Nm ssh .
297.It Cm ~# 293.It Cm ~#
298List forwarded connections 294List forwarded connections.
299.It Cm ~& 295.It Cm ~&
300Background ssh at logout when waiting for forwarded connection / X11 sessions 296Background
301to terminate 297.Nm
298at logout when waiting for forwarded connection / X11 sessions to terminate.
302.It Cm ~? 299.It Cm ~?
303Display a list of escape characters 300Display a list of escape characters.
304.It Cm ~B 301.It Cm ~B
305Send a BREAK to the remote system (only useful for SSH protocol version 2 302Send a BREAK to the remote system
306and if the peer supports it) 303(only useful for SSH protocol version 2 and if the peer supports it).
307.It Cm ~C 304.It Cm ~C
308Open command line (only useful for adding port forwardings using the 305Open command line (only useful for adding port forwardings using the
309.Fl L 306.Fl L
310and 307and
311.Fl R 308.Fl R
312options) 309options).
313.It Cm ~R 310.It Cm ~R
314Request rekeying of the connection (only useful for SSH protocol version 2 311Request rekeying of the connection
315and if the peer supports it) 312(only useful for SSH protocol version 2 and if the peer supports it).
316.El 313.El
317.Pp
318.Ss X11 and TCP forwarding 314.Ss X11 and TCP forwarding
319.Pp
320If the 315If the
321.Cm ForwardX11 316.Cm ForwardX11
322variable is set to 317variable is set to
323.Dq yes 318.Dq yes
324(or, see the description of the 319(or see the description of the
325.Fl X 320.Fl X
326and 321and
327.Fl x 322.Fl x
@@ -342,8 +337,7 @@ The
342.Ev DISPLAY 337.Ev DISPLAY
343value set by 338value set by
344.Nm 339.Nm
345will point to the server machine, but with a display number greater 340will point to the server machine, but with a display number greater than zero.
346than zero.
347This is normal, and happens because 341This is normal, and happens because
348.Nm 342.Nm
349creates a 343creates a
@@ -364,7 +358,7 @@ If the
364.Cm ForwardAgent 358.Cm ForwardAgent
365variable is set to 359variable is set to
366.Dq yes 360.Dq yes
367(or, see the description of the 361(or see the description of the
368.Fl A 362.Fl A
369and 363and
370.Fl a 364.Fl a
@@ -376,9 +370,7 @@ Forwarding of arbitrary TCP/IP connections over the secure channel can
376be specified either on the command line or in a configuration file. 370be specified either on the command line or in a configuration file.
377One possible application of TCP/IP forwarding is a secure connection to an 371One possible application of TCP/IP forwarding is a secure connection to an
378electronic purse; another is going through firewalls. 372electronic purse; another is going through firewalls.
379.Pp
380.Ss Server authentication 373.Ss Server authentication
381.Pp
382.Nm 374.Nm
383automatically maintains and checks a database containing 375automatically maintains and checks a database containing
384identifications for all hosts it has ever been used with. 376identifications for all hosts it has ever been used with.
@@ -389,14 +381,12 @@ Additionally, the file
389.Pa /etc/ssh/ssh_known_hosts 381.Pa /etc/ssh/ssh_known_hosts
390is automatically checked for known hosts. 382is automatically checked for known hosts.
391Any new hosts are automatically added to the user's file. 383Any new hosts are automatically added to the user's file.
392If a host's identification 384If a host's identification ever changes,
393ever changes,
394.Nm 385.Nm
395warns about this and disables password authentication to prevent a 386warns about this and disables password authentication to prevent a
396trojan horse from getting the user's password. 387trojan horse from getting the user's password.
397Another purpose of 388Another purpose of this mechanism is to prevent man-in-the-middle attacks
398this mechanism is to prevent man-in-the-middle attacks which could 389which could otherwise be used to circumvent the encryption.
399otherwise be used to circumvent the encryption.
400The 390The
401.Cm StrictHostKeyChecking 391.Cm StrictHostKeyChecking
402option can be used to prevent logins to machines whose 392option can be used to prevent logins to machines whose
@@ -404,8 +394,22 @@ host key is not known or has changed.
404.Pp 394.Pp
405The options are as follows: 395The options are as follows:
406.Bl -tag -width Ds 396.Bl -tag -width Ds
407.It Fl a 397.It Fl 1
408Disables forwarding of the authentication agent connection. 398Forces
399.Nm
400to try protocol version 1 only.
401.It Fl 2
402Forces
403.Nm
404to try protocol version 2 only.
405.It Fl 4
406Forces
407.Nm
408to use IPv4 addresses only.
409.It Fl 6
410Forces
411.Nm
412to use IPv6 addresses only.
409.It Fl A 413.It Fl A
410Enables forwarding of the authentication agent connection. 414Enables forwarding of the authentication agent connection.
411This can also be specified on a per-host basis in a configuration file. 415This can also be specified on a per-host basis in a configuration file.
@@ -417,10 +421,28 @@ can access the local agent through the forwarded connection.
417An attacker cannot obtain key material from the agent, 421An attacker cannot obtain key material from the agent,
418however they can perform operations on the keys that enable them to 422however they can perform operations on the keys that enable them to
419authenticate using the identities loaded into the agent. 423authenticate using the identities loaded into the agent.
424.It Fl a
425Disables forwarding of the authentication agent connection.
420.It Fl b Ar bind_address 426.It Fl b Ar bind_address
421Specify the interface to transmit from on machines with multiple 427Specify the interface to transmit from on machines with multiple
422interfaces or aliased addresses. 428interfaces or aliased addresses.
423.It Fl c Ar blowfish|3des|des 429.It Fl C
430Requests compression of all data (including stdin, stdout, stderr, and
431data for forwarded X11 and TCP/IP connections).
432The compression algorithm is the same used by
433.Xr gzip 1 ,
434and the
435.Dq level
436can be controlled by the
437.Cm CompressionLevel
438option for protocol version 1.
439Compression is desirable on modem lines and other
440slow connections, but will only slow down things on fast networks.
441The default value can be set on a host-by-host basis in the
442configuration files; see the
443.Cm Compression
444option.
445.It Fl c Ar blowfish | 3des | des
424Selects the cipher to use for encrypting the session. 446Selects the cipher to use for encrypting the session.
425.Ar 3des 447.Ar 3des
426is used by default. 448is used by default.
@@ -428,7 +450,7 @@ It is believed to be secure.
428.Ar 3des 450.Ar 3des
429(triple-des) is an encrypt-decrypt-encrypt triple with three different keys. 451(triple-des) is an encrypt-decrypt-encrypt triple with three different keys.
430.Ar blowfish 452.Ar blowfish
431is a fast block cipher, it appears very secure and is much faster than 453is a fast block cipher; it appears very secure and is much faster than
432.Ar 3des . 454.Ar 3des .
433.Ar des 455.Ar des
434is only supported in the 456is only supported in the
@@ -444,18 +466,41 @@ be specified in order of preference.
444See 466See
445.Cm Ciphers 467.Cm Ciphers
446for more information. 468for more information.
447.It Fl e Ar ch|^ch|none 469.It Fl D Ar port
470Specifies a local
471.Dq dynamic
472application-level port forwarding.
473This works by allocating a socket to listen to
474.Ar port
475on the local side, and whenever a connection is made to this port, the
476connection is forwarded over the secure channel, and the application
477protocol is then used to determine where to connect to from the
478remote machine.
479Currently the SOCKS4 and SOCKS5 protocols are supported, and
480.Nm
481will act as a SOCKS server.
482Only root can forward privileged ports.
483Dynamic port forwardings can also be specified in the configuration file.
484.It Fl e Ar ch | ^ch | none
448Sets the escape character for sessions with a pty (default: 485Sets the escape character for sessions with a pty (default:
449.Ql ~ ) . 486.Ql ~ ) .
450The escape character is only recognized at the beginning of a line. 487The escape character is only recognized at the beginning of a line.
451The escape character followed by a dot 488The escape character followed by a dot
452.Pq Ql \&. 489.Pq Ql \&.
453closes the connection, followed 490closes the connection;
454by control-Z suspends the connection, and followed by itself sends the 491followed by control-Z suspends the connection;
455escape character once. 492and followed by itself sends the escape character once.
456Setting the character to 493Setting the character to
457.Dq none 494.Dq none
458disables any escapes and makes the session fully transparent. 495disables any escapes and makes the session fully transparent.
496.It Fl F Ar configfile
497Specifies an alternative per-user configuration file.
498If a configuration file is given on the command line,
499the system-wide configuration file
500.Pq Pa /etc/ssh/ssh_config
501will be ignored.
502The default for the per-user configuration file is
503.Pa $HOME/.ssh/config .
459.It Fl f 504.It Fl f
460Requests 505Requests
461.Nm 506.Nm
@@ -471,6 +516,12 @@ something like
471.Ic ssh -f host xterm . 516.Ic ssh -f host xterm .
472.It Fl g 517.It Fl g
473Allows remote hosts to connect to local forwarded ports. 518Allows remote hosts to connect to local forwarded ports.
519.It Fl I Ar smartcard_device
520Specifies which smartcard device to use.
521The argument is the device
522.Nm
523should use to communicate with a smartcard used for storing the user's
524private RSA key.
474.It Fl i Ar identity_file 525.It Fl i Ar identity_file
475Selects a file from which the identity (private key) for 526Selects a file from which the identity (private key) for
476RSA or DSA authentication is read. 527RSA or DSA authentication is read.
@@ -487,15 +538,34 @@ It is possible to have multiple
487.Fl i 538.Fl i
488options (and multiple identities specified in 539options (and multiple identities specified in
489configuration files). 540configuration files).
490.It Fl I Ar smartcard_device
491Specifies which smartcard device to use.
492The argument is the device
493.Nm
494should use to communicate with a smartcard used for storing the user's
495private RSA key.
496.It Fl k 541.It Fl k
497Disables forwarding of Kerberos tickets. 542Disables forwarding of Kerberos tickets.
498This may also be specified on a per-host basis in the configuration file. 543This may also be specified on a per-host basis in the configuration file.
544.It Fl L Xo
545.Sm off
546.Ar port : host : hostport
547.Sm on
548.Xc
549Specifies that the given port on the local (client) host is to be
550forwarded to the given host and port on the remote side.
551This works by allocating a socket to listen to
552.Ar port
553on the local side, and whenever a connection is made to this port, the
554connection is forwarded over the secure channel, and a connection is
555made to
556.Ar host
557port
558.Ar hostport
559from the remote machine.
560Port forwardings can also be specified in the configuration file.
561Only root can forward privileged ports.
562IPv6 addresses can be specified with an alternative syntax:
563.Sm off
564.Xo
565.Ar port No / Ar host No /
566.Ar hostport .
567.Xc
568.Sm on
499.It Fl l Ar login_name 569.It Fl l Ar login_name
500Specifies the user to log in as on the remote machine. 570Specifies the user to log in as on the remote machine.
501This also may be specified on a per-host basis in the configuration file. 571This also may be specified on a per-host basis in the configuration file.
@@ -506,6 +576,10 @@ be specified in order of preference.
506See the 576See the
507.Cm MACs 577.Cm MACs
508keyword for more information. 578keyword for more information.
579.It Fl N
580Do not execute a remote command.
581This is useful for just forwarding ports
582(protocol version 2 only).
509.It Fl n 583.It Fl n
510Redirects stdin from 584Redirects stdin from
511.Pa /dev/null 585.Pa /dev/null
@@ -526,14 +600,64 @@ program will be put in the background.
526needs to ask for a password or passphrase; see also the 600needs to ask for a password or passphrase; see also the
527.Fl f 601.Fl f
528option.) 602option.)
529.It Fl N
530Do not execute a remote command.
531This is useful for just forwarding ports
532(protocol version 2 only).
533.It Fl o Ar option 603.It Fl o Ar option
534Can be used to give options in the format used in the configuration file. 604Can be used to give options in the format used in the configuration file.
535This is useful for specifying options for which there is no separate 605This is useful for specifying options for which there is no separate
536command-line flag. 606command-line flag.
607For full details of the options listed below, and their possible values, see
608.Xr ssh_config 5 .
609.Pp
610.Bl -tag -width Ds -offset indent -compact
611.It AddressFamily
612.It BatchMode
613.It BindAddress
614.It ChallengeResponseAuthentication
615.It CheckHostIP
616.It Cipher
617.It Ciphers
618.It ClearAllForwardings
619.It Compression
620.It CompressionLevel
621.It ConnectionAttempts
622.It ConnectionTimeout
623.It DynamicForward
624.It EnableSSHKeysign
625.It EscapeChar
626.It ForwardAgent
627.It ForwardX11
628.It GatewayPorts
629.It GlobalKnownHostsFile
630.It GSSAPIAuthentication
631.It GSSAPIDelegateCredentials
632.It Host
633.It HostbasedAuthentication
634.It HostKeyAlgorithms
635.It HostKeyAlias
636.It HostName
637.It IdentityFile
638.It KeepAlive
639.It LocalForward
640.It LogLevel
641.It MACs
642.It NoHostAuthenticationForLocalhost
643.It NumberOfPasswordPrompts
644.It PasswordAuthentication
645.It Port
646.It PreferredAuthentications
647.It Protocol
648.It ProxyCommand
649.It PubkeyAuthentication
650.It RemoteForward
651.It RhostsRSAAuthentication
652.It RSAAuthentication
653.It SmartcardDevice
654.It StrictHostKeyChecking
655.It UsePrivilegedPort
656.It User
657.It UserKnownHostsFile
658.It VerifyHostKeyDNS
659.It XAuthLocation
660.El
537.It Fl p Ar port 661.It Fl p Ar port
538Port to connect to on the remote host. 662Port to connect to on the remote host.
539This can be specified on a 663This can be specified on a
@@ -541,11 +665,40 @@ per-host basis in the configuration file.
541.It Fl q 665.It Fl q
542Quiet mode. 666Quiet mode.
543Causes all warning and diagnostic messages to be suppressed. 667Causes all warning and diagnostic messages to be suppressed.
668.It Fl R Xo
669.Sm off
670.Ar port : host : hostport
671.Sm on
672.Xc
673Specifies that the given port on the remote (server) host is to be
674forwarded to the given host and port on the local side.
675This works by allocating a socket to listen to
676.Ar port
677on the remote side, and whenever a connection is made to this port, the
678connection is forwarded over the secure channel, and a connection is
679made to
680.Ar host
681port
682.Ar hostport
683from the local machine.
684Port forwardings can also be specified in the configuration file.
685Privileged ports can be forwarded only when
686logging in as root on the remote machine.
687IPv6 addresses can be specified with an alternative syntax:
688.Sm off
689.Xo
690.Ar port No / Ar host No /
691.Ar hostport .
692.Xc
693.Sm on
544.It Fl s 694.It Fl s
545May be used to request invocation of a subsystem on the remote system. 695May be used to request invocation of a subsystem on the remote system.
546Subsystems are a feature of the SSH2 protocol which facilitate the use 696Subsystems are a feature of the SSH2 protocol which facilitate the use
547of SSH as a secure transport for other applications (eg. sftp). 697of SSH as a secure transport for other applications (eg.\&
698.Xr sftp 1 ) .
548The subsystem is specified as the remote command. 699The subsystem is specified as the remote command.
700.It Fl T
701Disable pseudo-tty allocation.
549.It Fl t 702.It Fl t
550Force pseudo-tty allocation. 703Force pseudo-tty allocation.
551This can be used to execute arbitrary 704This can be used to execute arbitrary
@@ -556,8 +709,8 @@ Multiple
556options force tty allocation, even if 709options force tty allocation, even if
557.Nm 710.Nm
558has no local tty. 711has no local tty.
559.It Fl T 712.It Fl V
560Disable pseudo-tty allocation. 713Display the version number and exit.
561.It Fl v 714.It Fl v
562Verbose mode. 715Verbose mode.
563Causes 716Causes
@@ -569,10 +722,6 @@ Multiple
569.Fl v 722.Fl v
570options increase the verbosity. 723options increase the verbosity.
571The maximum is 3. 724The maximum is 3.
572.It Fl V
573Display the version number and exit.
574.It Fl x
575Disables X11 forwarding.
576.It Fl X 725.It Fl X
577Enables X11 forwarding. 726Enables X11 forwarding.
578This can also be specified on a per-host basis in a configuration file. 727This can also be specified on a per-host basis in a configuration file.
@@ -582,94 +731,8 @@ Users with the ability to bypass file permissions on the remote host
582(for the user's X authorization database) 731(for the user's X authorization database)
583can access the local X11 display through the forwarded connection. 732can access the local X11 display through the forwarded connection.
584An attacker may then be able to perform activities such as keystroke monitoring. 733An attacker may then be able to perform activities such as keystroke monitoring.
585.It Fl C 734.It Fl x
586Requests compression of all data (including stdin, stdout, stderr, and 735Disables X11 forwarding.
587data for forwarded X11 and TCP/IP connections).
588The compression algorithm is the same used by
589.Xr gzip 1 ,
590and the
591.Dq level
592can be controlled by the
593.Cm CompressionLevel
594option for protocol version 1.
595Compression is desirable on modem lines and other
596slow connections, but will only slow down things on fast networks.
597The default value can be set on a host-by-host basis in the
598configuration files; see the
599.Cm Compression
600option.
601.It Fl F Ar configfile
602Specifies an alternative per-user configuration file.
603If a configuration file is given on the command line,
604the system-wide configuration file
605.Pq Pa /etc/ssh/ssh_config
606will be ignored.
607The default for the per-user configuration file is
608.Pa $HOME/.ssh/config .
609.It Fl L Ar port:host:hostport
610Specifies that the given port on the local (client) host is to be
611forwarded to the given host and port on the remote side.
612This works by allocating a socket to listen to
613.Ar port
614on the local side, and whenever a connection is made to this port, the
615connection is forwarded over the secure channel, and a connection is
616made to
617.Ar host
618port
619.Ar hostport
620from the remote machine.
621Port forwardings can also be specified in the configuration file.
622Only root can forward privileged ports.
623IPv6 addresses can be specified with an alternative syntax:
624.Ar port/host/hostport
625.It Fl R Ar port:host:hostport
626Specifies that the given port on the remote (server) host is to be
627forwarded to the given host and port on the local side.
628This works by allocating a socket to listen to
629.Ar port
630on the remote side, and whenever a connection is made to this port, the
631connection is forwarded over the secure channel, and a connection is
632made to
633.Ar host
634port
635.Ar hostport
636from the local machine.
637Port forwardings can also be specified in the configuration file.
638Privileged ports can be forwarded only when
639logging in as root on the remote machine.
640IPv6 addresses can be specified with an alternative syntax:
641.Ar port/host/hostport
642.It Fl D Ar port
643Specifies a local
644.Dq dynamic
645application-level port forwarding.
646This works by allocating a socket to listen to
647.Ar port
648on the local side, and whenever a connection is made to this port, the
649connection is forwarded over the secure channel, and the application
650protocol is then used to determine where to connect to from the
651remote machine.
652Currently the SOCKS4 and SOCKS5 protocols are supported, and
653.Nm
654will act as a SOCKS server.
655Only root can forward privileged ports.
656Dynamic port forwardings can also be specified in the configuration file.
657.It Fl 1
658Forces
659.Nm
660to try protocol version 1 only.
661.It Fl 2
662Forces
663.Nm
664to try protocol version 2 only.
665.It Fl 4
666Forces
667.Nm
668to use IPv4 addresses only.
669.It Fl 6
670Forces
671.Nm
672to use IPv6 addresses only.
673.El 736.El
674.Sh CONFIGURATION FILES 737.Sh CONFIGURATION FILES
675.Nm 738.Nm
@@ -680,7 +743,7 @@ The file format and configuration options are described in
680.Sh ENVIRONMENT 743.Sh ENVIRONMENT
681.Nm 744.Nm
682will normally set the following environment variables: 745will normally set the following environment variables:
683.Bl -tag -width Ds 746.Bl -tag -width LOGNAME
684.It Ev DISPLAY 747.It Ev DISPLAY
685The 748The
686.Ev DISPLAY 749.Ev DISPLAY
@@ -690,7 +753,7 @@ It is automatically set by
690to point to a value of the form 753to point to a value of the form
691.Dq hostname:n 754.Dq hostname:n
692where hostname indicates 755where hostname indicates
693the host where the shell runs, and n is an integer >= 1. 756the host where the shell runs, and n is an integer \*(Ge 1.
694.Nm 757.Nm
695uses this special value to forward X11 connections over the secure 758uses this special value to forward X11 connections over the secure
696channel. 759channel.
@@ -768,7 +831,7 @@ and adds lines of the format
768.Dq VARNAME=value 831.Dq VARNAME=value
769to the environment if the file exists and if users are allowed to 832to the environment if the file exists and if users are allowed to
770change their environment. 833change their environment.
771See the 834For more information, see the
772.Cm PermitUserEnvironment 835.Cm PermitUserEnvironment
773option in 836option in
774.Xr sshd_config 5 . 837.Xr sshd_config 5 .
@@ -797,7 +860,7 @@ Contains the public key for authentication (public part of the
797identity file in human-readable form). 860identity file in human-readable form).
798The contents of the 861The contents of the
799.Pa $HOME/.ssh/identity.pub 862.Pa $HOME/.ssh/identity.pub
800file should be added to 863file should be added to the file
801.Pa $HOME/.ssh/authorized_keys 864.Pa $HOME/.ssh/authorized_keys
802on all machines 865on all machines
803where the user wishes to log in using protocol version 1 RSA authentication. 866where the user wishes to log in using protocol version 1 RSA authentication.
@@ -823,7 +886,8 @@ Lists the public keys (RSA/DSA) that can be used for logging in as this user.
823The format of this file is described in the 886The format of this file is described in the
824.Xr sshd 8 887.Xr sshd 8
825manual page. 888manual page.
826In the simplest form the format is the same as the .pub 889In the simplest form the format is the same as the
890.Pa .pub
827identity files. 891identity files.
828This file is not highly sensitive, but the recommended 892This file is not highly sensitive, but the recommended
829permissions are read/write for the user, and not accessible by others. 893permissions are read/write for the user, and not accessible by others.
@@ -839,7 +903,7 @@ by spaces): system name, public key and optional comment field.
839When different names are used 903When different names are used
840for the same machine, all such names should be listed, separated by 904for the same machine, all such names should be listed, separated by
841commas. 905commas.
842The format is described on the 906The format is described in the
843.Xr sshd 8 907.Xr sshd 8
844manual page. 908manual page.
845.Pp 909.Pp
@@ -879,7 +943,7 @@ By default
879is not setuid root. 943is not setuid root.
880.It Pa $HOME/.rhosts 944.It Pa $HOME/.rhosts
881This file is used in 945This file is used in
882.Pa \&.rhosts 946.Em rhosts
883authentication to list the 947authentication to list the
884host/user pairs that are permitted to log in. 948host/user pairs that are permitted to log in.
885(Note that this file is 949(Note that this file is
@@ -901,7 +965,9 @@ accessible by others.
901Note that by default 965Note that by default
902.Xr sshd 8 966.Xr sshd 8
903will be installed so that it requires successful RSA host 967will be installed so that it requires successful RSA host
904authentication before permitting \s+2.\s0rhosts authentication. 968authentication before permitting
969.Em rhosts
970authentication.
905If the server machine does not have the client's host key in 971If the server machine does not have the client's host key in
906.Pa /etc/ssh/ssh_known_hosts , 972.Pa /etc/ssh/ssh_known_hosts ,
907it can be stored in 973it can be stored in
@@ -912,21 +978,20 @@ will automatically add the host key to
912.Pa $HOME/.ssh/known_hosts . 978.Pa $HOME/.ssh/known_hosts .
913.It Pa $HOME/.shosts 979.It Pa $HOME/.shosts
914This file is used exactly the same way as 980This file is used exactly the same way as
915.Pa \&.rhosts . 981.Pa .rhosts .
916The purpose for 982The purpose for
917having this file is to be able to use rhosts authentication with 983having this file is to be able to use rhosts authentication with
918.Nm 984.Nm
919without permitting login with 985without permitting login with
920.Nm rlogin 986.Xr rlogin
921or 987or
922.Xr rsh 1 . 988.Xr rsh 1 .
923.It Pa /etc/hosts.equiv 989.It Pa /etc/hosts.equiv
924This file is used during 990This file is used during
925.Pa \&.rhosts 991.Em rhosts
926authentication. 992authentication.
927It contains 993It contains
928canonical hosts names, one per line (the full format is described on 994canonical hosts names, one per line (the full format is described in the
929the
930.Xr sshd 8 995.Xr sshd 8
931manual page). 996manual page).
932If the client host is found in this file, login is 997If the client host is found in this file, login is
@@ -966,6 +1031,7 @@ above.
966exits with the exit status of the remote command or with 255 1031exits with the exit status of the remote command or with 255
967if an error occurred. 1032if an error occurred.
968.Sh SEE ALSO 1033.Sh SEE ALSO
1034.Xr gzip 1 ,
969.Xr rsh 1 , 1035.Xr rsh 1 ,
970.Xr scp 1 , 1036.Xr scp 1 ,
971.Xr sftp 1 , 1037.Xr sftp 1 ,
@@ -973,6 +1039,7 @@ if an error occurred.
973.Xr ssh-agent 1 , 1039.Xr ssh-agent 1 ,
974.Xr ssh-keygen 1 , 1040.Xr ssh-keygen 1 ,
975.Xr telnet 1 , 1041.Xr telnet 1 ,
1042.Xr hosts.equiv 5 ,
976.Xr ssh_config 5 , 1043.Xr ssh_config 5 ,
977.Xr ssh-keysign 8 , 1044.Xr ssh-keysign 8 ,
978.Xr sshd 8 1045.Xr sshd 8