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