summaryrefslogtreecommitdiff
path: root/ssh.1
diff options
context:
space:
mode:
Diffstat (limited to 'ssh.1')
-rw-r--r--ssh.1490
1 files changed, 280 insertions, 210 deletions
diff --git a/ssh.1 b/ssh.1
index 3fbd954e8..6c9ac5909 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.181 2003/12/16 15:49:51 markus 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 1246AaCfgkNnqsTtVvXxY
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,33 @@ 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 (delegation) of GSSAPI credentials to the server.
498This may also be specified on a per-host basis in the configuration file. 543.It Fl L Xo
544.Sm off
545.Ar port : host : hostport
546.Sm on
547.Xc
548Specifies that the given port on the local (client) host is to be
549forwarded to the given host and port on the remote side.
550This works by allocating a socket to listen to
551.Ar port
552on the local side, and whenever a connection is made to this port, the
553connection is forwarded over the secure channel, and a connection is
554made to
555.Ar host
556port
557.Ar hostport
558from the remote machine.
559Port forwardings can also be specified in the configuration file.
560Only root can forward privileged ports.
561IPv6 addresses can be specified with an alternative syntax:
562.Sm off
563.Xo
564.Ar port No / Ar host No /
565.Ar hostport .
566.Xc
567.Sm on
499.It Fl l Ar login_name 568.It Fl l Ar login_name
500Specifies the user to log in as on the remote machine. 569Specifies the user to log in as on the remote machine.
501This also may be specified on a per-host basis in the configuration file. 570This also may be specified on a per-host basis in the configuration file.
@@ -506,6 +575,10 @@ be specified in order of preference.
506See the 575See the
507.Cm MACs 576.Cm MACs
508keyword for more information. 577keyword for more information.
578.It Fl N
579Do not execute a remote command.
580This is useful for just forwarding ports
581(protocol version 2 only).
509.It Fl n 582.It Fl n
510Redirects stdin from 583Redirects stdin from
511.Pa /dev/null 584.Pa /dev/null
@@ -526,14 +599,66 @@ program will be put in the background.
526needs to ask for a password or passphrase; see also the 599needs to ask for a password or passphrase; see also the
527.Fl f 600.Fl f
528option.) 601option.)
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 602.It Fl o Ar option
534Can be used to give options in the format used in the configuration file. 603Can 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 604This is useful for specifying options for which there is no separate
536command-line flag. 605command-line flag.
606For full details of the options listed below, and their possible values, see
607.Xr ssh_config 5 .
608.Pp
609.Bl -tag -width Ds -offset indent -compact
610.It AddressFamily
611.It BatchMode
612.It BindAddress
613.It ChallengeResponseAuthentication
614.It CheckHostIP
615.It Cipher
616.It Ciphers
617.It ClearAllForwardings
618.It Compression
619.It CompressionLevel
620.It ConnectionAttempts
621.It ConnectionTimeout
622.It DynamicForward
623.It EscapeChar
624.It ForwardAgent
625.It ForwardX11
626.It ForwardX11Trusted
627.It GatewayPorts
628.It GlobalKnownHostsFile
629.It GSSAPIAuthentication
630.It GSSAPIDelegateCredentials
631.It Host
632.It HostbasedAuthentication
633.It HostKeyAlgorithms
634.It HostKeyAlias
635.It HostName
636.It IdentityFile
637.It LocalForward
638.It LogLevel
639.It MACs
640.It NoHostAuthenticationForLocalhost
641.It NumberOfPasswordPrompts
642.It PasswordAuthentication
643.It Port
644.It PreferredAuthentications
645.It Protocol
646.It ProxyCommand
647.It PubkeyAuthentication
648.It RemoteForward
649.It RhostsRSAAuthentication
650.It RSAAuthentication
651.It ServerAliveInterval
652.It ServerAliveCountMax
653.It SmartcardDevice
654.It StrictHostKeyChecking
655.It TCPKeepAlive
656.It UsePrivilegedPort
657.It User
658.It UserKnownHostsFile
659.It VerifyHostKeyDNS
660.It XAuthLocation
661.El
537.It Fl p Ar port 662.It Fl p Ar port
538Port to connect to on the remote host. 663Port to connect to on the remote host.
539This can be specified on a 664This can be specified on a
@@ -545,11 +670,40 @@ Only fatal errors are displayed.
545If a second 670If a second
546.Fl q 671.Fl q
547is given then even fatal errors are suppressed. 672is given then even fatal errors are suppressed.
673.It Fl R Xo
674.Sm off
675.Ar port : host : hostport
676.Sm on
677.Xc
678Specifies that the given port on the remote (server) host is to be
679forwarded to the given host and port on the local side.
680This works by allocating a socket to listen to
681.Ar port
682on the remote side, and whenever a connection is made to this port, the
683connection is forwarded over the secure channel, and a connection is
684made to
685.Ar host
686port
687.Ar hostport
688from the local machine.
689Port forwardings can also be specified in the configuration file.
690Privileged ports can be forwarded only when
691logging in as root on the remote machine.
692IPv6 addresses can be specified with an alternative syntax:
693.Sm off
694.Xo
695.Ar port No / Ar host No /
696.Ar hostport .
697.Xc
698.Sm on
548.It Fl s 699.It Fl s
549May be used to request invocation of a subsystem on the remote system. 700May be used to request invocation of a subsystem on the remote system.
550Subsystems are a feature of the SSH2 protocol which facilitate the use 701Subsystems are a feature of the SSH2 protocol which facilitate the use
551of SSH as a secure transport for other applications (eg. sftp). 702of SSH as a secure transport for other applications (eg.\&
703.Xr sftp 1 ) .
552The subsystem is specified as the remote command. 704The subsystem is specified as the remote command.
705.It Fl T
706Disable pseudo-tty allocation.
553.It Fl t 707.It Fl t
554Force pseudo-tty allocation. 708Force pseudo-tty allocation.
555This can be used to execute arbitrary 709This can be used to execute arbitrary
@@ -560,8 +714,8 @@ Multiple
560options force tty allocation, even if 714options force tty allocation, even if
561.Nm 715.Nm
562has no local tty. 716has no local tty.
563.It Fl T 717.It Fl V
564Disable pseudo-tty allocation. 718Display the version number and exit.
565.It Fl v 719.It Fl v
566Verbose mode. 720Verbose mode.
567Causes 721Causes
@@ -573,10 +727,6 @@ Multiple
573.Fl v 727.Fl v
574options increase the verbosity. 728options increase the verbosity.
575The maximum is 3. 729The maximum is 3.
576.It Fl V
577Display the version number and exit.
578.It Fl x
579Disables X11 forwarding.
580.It Fl X 730.It Fl X
581Enables X11 forwarding. 731Enables X11 forwarding.
582This can also be specified on a per-host basis in a configuration file. 732This can also be specified on a per-host basis in a configuration file.
@@ -586,94 +736,10 @@ Users with the ability to bypass file permissions on the remote host
586(for the user's X authorization database) 736(for the user's X authorization database)
587can access the local X11 display through the forwarded connection. 737can access the local X11 display through the forwarded connection.
588An attacker may then be able to perform activities such as keystroke monitoring. 738An attacker may then be able to perform activities such as keystroke monitoring.
589.It Fl C 739.It Fl x
590Requests compression of all data (including stdin, stdout, stderr, and 740Disables X11 forwarding.
591data for forwarded X11 and TCP/IP connections). 741.It Fl Y
592The compression algorithm is the same used by 742Enables trusted X11 forwarding.
593.Xr gzip 1 ,
594and the
595.Dq level
596can be controlled by the
597.Cm CompressionLevel
598option for protocol version 1.
599Compression is desirable on modem lines and other
600slow connections, but will only slow down things on fast networks.
601The default value can be set on a host-by-host basis in the
602configuration files; see the
603.Cm Compression
604option.
605.It Fl F Ar configfile
606Specifies an alternative per-user configuration file.
607If a configuration file is given on the command line,
608the system-wide configuration file
609.Pq Pa /etc/ssh/ssh_config
610will be ignored.
611The default for the per-user configuration file is
612.Pa $HOME/.ssh/config .
613.It Fl L Ar port:host:hostport
614Specifies that the given port on the local (client) host is to be
615forwarded to the given host and port on the remote side.
616This works by allocating a socket to listen to
617.Ar port
618on the local side, and whenever a connection is made to this port, the
619connection is forwarded over the secure channel, and a connection is
620made to
621.Ar host
622port
623.Ar hostport
624from the remote machine.
625Port forwardings can also be specified in the configuration file.
626Only root can forward privileged ports.
627IPv6 addresses can be specified with an alternative syntax:
628.Ar port/host/hostport
629.It Fl R Ar port:host:hostport
630Specifies that the given port on the remote (server) host is to be
631forwarded to the given host and port on the local side.
632This works by allocating a socket to listen to
633.Ar port
634on the remote side, and whenever a connection is made to this port, the
635connection is forwarded over the secure channel, and a connection is
636made to
637.Ar host
638port
639.Ar hostport
640from the local machine.
641Port forwardings can also be specified in the configuration file.
642Privileged ports can be forwarded only when
643logging in as root on the remote machine.
644IPv6 addresses can be specified with an alternative syntax:
645.Ar port/host/hostport
646.It Fl D Ar port
647Specifies a local
648.Dq dynamic
649application-level port forwarding.
650This works by allocating a socket to listen to
651.Ar port
652on the local side, and whenever a connection is made to this port, the
653connection is forwarded over the secure channel, and the application
654protocol is then used to determine where to connect to from the
655remote machine.
656Currently the SOCKS4 and SOCKS5 protocols are supported, and
657.Nm
658will act as a SOCKS server.
659Only root can forward privileged ports.
660Dynamic port forwardings can also be specified in the configuration file.
661.It Fl 1
662Forces
663.Nm
664to try protocol version 1 only.
665.It Fl 2
666Forces
667.Nm
668to try protocol version 2 only.
669.It Fl 4
670Forces
671.Nm
672to use IPv4 addresses only.
673.It Fl 6
674Forces
675.Nm
676to use IPv6 addresses only.
677.El 743.El
678.Sh CONFIGURATION FILES 744.Sh CONFIGURATION FILES
679.Nm 745.Nm
@@ -684,7 +750,7 @@ The file format and configuration options are described in
684.Sh ENVIRONMENT 750.Sh ENVIRONMENT
685.Nm 751.Nm
686will normally set the following environment variables: 752will normally set the following environment variables:
687.Bl -tag -width Ds 753.Bl -tag -width LOGNAME
688.It Ev DISPLAY 754.It Ev DISPLAY
689The 755The
690.Ev DISPLAY 756.Ev DISPLAY
@@ -694,7 +760,7 @@ It is automatically set by
694to point to a value of the form 760to point to a value of the form
695.Dq hostname:n 761.Dq hostname:n
696where hostname indicates 762where hostname indicates
697the host where the shell runs, and n is an integer >= 1. 763the host where the shell runs, and n is an integer \*(Ge 1.
698.Nm 764.Nm
699uses this special value to forward X11 connections over the secure 765uses this special value to forward X11 connections over the secure
700channel. 766channel.
@@ -772,7 +838,7 @@ and adds lines of the format
772.Dq VARNAME=value 838.Dq VARNAME=value
773to the environment if the file exists and if users are allowed to 839to the environment if the file exists and if users are allowed to
774change their environment. 840change their environment.
775See the 841For more information, see the
776.Cm PermitUserEnvironment 842.Cm PermitUserEnvironment
777option in 843option in
778.Xr sshd_config 5 . 844.Xr sshd_config 5 .
@@ -801,7 +867,7 @@ Contains the public key for authentication (public part of the
801identity file in human-readable form). 867identity file in human-readable form).
802The contents of the 868The contents of the
803.Pa $HOME/.ssh/identity.pub 869.Pa $HOME/.ssh/identity.pub
804file should be added to 870file should be added to the file
805.Pa $HOME/.ssh/authorized_keys 871.Pa $HOME/.ssh/authorized_keys
806on all machines 872on all machines
807where the user wishes to log in using protocol version 1 RSA authentication. 873where the user wishes to log in using protocol version 1 RSA authentication.
@@ -827,7 +893,8 @@ Lists the public keys (RSA/DSA) that can be used for logging in as this user.
827The format of this file is described in the 893The format of this file is described in the
828.Xr sshd 8 894.Xr sshd 8
829manual page. 895manual page.
830In the simplest form the format is the same as the .pub 896In the simplest form the format is the same as the
897.Pa .pub
831identity files. 898identity files.
832This file is not highly sensitive, but the recommended 899This file is not highly sensitive, but the recommended
833permissions are read/write for the user, and not accessible by others. 900permissions are read/write for the user, and not accessible by others.
@@ -843,7 +910,7 @@ by spaces): system name, public key and optional comment field.
843When different names are used 910When different names are used
844for the same machine, all such names should be listed, separated by 911for the same machine, all such names should be listed, separated by
845commas. 912commas.
846The format is described on the 913The format is described in the
847.Xr sshd 8 914.Xr sshd 8
848manual page. 915manual page.
849.Pp 916.Pp
@@ -883,7 +950,7 @@ By default
883is not setuid root. 950is not setuid root.
884.It Pa $HOME/.rhosts 951.It Pa $HOME/.rhosts
885This file is used in 952This file is used in
886.Pa \&.rhosts 953.Em rhosts
887authentication to list the 954authentication to list the
888host/user pairs that are permitted to log in. 955host/user pairs that are permitted to log in.
889(Note that this file is 956(Note that this file is
@@ -905,7 +972,9 @@ accessible by others.
905Note that by default 972Note that by default
906.Xr sshd 8 973.Xr sshd 8
907will be installed so that it requires successful RSA host 974will be installed so that it requires successful RSA host
908authentication before permitting \s+2.\s0rhosts authentication. 975authentication before permitting
976.Em rhosts
977authentication.
909If the server machine does not have the client's host key in 978If the server machine does not have the client's host key in
910.Pa /etc/ssh/ssh_known_hosts , 979.Pa /etc/ssh/ssh_known_hosts ,
911it can be stored in 980it can be stored in
@@ -916,21 +985,20 @@ will automatically add the host key to
916.Pa $HOME/.ssh/known_hosts . 985.Pa $HOME/.ssh/known_hosts .
917.It Pa $HOME/.shosts 986.It Pa $HOME/.shosts
918This file is used exactly the same way as 987This file is used exactly the same way as
919.Pa \&.rhosts . 988.Pa .rhosts .
920The purpose for 989The purpose for
921having this file is to be able to use rhosts authentication with 990having this file is to be able to use rhosts authentication with
922.Nm 991.Nm
923without permitting login with 992without permitting login with
924.Nm rlogin 993.Xr rlogin
925or 994or
926.Xr rsh 1 . 995.Xr rsh 1 .
927.It Pa /etc/hosts.equiv 996.It Pa /etc/hosts.equiv
928This file is used during 997This file is used during
929.Pa \&.rhosts 998.Em rhosts
930authentication. 999authentication.
931It contains 1000It contains
932canonical hosts names, one per line (the full format is described on 1001canonical hosts names, one per line (the full format is described in the
933the
934.Xr sshd 8 1002.Xr sshd 8
935manual page). 1003manual page).
936If the client host is found in this file, login is 1004If the client host is found in this file, login is
@@ -970,6 +1038,7 @@ above.
970exits with the exit status of the remote command or with 255 1038exits with the exit status of the remote command or with 255
971if an error occurred. 1039if an error occurred.
972.Sh SEE ALSO 1040.Sh SEE ALSO
1041.Xr gzip 1 ,
973.Xr rsh 1 , 1042.Xr rsh 1 ,
974.Xr scp 1 , 1043.Xr scp 1 ,
975.Xr sftp 1 , 1044.Xr sftp 1 ,
@@ -978,6 +1047,7 @@ if an error occurred.
978.Xr ssh-argv0 1 , 1047.Xr ssh-argv0 1 ,
979.Xr ssh-keygen 1 , 1048.Xr ssh-keygen 1 ,
980.Xr telnet 1 , 1049.Xr telnet 1 ,
1050.Xr hosts.equiv 5 ,
981.Xr ssh_config 5 , 1051.Xr ssh_config 5 ,
982.Xr ssh-keysign 8 , 1052.Xr ssh-keysign 8 ,
983.Xr sshd 8 1053.Xr sshd 8