diff options
author | Colin Watson <cjwatson@debian.org> | 2005-01-04 12:58:23 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2005-01-04 12:58:23 +0000 |
commit | ebd2ce335af5861020c79fddb1ae35c03bf036cf (patch) | |
tree | ec008b93c62e3241ab611d8c949ebc92905c66b4 /ssh.0 | |
parent | e17cc75fe35f62ba52928b5889b5e7aadb62bedb (diff) | |
parent | 16f1d21ea191deaaeeba719d01c0ad82aa044653 (diff) |
Import OpenSSH 3.9p1.
Diffstat (limited to 'ssh.0')
-rw-r--r-- | ssh.0 | 696 |
1 files changed, 696 insertions, 0 deletions
@@ -0,0 +1,696 @@ | |||
1 | SSH(1) OpenBSD Reference Manual SSH(1) | ||
2 | |||
3 | NAME | ||
4 | ssh - OpenSSH SSH client (remote login program) | ||
5 | |||
6 | SYNOPSIS | ||
7 | ssh [-1246AaCfgkMNnqsTtVvXxY] [-b bind_address] [-c cipher_spec] | ||
8 | [-D port] [-e escape_char] [-F configfile] [-i identity_file] | ||
9 | [-L port:host:hostport] [-l login_name] [-m mac_spec] [-o option] | ||
10 | [-p port] [-R port:host:hostport] [-S ctl] [user@]hostname [command] | ||
11 | |||
12 | DESCRIPTION | ||
13 | ssh (SSH client) is a program for logging into a remote machine and for | ||
14 | executing commands on a remote machine. It is intended to replace rlogin | ||
15 | and rsh, and provide secure encrypted communications between two untrust- | ||
16 | ed hosts over an insecure network. X11 connections and arbitrary TCP/IP | ||
17 | ports can also be forwarded over the secure channel. | ||
18 | |||
19 | ssh connects and logs into the specified hostname (with optional user | ||
20 | name). The user must prove his/her identity to the remote machine using | ||
21 | one of several methods depending on the protocol version used. | ||
22 | |||
23 | If command is specified, command is executed on the remote host instead | ||
24 | of a login shell. | ||
25 | |||
26 | SSH protocol version 1 | ||
27 | First, if the machine the user logs in from is listed in /etc/hosts.equiv | ||
28 | or /etc/shosts.equiv on the remote machine, and the user names are the | ||
29 | same on both sides, the user is immediately permitted to log in. Second, | ||
30 | if .rhosts or .shosts exists in the user's home directory on the remote | ||
31 | machine and contains a line containing the name of the client machine and | ||
32 | the name of the user on that machine, the user is permitted to log in. | ||
33 | This form of authentication alone is normally not allowed by the server | ||
34 | because it is not secure. | ||
35 | |||
36 | The second authentication method is the rhosts or hosts.equiv method com- | ||
37 | bined with RSA-based host authentication. It means that if the login | ||
38 | would be permitted by $HOME/.rhosts, $HOME/.shosts, /etc/hosts.equiv, or | ||
39 | /etc/shosts.equiv, and if additionally the server can verify the client's | ||
40 | host key (see /etc/ssh/ssh_known_hosts and $HOME/.ssh/known_hosts in the | ||
41 | FILES section), only then is login permitted. This authentication method | ||
42 | closes security holes due to IP spoofing, DNS spoofing and routing spoof- | ||
43 | ing. [Note to the administrator: /etc/hosts.equiv, $HOME/.rhosts, and | ||
44 | the rlogin/rsh protocol in general, are inherently insecure and should be | ||
45 | disabled if security is desired.] | ||
46 | |||
47 | As a third authentication method, ssh supports RSA based authentication. | ||
48 | The scheme is based on public-key cryptography: there are cryptosystems | ||
49 | where encryption and decryption are done using separate keys, and it is | ||
50 | not possible to derive the decryption key from the encryption key. RSA | ||
51 | is one such system. The idea is that each user creates a public/private | ||
52 | key pair for authentication purposes. The server knows the public key, | ||
53 | and only the user knows the private key. | ||
54 | |||
55 | The file $HOME/.ssh/authorized_keys lists the public keys that are per- | ||
56 | mitted for logging in. When the user logs in, the ssh program tells the | ||
57 | server which key pair it would like to use for authentication. The serv- | ||
58 | er checks if this key is permitted, and if so, sends the user (actually | ||
59 | the ssh program running on behalf of the user) a challenge, a random num- | ||
60 | ber, encrypted by the user's public key. The challenge can only be de- | ||
61 | crypted using the proper private key. The user's client then decrypts | ||
62 | the challenge using the private key, proving that he/she knows the pri- | ||
63 | vate key but without disclosing it to the server. | ||
64 | |||
65 | ssh implements the RSA authentication protocol automatically. The user | ||
66 | creates his/her RSA key pair by running ssh-keygen(1). This stores the | ||
67 | private key in $HOME/.ssh/identity and stores the public key in | ||
68 | $HOME/.ssh/identity.pub in the user's home directory. The user should | ||
69 | then copy the identity.pub to $HOME/.ssh/authorized_keys in his/her home | ||
70 | directory on the remote machine (the authorized_keys file corresponds to | ||
71 | the conventional $HOME/.rhosts file, and has one key per line, though the | ||
72 | lines can be very long). After this, the user can log in without giving | ||
73 | the password. RSA authentication is much more secure than rhosts authen- | ||
74 | tication. | ||
75 | |||
76 | The most convenient way to use RSA authentication may be with an authen- | ||
77 | tication agent. See ssh-agent(1) for more information. | ||
78 | |||
79 | If other authentication methods fail, ssh prompts the user for a pass- | ||
80 | word. The password is sent to the remote host for checking; however, | ||
81 | since all communications are encrypted, the password cannot be seen by | ||
82 | someone listening on the network. | ||
83 | |||
84 | SSH protocol version 2 | ||
85 | When a user connects using protocol version 2, similar authentication | ||
86 | methods are available. Using the default values for | ||
87 | PreferredAuthentications, the client will try to authenticate first using | ||
88 | the hostbased method; if this method fails, public key authentication is | ||
89 | attempted, and finally if this method fails, keyboard-interactive and | ||
90 | password authentication are tried. | ||
91 | |||
92 | The public key method is similar to RSA authentication described in the | ||
93 | previous section and allows the RSA or DSA algorithm to be used: The | ||
94 | client uses his private key, $HOME/.ssh/id_dsa or $HOME/.ssh/id_rsa, to | ||
95 | sign the session identifier and sends the result to the server. The | ||
96 | server checks whether the matching public key is listed in | ||
97 | $HOME/.ssh/authorized_keys and grants access if both the key is found and | ||
98 | the signature is correct. The session identifier is derived from a | ||
99 | shared Diffie-Hellman value and is only known to the client and the serv- | ||
100 | er. | ||
101 | |||
102 | If public key authentication fails or is not available, a password can be | ||
103 | sent encrypted to the remote host to prove the user's identity. | ||
104 | |||
105 | Additionally, ssh supports hostbased or challenge response authentica- | ||
106 | tion. | ||
107 | |||
108 | Protocol 2 provides additional mechanisms for confidentiality (the traf- | ||
109 | fic is encrypted using AES, 3DES, Blowfish, CAST128 or Arcfour) and in- | ||
110 | tegrity (hmac-md5, hmac-sha1, hmac-ripemd160). Note that protocol 1 | ||
111 | lacks a strong mechanism for ensuring the integrity of the connection. | ||
112 | |||
113 | Login session and remote execution | ||
114 | When the user's identity has been accepted by the server, the server ei- | ||
115 | ther executes the given command, or logs into the machine and gives the | ||
116 | user a normal shell on the remote machine. All communication with the | ||
117 | remote command or shell will be automatically encrypted. | ||
118 | |||
119 | If a pseudo-terminal has been allocated (normal login session), the user | ||
120 | may use the escape characters noted below. | ||
121 | |||
122 | If no pseudo-tty has been allocated, the session is transparent and can | ||
123 | be used to reliably transfer binary data. On most systems, setting the | ||
124 | escape character to ``none'' will also make the session transparent even | ||
125 | if a tty is used. | ||
126 | |||
127 | The session terminates when the command or shell on the remote machine | ||
128 | exits and all X11 and TCP/IP connections have been closed. The exit sta- | ||
129 | tus of the remote program is returned as the exit status of ssh. | ||
130 | |||
131 | Escape Characters | ||
132 | When a pseudo-terminal has been requested, ssh supports a number of func- | ||
133 | tions through the use of an escape character. | ||
134 | |||
135 | A single tilde character can be sent as ~~ or by following the tilde by a | ||
136 | character other than those described below. The escape character must | ||
137 | always follow a newline to be interpreted as special. The escape charac- | ||
138 | ter can be changed in configuration files using the EscapeChar configura- | ||
139 | tion directive or on the command line by the -e option. | ||
140 | |||
141 | The supported escapes (assuming the default `~') are: | ||
142 | |||
143 | ~. Disconnect. | ||
144 | |||
145 | ~^Z Background ssh. | ||
146 | |||
147 | ~# List forwarded connections. | ||
148 | |||
149 | ~& Background ssh at logout when waiting for forwarded connection / | ||
150 | X11 sessions to terminate. | ||
151 | |||
152 | ~? Display a list of escape characters. | ||
153 | |||
154 | ~B Send a BREAK to the remote system (only useful for SSH protocol | ||
155 | version 2 and if the peer supports it). | ||
156 | |||
157 | ~C Open command line. Currently this allows the addition of port | ||
158 | forwardings using the -L and -R options (see below). It also al- | ||
159 | lows the cancellation of existing remote port-forwardings using | ||
160 | -KR hostport. Basic help is available, using the -h option. | ||
161 | |||
162 | ~R Request rekeying of the connection (only useful for SSH protocol | ||
163 | version 2 and if the peer supports it). | ||
164 | |||
165 | X11 and TCP forwarding | ||
166 | If the ForwardX11 variable is set to ``yes'' (or see the description of | ||
167 | the -X and -x options described later) and the user is using X11 (the | ||
168 | DISPLAY environment variable is set), the connection to the X11 display | ||
169 | is automatically forwarded to the remote side in such a way that any X11 | ||
170 | programs started from the shell (or command) will go through the encrypt- | ||
171 | ed channel, and the connection to the real X server will be made from the | ||
172 | local machine. The user should not manually set DISPLAY. Forwarding of | ||
173 | X11 connections can be configured on the command line or in configuration | ||
174 | files. | ||
175 | |||
176 | The DISPLAY value set by ssh will point to the server machine, but with a | ||
177 | display number greater than zero. This is normal, and happens because | ||
178 | ssh creates a ``proxy'' X server on the server machine for forwarding the | ||
179 | connections over the encrypted channel. | ||
180 | |||
181 | ssh will also automatically set up Xauthority data on the server machine. | ||
182 | For this purpose, it will generate a random authorization cookie, store | ||
183 | it in Xauthority on the server, and verify that any forwarded connections | ||
184 | carry this cookie and replace it by the real cookie when the connection | ||
185 | is opened. The real authentication cookie is never sent to the server | ||
186 | machine (and no cookies are sent in the plain). | ||
187 | |||
188 | If the ForwardAgent variable is set to ``yes'' (or see the description of | ||
189 | the -A and -a options described later) and the user is using an authenti- | ||
190 | cation agent, the connection to the agent is automatically forwarded to | ||
191 | the remote side. | ||
192 | |||
193 | Forwarding of arbitrary TCP/IP connections over the secure channel can be | ||
194 | specified either on the command line or in a configuration file. One | ||
195 | possible application of TCP/IP forwarding is a secure connection to an | ||
196 | electronic purse; another is going through firewalls. | ||
197 | |||
198 | Server authentication | ||
199 | ssh automatically maintains and checks a database containing identifica- | ||
200 | tions for all hosts it has ever been used with. Host keys are stored in | ||
201 | $HOME/.ssh/known_hosts in the user's home directory. Additionally, the | ||
202 | file /etc/ssh/ssh_known_hosts is automatically checked for known hosts. | ||
203 | Any new hosts are automatically added to the user's file. If a host's | ||
204 | identification ever changes, ssh warns about this and disables password | ||
205 | authentication to prevent a trojan horse from getting the user's pass- | ||
206 | word. Another purpose of this mechanism is to prevent man-in-the-middle | ||
207 | attacks which could otherwise be used to circumvent the encryption. The | ||
208 | StrictHostKeyChecking option can be used to prevent logins to machines | ||
209 | whose host key is not known or has changed. | ||
210 | |||
211 | ssh can be configured to verify host identification using fingerprint re- | ||
212 | source records (SSHFP) published in DNS. The VerifyHostKeyDNS option can | ||
213 | be used to control how DNS lookups are performed. SSHFP resource records | ||
214 | can be generated using ssh-keygen(1). | ||
215 | |||
216 | The options are as follows: | ||
217 | |||
218 | -1 Forces ssh to try protocol version 1 only. | ||
219 | |||
220 | -2 Forces ssh to try protocol version 2 only. | ||
221 | |||
222 | -4 Forces ssh to use IPv4 addresses only. | ||
223 | |||
224 | -6 Forces ssh to use IPv6 addresses only. | ||
225 | |||
226 | -A Enables forwarding of the authentication agent connection. This | ||
227 | can also be specified on a per-host basis in a configuration | ||
228 | file. | ||
229 | |||
230 | Agent forwarding should be enabled with caution. Users with the | ||
231 | ability to bypass file permissions on the remote host (for the | ||
232 | agent's Unix-domain socket) can access the local agent through | ||
233 | the forwarded connection. An attacker cannot obtain key material | ||
234 | from the agent, however they can perform operations on the keys | ||
235 | that enable them to authenticate using the identities loaded into | ||
236 | the agent. | ||
237 | |||
238 | -a Disables forwarding of the authentication agent connection. | ||
239 | |||
240 | -b bind_address | ||
241 | Specify the interface to transmit from on machines with multiple | ||
242 | interfaces or aliased addresses. | ||
243 | |||
244 | -C Requests compression of all data (including stdin, stdout, | ||
245 | stderr, and data for forwarded X11 and TCP/IP connections). The | ||
246 | compression algorithm is the same used by gzip(1), and the | ||
247 | ``level'' can be controlled by the CompressionLevel option for | ||
248 | protocol version 1. Compression is desirable on modem lines and | ||
249 | other slow connections, but will only slow down things on fast | ||
250 | networks. The default value can be set on a host-by-host basis | ||
251 | in the configuration files; see the Compression option. | ||
252 | |||
253 | -c cipher_spec | ||
254 | Selects the cipher specification for encrypting the session. | ||
255 | |||
256 | Protocol version 1 allows specification of a single cipher. The | ||
257 | suported values are ``3des'', ``blowfish'' and ``des''. 3des | ||
258 | (triple-des) is an encrypt-decrypt-encrypt triple with three dif- | ||
259 | ferent keys. It is believed to be secure. blowfish is a fast | ||
260 | block cipher; it appears very secure and is much faster than | ||
261 | 3des. des is only supported in the ssh client for interoperabil- | ||
262 | ity with legacy protocol 1 implementations that do not support | ||
263 | the 3des cipher. Its use is strongly discouraged due to crypto- | ||
264 | graphic weaknesses. The default is ``3des''. | ||
265 | |||
266 | For protocol version 2 cipher_spec is a comma-separated list of | ||
267 | ciphers listed in order of preference. The supported ciphers are | ||
268 | ``3des-cbc'', ``aes128-cbc'', ``aes192-cbc'', ``aes256-cbc'', | ||
269 | ``aes128-ctr'', ``aes192-ctr'', ``aes256-ctr'', ``arcfour'', | ||
270 | ``blowfish-cbc'', and ``cast128-cbc''. The default is | ||
271 | |||
272 | ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour, | ||
273 | aes192-cbc,aes256-cbc'' | ||
274 | |||
275 | -D port | ||
276 | Specifies a local ``dynamic'' application-level port forwarding. | ||
277 | This works by allocating a socket to listen to port on the local | ||
278 | side, and whenever a connection is made to this port, the connec- | ||
279 | tion is forwarded over the secure channel, and the application | ||
280 | protocol is then used to determine where to connect to from the | ||
281 | remote machine. Currently the SOCKS4 and SOCKS5 protocols are | ||
282 | supported, and ssh will act as a SOCKS server. Only root can | ||
283 | forward privileged ports. Dynamic port forwardings can also be | ||
284 | specified in the configuration file. | ||
285 | |||
286 | -e ch | ^ch | none | ||
287 | Sets the escape character for sessions with a pty (default: `~'). | ||
288 | The escape character is only recognized at the beginning of a | ||
289 | line. The escape character followed by a dot (`.') closes the | ||
290 | connection; followed by control-Z suspends the connection; and | ||
291 | followed by itself sends the escape character once. Setting the | ||
292 | character to ``none'' disables any escapes and makes the session | ||
293 | fully transparent. | ||
294 | |||
295 | -F configfile | ||
296 | Specifies an alternative per-user configuration file. If a con- | ||
297 | figuration file is given on the command line, the system-wide | ||
298 | configuration file (/etc/ssh/ssh_config) will be ignored. The | ||
299 | default for the per-user configuration file is $HOME/.ssh/config. | ||
300 | |||
301 | -f Requests ssh to go to background just before command execution. | ||
302 | This is useful if ssh is going to ask for passwords or passphras- | ||
303 | es, but the user wants it in the background. This implies -n. | ||
304 | The recommended way to start X11 programs at a remote site is | ||
305 | with something like ssh -f host xterm. | ||
306 | |||
307 | -g Allows remote hosts to connect to local forwarded ports. | ||
308 | |||
309 | -I smartcard_device | ||
310 | Specifies which smartcard device to use. The argument is the de- | ||
311 | vice ssh should use to communicate with a smartcard used for | ||
312 | storing the user's private RSA key. | ||
313 | |||
314 | -i identity_file | ||
315 | Selects a file from which the identity (private key) for RSA or | ||
316 | DSA authentication is read. The default is $HOME/.ssh/identity | ||
317 | for protocol version 1, and $HOME/.ssh/id_rsa and | ||
318 | $HOME/.ssh/id_dsa for protocol version 2. Identity files may al- | ||
319 | so be specified on a per-host basis in the configuration file. | ||
320 | It is possible to have multiple -i options (and multiple identi- | ||
321 | ties specified in configuration files). | ||
322 | |||
323 | -k Disables forwarding (delegation) of GSSAPI credentials to the | ||
324 | server. | ||
325 | |||
326 | -L port:host:hostport | ||
327 | Specifies that the given port on the local (client) host is to be | ||
328 | forwarded to the given host and port on the remote side. This | ||
329 | works by allocating a socket to listen to port on the local side, | ||
330 | and whenever a connection is made to this port, the connection is | ||
331 | forwarded over the secure channel, and a connection is made to | ||
332 | host port hostport from the remote machine. Port forwardings can | ||
333 | also be specified in the configuration file. Only root can for- | ||
334 | ward privileged ports. IPv6 addresses can be specified with an | ||
335 | alternative syntax: port/host/hostport. | ||
336 | |||
337 | -l login_name | ||
338 | Specifies the user to log in as on the remote machine. This also | ||
339 | may be specified on a per-host basis in the configuration file. | ||
340 | |||
341 | -M Places the ssh client into ``master'' mode for connection shar- | ||
342 | ing. Refer to the description of ControlMaster in ssh_config(5) | ||
343 | for details. | ||
344 | |||
345 | -m mac_spec | ||
346 | Additionally, for protocol version 2 a comma-separated list of | ||
347 | MAC (message authentication code) algorithms can be specified in | ||
348 | order of preference. See the MACs keyword for more information. | ||
349 | |||
350 | -N Do not execute a remote command. This is useful for just for- | ||
351 | warding ports (protocol version 2 only). | ||
352 | |||
353 | -n Redirects stdin from /dev/null (actually, prevents reading from | ||
354 | stdin). This must be used when ssh is run in the background. A | ||
355 | common trick is to use this to run X11 programs on a remote ma- | ||
356 | chine. For example, ssh -n shadows.cs.hut.fi emacs & will start | ||
357 | an emacs on shadows.cs.hut.fi, and the X11 connection will be au- | ||
358 | tomatically forwarded over an encrypted channel. The ssh program | ||
359 | will be put in the background. (This does not work if ssh needs | ||
360 | to ask for a password or passphrase; see also the -f option.) | ||
361 | |||
362 | -o option | ||
363 | Can be used to give options in the format used in the configura- | ||
364 | tion file. This is useful for specifying options for which there | ||
365 | is no separate command-line flag. For full details of the op- | ||
366 | tions listed below, and their possible values, see ssh_config(5). | ||
367 | |||
368 | AddressFamily | ||
369 | BatchMode | ||
370 | BindAddress | ||
371 | ChallengeResponseAuthentication | ||
372 | CheckHostIP | ||
373 | Cipher | ||
374 | Ciphers | ||
375 | ClearAllForwardings | ||
376 | Compression | ||
377 | CompressionLevel | ||
378 | ConnectionAttempts | ||
379 | ConnectTimeout | ||
380 | ControlMaster | ||
381 | ControlPath | ||
382 | DynamicForward | ||
383 | EscapeChar | ||
384 | ForwardAgent | ||
385 | ForwardX11 | ||
386 | ForwardX11Trusted | ||
387 | GatewayPorts | ||
388 | GlobalKnownHostsFile | ||
389 | GSSAPIAuthentication | ||
390 | GSSAPIDelegateCredentials | ||
391 | Host | ||
392 | HostbasedAuthentication | ||
393 | HostKeyAlgorithms | ||
394 | HostKeyAlias | ||
395 | HostName | ||
396 | IdentityFile | ||
397 | IdentitiesOnly | ||
398 | LocalForward | ||
399 | LogLevel | ||
400 | MACs | ||
401 | NoHostAuthenticationForLocalhost | ||
402 | NumberOfPasswordPrompts | ||
403 | PasswordAuthentication | ||
404 | Port | ||
405 | PreferredAuthentications | ||
406 | Protocol | ||
407 | ProxyCommand | ||
408 | PubkeyAuthentication | ||
409 | RemoteForward | ||
410 | RhostsRSAAuthentication | ||
411 | RSAAuthentication | ||
412 | SendEnv | ||
413 | ServerAliveInterval | ||
414 | ServerAliveCountMax | ||
415 | SmartcardDevice | ||
416 | StrictHostKeyChecking | ||
417 | TCPKeepAlive | ||
418 | UsePrivilegedPort | ||
419 | User | ||
420 | UserKnownHostsFile | ||
421 | VerifyHostKeyDNS | ||
422 | XAuthLocation | ||
423 | |||
424 | -p port | ||
425 | Port to connect to on the remote host. This can be specified on | ||
426 | a per-host basis in the configuration file. | ||
427 | |||
428 | -q Quiet mode. Causes all warning and diagnostic messages to be | ||
429 | suppressed. | ||
430 | |||
431 | -R port:host:hostport | ||
432 | Specifies that the given port on the remote (server) host is to | ||
433 | be forwarded to the given host and port on the local side. This | ||
434 | works by allocating a socket to listen to port on the remote | ||
435 | side, and whenever a connection is made to this port, the connec- | ||
436 | tion is forwarded over the secure channel, and a connection is | ||
437 | made to host port hostport from the local machine. Port forward- | ||
438 | ings can also be specified in the configuration file. Privileged | ||
439 | ports can be forwarded only when logging in as root on the remote | ||
440 | machine. IPv6 addresses can be specified with an alternative | ||
441 | syntax: port/host/hostport. | ||
442 | |||
443 | -S ctl Specifies the location of a control socket for connection shar- | ||
444 | ing. Refer to the description of ControlPath and ControlMaster | ||
445 | in ssh_config(5) for details. | ||
446 | |||
447 | -s May be used to request invocation of a subsystem on the remote | ||
448 | system. Subsystems are a feature of the SSH2 protocol which fa- | ||
449 | cilitate the use of SSH as a secure transport for other applica- | ||
450 | tions (eg. sftp(1)). The subsystem is specified as the remote | ||
451 | command. | ||
452 | |||
453 | -T Disable pseudo-tty allocation. | ||
454 | |||
455 | -t Force pseudo-tty allocation. This can be used to execute arbi- | ||
456 | trary screen-based programs on a remote machine, which can be | ||
457 | very useful, e.g., when implementing menu services. Multiple -t | ||
458 | options force tty allocation, even if ssh has no local tty. | ||
459 | |||
460 | -V Display the version number and exit. | ||
461 | |||
462 | -v Verbose mode. Causes ssh to print debugging messages about its | ||
463 | progress. This is helpful in debugging connection, authentica- | ||
464 | tion, and configuration problems. Multiple -v options increase | ||
465 | the verbosity. The maximum is 3. | ||
466 | |||
467 | -X Enables X11 forwarding. This can also be specified on a per-host | ||
468 | basis in a configuration file. | ||
469 | |||
470 | X11 forwarding should be enabled with caution. Users with the | ||
471 | ability to bypass file permissions on the remote host (for the | ||
472 | user's X authorization database) can access the local X11 display | ||
473 | through the forwarded connection. An attacker may then be able | ||
474 | to perform activities such as keystroke monitoring. | ||
475 | |||
476 | -x Disables X11 forwarding. | ||
477 | |||
478 | -Y Enables trusted X11 forwarding. | ||
479 | |||
480 | CONFIGURATION FILES | ||
481 | ssh may additionally obtain configuration data from a per-user configura- | ||
482 | tion file and a system-wide configuration file. The file format and con- | ||
483 | figuration options are described in ssh_config(5). | ||
484 | |||
485 | ENVIRONMENT | ||
486 | ssh will normally set the following environment variables: | ||
487 | |||
488 | DISPLAY The DISPLAY variable indicates the location of the X11 server. | ||
489 | It is automatically set by ssh to point to a value of the form | ||
490 | ``hostname:n'' where hostname indicates the host where the shell | ||
491 | runs, and n is an integer >= 1. ssh uses this special value to | ||
492 | forward X11 connections over the secure channel. The user | ||
493 | should normally not set DISPLAY explicitly, as that will render | ||
494 | the X11 connection insecure (and will require the user to manu- | ||
495 | ally copy any required authorization cookies). | ||
496 | |||
497 | HOME Set to the path of the user's home directory. | ||
498 | |||
499 | LOGNAME Synonym for USER; set for compatibility with systems that use | ||
500 | this variable. | ||
501 | |||
502 | MAIL Set to the path of the user's mailbox. | ||
503 | |||
504 | PATH Set to the default PATH, as specified when compiling ssh. | ||
505 | |||
506 | SSH_ASKPASS | ||
507 | If ssh needs a passphrase, it will read the passphrase from the | ||
508 | current terminal if it was run from a terminal. If ssh does not | ||
509 | have a terminal associated with it but DISPLAY and SSH_ASKPASS | ||
510 | are set, it will execute the program specified by SSH_ASKPASS | ||
511 | and open an X11 window to read the passphrase. This is particu- | ||
512 | larly useful when calling ssh from a .Xsession or related | ||
513 | script. (Note that on some machines it may be necessary to | ||
514 | redirect the input from /dev/null to make this work.) | ||
515 | |||
516 | SSH_AUTH_SOCK | ||
517 | Identifies the path of a unix-domain socket used to communicate | ||
518 | with the agent. | ||
519 | |||
520 | SSH_CONNECTION | ||
521 | Identifies the client and server ends of the connection. The | ||
522 | variable contains four space-separated values: client ip-ad- | ||
523 | dress, client port number, server ip-address and server port | ||
524 | number. | ||
525 | |||
526 | SSH_ORIGINAL_COMMAND | ||
527 | The variable contains the original command line if a forced com- | ||
528 | mand is executed. It can be used to extract the original argu- | ||
529 | ments. | ||
530 | |||
531 | SSH_TTY This is set to the name of the tty (path to the device) associ- | ||
532 | ated with the current shell or command. If the current session | ||
533 | has no tty, this variable is not set. | ||
534 | |||
535 | TZ The timezone variable is set to indicate the present timezone if | ||
536 | it was set when the daemon was started (i.e., the daemon passes | ||
537 | the value on to new connections). | ||
538 | |||
539 | USER Set to the name of the user logging in. | ||
540 | |||
541 | Additionally, ssh reads $HOME/.ssh/environment, and adds lines of the | ||
542 | format ``VARNAME=value'' to the environment if the file exists and if | ||
543 | users are allowed to change their environment. For more information, see | ||
544 | the PermitUserEnvironment option in sshd_config(5). | ||
545 | |||
546 | FILES | ||
547 | $HOME/.ssh/known_hosts | ||
548 | Records host keys for all hosts the user has logged into that are | ||
549 | not in /etc/ssh/ssh_known_hosts. See sshd(8). | ||
550 | |||
551 | $HOME/.ssh/identity, $HOME/.ssh/id_dsa, $HOME/.ssh/id_rsa | ||
552 | Contains the authentication identity of the user. They are for | ||
553 | protocol 1 RSA, protocol 2 DSA, and protocol 2 RSA, respectively. | ||
554 | These files contain sensitive data and should be readable by the | ||
555 | user but not accessible by others (read/write/execute). Note | ||
556 | that ssh ignores a private key file if it is accessible by oth- | ||
557 | ers. It is possible to specify a passphrase when generating the | ||
558 | key; the passphrase will be used to encrypt the sensitive part of | ||
559 | this file using 3DES. | ||
560 | |||
561 | $HOME/.ssh/identity.pub, $HOME/.ssh/id_dsa.pub, $HOME/.ssh/id_rsa.pub | ||
562 | Contains the public key for authentication (public part of the | ||
563 | identity file in human-readable form). The contents of the | ||
564 | $HOME/.ssh/identity.pub file should be added to the file | ||
565 | $HOME/.ssh/authorized_keys on all machines where the user wishes | ||
566 | to log in using protocol version 1 RSA authentication. The con- | ||
567 | tents of the $HOME/.ssh/id_dsa.pub and $HOME/.ssh/id_rsa.pub file | ||
568 | should be added to $HOME/.ssh/authorized_keys on all machines | ||
569 | where the user wishes to log in using protocol version 2 DSA/RSA | ||
570 | authentication. These files are not sensitive and can (but need | ||
571 | not) be readable by anyone. These files are never used automati- | ||
572 | cally and are not necessary; they are only provided for the con- | ||
573 | venience of the user. | ||
574 | |||
575 | $HOME/.ssh/config | ||
576 | This is the per-user configuration file. The file format and | ||
577 | configuration options are described in ssh_config(5). Because of | ||
578 | the potential for abuse, this file must have strict permissions: | ||
579 | read/write for the user, and not accessible by others. | ||
580 | |||
581 | $HOME/.ssh/authorized_keys | ||
582 | Lists the public keys (RSA/DSA) that can be used for logging in | ||
583 | as this user. The format of this file is described in the | ||
584 | sshd(8) manual page. In the simplest form the format is the same | ||
585 | as the .pub identity files. This file is not highly sensitive, | ||
586 | but the recommended permissions are read/write for the user, and | ||
587 | not accessible by others. | ||
588 | |||
589 | /etc/ssh/ssh_known_hosts | ||
590 | Systemwide list of known host keys. This file should be prepared | ||
591 | by the system administrator to contain the public host keys of | ||
592 | all machines in the organization. This file should be world- | ||
593 | readable. This file contains public keys, one per line, in the | ||
594 | following format (fields separated by spaces): system name, pub- | ||
595 | lic key and optional comment field. When different names are | ||
596 | used for the same machine, all such names should be listed, sepa- | ||
597 | rated by commas. The format is described in the sshd(8) manual | ||
598 | page. | ||
599 | |||
600 | The canonical system name (as returned by name servers) is used | ||
601 | by sshd(8) to verify the client host when logging in; other names | ||
602 | are needed because ssh does not convert the user-supplied name to | ||
603 | a canonical name before checking the key, because someone with | ||
604 | access to the name servers would then be able to fool host au- | ||
605 | thentication. | ||
606 | |||
607 | /etc/ssh/ssh_config | ||
608 | Systemwide configuration file. The file format and configuration | ||
609 | options are described in ssh_config(5). | ||
610 | |||
611 | /etc/ssh/ssh_host_key, /etc/ssh/ssh_host_dsa_key, | ||
612 | /etc/ssh/ssh_host_rsa_key | ||
613 | These three files contain the private parts of the host keys and | ||
614 | are used for RhostsRSAAuthentication and HostbasedAuthentication. | ||
615 | If the protocol version 1 RhostsRSAAuthentication method is used, | ||
616 | ssh must be setuid root, since the host key is readable only by | ||
617 | root. For protocol version 2, ssh uses ssh-keysign(8) to access | ||
618 | the host keys for HostbasedAuthentication. This eliminates the | ||
619 | requirement that ssh be setuid root when that authentication | ||
620 | method is used. By default ssh is not setuid root. | ||
621 | |||
622 | $HOME/.rhosts | ||
623 | This file is used in rhosts authentication to list the host/user | ||
624 | pairs that are permitted to log in. (Note that this file is also | ||
625 | used by rlogin and rsh, which makes using this file insecure.) | ||
626 | Each line of the file contains a host name (in the canonical form | ||
627 | returned by name servers), and then a user name on that host, | ||
628 | separated by a space. On some machines this file may need to be | ||
629 | world-readable if the user's home directory is on a NFS parti- | ||
630 | tion, because sshd(8) reads it as root. Additionally, this file | ||
631 | must be owned by the user, and must not have write permissions | ||
632 | for anyone else. The recommended permission for most machines is | ||
633 | read/write for the user, and not accessible by others. | ||
634 | |||
635 | Note that by default sshd(8) will be installed so that it re- | ||
636 | quires successful RSA host authentication before permitting | ||
637 | rhosts authentication. If the server machine does not have the | ||
638 | client's host key in /etc/ssh/ssh_known_hosts, it can be stored | ||
639 | in $HOME/.ssh/known_hosts. The easiest way to do this is to con- | ||
640 | nect back to the client from the server machine using ssh; this | ||
641 | will automatically add the host key to $HOME/.ssh/known_hosts. | ||
642 | |||
643 | $HOME/.shosts | ||
644 | This file is used exactly the same way as .rhosts. The purpose | ||
645 | for having this file is to be able to use rhosts authentication | ||
646 | with ssh without permitting login with rlogin or rsh(1). | ||
647 | |||
648 | /etc/hosts.equiv | ||
649 | This file is used during rhosts authentication. It contains | ||
650 | canonical hosts names, one per line (the full format is described | ||
651 | in the sshd(8) manual page). If the client host is found in this | ||
652 | file, login is automatically permitted provided client and server | ||
653 | user names are the same. Additionally, successful RSA host au- | ||
654 | thentication is normally required. This file should only be | ||
655 | writable by root. | ||
656 | |||
657 | /etc/shosts.equiv | ||
658 | This file is processed exactly as /etc/hosts.equiv. This file | ||
659 | may be useful to permit logins using ssh but not using | ||
660 | rsh/rlogin. | ||
661 | |||
662 | /etc/ssh/sshrc | ||
663 | Commands in this file are executed by ssh when the user logs in | ||
664 | just before the user's shell (or command) is started. See the | ||
665 | sshd(8) manual page for more information. | ||
666 | |||
667 | $HOME/.ssh/rc | ||
668 | Commands in this file are executed by ssh when the user logs in | ||
669 | just before the user's shell (or command) is started. See the | ||
670 | sshd(8) manual page for more information. | ||
671 | |||
672 | $HOME/.ssh/environment | ||
673 | Contains additional definitions for environment variables, see | ||
674 | section ENVIRONMENT above. | ||
675 | |||
676 | DIAGNOSTICS | ||
677 | ssh exits with the exit status of the remote command or with 255 if an | ||
678 | error occurred. | ||
679 | |||
680 | SEE ALSO | ||
681 | gzip(1), rsh(1), scp(1), sftp(1), ssh-add(1), ssh-agent(1), | ||
682 | ssh-keygen(1), telnet(1), hosts.equiv(5), ssh_config(5), ssh-keysign(8), | ||
683 | sshd(8) | ||
684 | |||
685 | T. Ylonen, T. Kivinen, M. Saarinen, T. Rinne, and S. Lehtinen, SSH | ||
686 | Protocol Architecture, draft-ietf-secsh-architecture-12.txt, January | ||
687 | 2002, work in progress material. | ||
688 | |||
689 | AUTHORS | ||
690 | OpenSSH is a derivative of the original and free ssh 1.2.12 release by | ||
691 | Tatu Ylonen. Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, Theo | ||
692 | de Raadt and Dug Song removed many bugs, re-added newer features and | ||
693 | created OpenSSH. Markus Friedl contributed the support for SSH protocol | ||
694 | versions 1.5 and 2.0. | ||
695 | |||
696 | OpenBSD 3.6 September 25, 1999 11 | ||