]>
Commit | Line | Data |
---|---|---|
bf740959 | 1 | .\" -*- nroff -*- |
2 | .\" | |
3 | .\" ssh.1.in | |
4 | .\" | |
5 | .\" Author: Tatu Ylonen <ylo@cs.hut.fi> | |
6 | .\" | |
7 | .\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland | |
8 | .\" All rights reserved | |
9 | .\" | |
10 | .\" Created: Sat Apr 22 21:55:14 1995 ylo | |
11 | .\" | |
12 | .\" $Id$ | |
13 | .\" | |
14 | .Dd September 25, 1999 | |
15 | .Dt SSH 1 | |
16 | .Os | |
17 | .Sh NAME | |
18 | .Nm ssh | |
19 | .Nd OpenSSH secure shell client (remote login program) | |
20 | .Sh SYNOPSIS | |
21 | .Nm ssh | |
22 | .Op Fl l Ar login_name | |
23 | .Op Ar hostname | user@hostname | |
24 | .Op Ar command | |
25 | .Pp | |
26 | .Nm ssh | |
48e671d5 | 27 | .Op Fl afgknqtvxCPX46 |
bf740959 | 28 | .Op Fl c Ar blowfish | 3des |
29 | .Op Fl e Ar escape_char | |
30 | .Op Fl i Ar identity_file | |
31 | .Op Fl l Ar login_name | |
32 | .Op Fl o Ar option | |
33 | .Op Fl p Ar port | |
34 | .Oo Fl L Xo | |
35 | .Sm off | |
bf740959 | 36 | .Ar port : |
7b2ea3a1 | 37 | .Ar host : |
bf740959 | 38 | .Ar hostport |
39 | .Sm on | |
40 | .Xc | |
41 | .Oc | |
42 | .Oo Fl R Xo | |
43 | .Sm off | |
bf740959 | 44 | .Ar port : |
7b2ea3a1 | 45 | .Ar host : |
bf740959 | 46 | .Ar hostport |
47 | .Sm on | |
48 | .Xc | |
49 | .Oc | |
50 | .Op Ar hostname | user@hostname | |
51 | .Op Ar command | |
52 | .Sh DESCRIPTION | |
53 | .Nm | |
54 | (Secure Shell) is a program for logging into a remote machine and for | |
55 | executing commands on a remote machine. It is intended to replace | |
56 | rlogin and rsh, and provide secure encrypted communications between | |
57 | two untrusted hosts over an insecure network. X11 connections and | |
58 | arbitrary TCP/IP ports can also be forwarded over the secure channel. | |
59 | .Pp | |
60 | .Nm | |
61 | connects and logs into the specified | |
62 | .Ar hostname . | |
63 | The user must prove | |
64 | his/her identity to the remote machine using one of several methods. | |
65 | .Pp | |
66 | First, if the machine the user logs in from is listed in | |
67 | .Pa /etc/hosts.equiv | |
68 | or | |
5f4fdfae | 69 | .Pa /etc/shosts.equiv |
bf740959 | 70 | on the remote machine, and the user names are |
71 | the same on both sides, the user is immediately permitted to log in. | |
72 | Second, if | |
73 | .Pa \&.rhosts | |
74 | or | |
75 | .Pa \&.shosts | |
76 | exists in the user's home directory on the | |
77 | remote machine and contains a line containing the name of the client | |
78 | machine and the name of the user on that machine, the user is | |
79 | permitted to log in. This form of authentication alone is normally not | |
80 | allowed by the server because it is not secure. | |
81 | .Pp | |
82 | The second (and primary) authentication method is the | |
83 | .Pa rhosts | |
84 | or | |
85 | .Pa hosts.equiv | |
86 | method combined with RSA-based host authentication. It | |
87 | means that if the login would be permitted by | |
88 | .Pa \&.rhosts , | |
89 | .Pa \&.shosts , | |
90 | .Pa /etc/hosts.equiv , | |
91 | or | |
5f4fdfae | 92 | .Pa /etc/shosts.equiv , |
bf740959 | 93 | and if additionally the server can verify the client's |
94 | host key (see | |
5f4fdfae | 95 | .Pa /etc/ssh_known_hosts |
5bbb5681 | 96 | and |
97 | .Pa $HOME/.ssh/known_hosts | |
bf740959 | 98 | in the |
99 | .Sx FILES | |
100 | section), only then login is | |
101 | permitted. This authentication method closes security holes due to IP | |
102 | spoofing, DNS spoofing and routing spoofing. [Note to the | |
103 | administrator: | |
104 | .Pa /etc/hosts.equiv , | |
105 | .Pa \&.rhosts , | |
106 | and the rlogin/rsh protocol in general, are inherently insecure and should be | |
107 | disabled if security is desired.] | |
108 | .Pp | |
109 | As a third authentication method, | |
110 | .Nm | |
111 | supports RSA based authentication. | |
112 | The scheme is based on public-key cryptography: there are cryptosystems | |
113 | where encryption and decryption are done using separate keys, and it | |
114 | is not possible to derive the decryption key from the encryption key. | |
115 | RSA is one such system. The idea is that each user creates a public/private | |
116 | key pair for authentication purposes. The | |
117 | server knows the public key, and only the user knows the private key. | |
118 | The file | |
119 | .Pa $HOME/.ssh/authorized_keys | |
120 | lists the public keys that are permitted for logging | |
121 | in. When the user logs in, the | |
122 | .Nm | |
123 | program tells the server which key pair it would like to use for | |
124 | authentication. The server checks if this key is permitted, and if | |
125 | so, sends the user (actually the | |
126 | .Nm | |
127 | program running on behalf of the user) a challenge, a random number, | |
128 | encrypted by the user's public key. The challenge can only be | |
129 | decrypted using the proper private key. The user's client then decrypts the | |
130 | challenge using the private key, proving that he/she knows the private | |
131 | key but without disclosing it to the server. | |
132 | .Pp | |
133 | .Nm | |
134 | implements the RSA authentication protocol automatically. The user | |
135 | creates his/her RSA key pair by running | |
136 | .Xr ssh-keygen 1 . | |
137 | This stores the private key in | |
138 | .Pa \&.ssh/identity | |
139 | and the public key in | |
140 | .Pa \&.ssh/identity.pub | |
141 | in the user's home directory. The user should then | |
142 | copy the | |
143 | .Pa identity.pub | |
144 | to | |
145 | .Pa \&.ssh/authorized_keys | |
146 | in his/her home directory on the remote machine (the | |
147 | .Pa authorized_keys | |
148 | file corresponds to the conventional | |
149 | .Pa \&.rhosts | |
150 | file, and has one key | |
151 | per line, though the lines can be very long). After this, the user | |
152 | can log in without giving the password. RSA authentication is much | |
153 | more secure than rhosts authentication. | |
154 | .Pp | |
155 | The most convenient way to use RSA authentication may be with an | |
156 | authentication agent. See | |
157 | .Xr ssh-agent 1 | |
158 | for more information. | |
159 | .Pp | |
160 | If other authentication methods fail, | |
161 | .Nm | |
162 | prompts the user for a password. The password is sent to the remote | |
163 | host for checking; however, since all communications are encrypted, | |
164 | the password cannot be seen by someone listening on the network. | |
165 | .Pp | |
166 | When the user's identity has been accepted by the server, the server | |
167 | either executes the given command, or logs into the machine and gives | |
168 | the user a normal shell on the remote machine. All communication with | |
169 | the remote command or shell will be automatically encrypted. | |
170 | .Pp | |
171 | If a pseudo-terminal has been allocated (normal login session), the | |
172 | user can disconnect with | |
173 | .Ic ~. , | |
174 | and suspend | |
175 | .Nm | |
176 | with | |
177 | .Ic ~^Z . | |
178 | All forwarded connections can be listed with | |
179 | .Ic ~# | |
180 | and if | |
181 | the session blocks waiting for forwarded X11 or TCP/IP | |
182 | connections to terminate, it can be backgrounded with | |
183 | .Ic ~& | |
184 | (this should not be used while the user shell is active, as it can cause the | |
185 | shell to hang). All available escapes can be listed with | |
186 | .Ic ~? . | |
187 | .Pp | |
188 | A single tilde character can be sent as | |
189 | .Ic ~~ | |
190 | (or by following the tilde by a character other than those described above). | |
191 | The escape character must always follow a newline to be interpreted as | |
192 | special. The escape character can be changed in configuration files | |
193 | or on the command line. | |
194 | .Pp | |
195 | If no pseudo tty has been allocated, the | |
196 | session is transparent and can be used to reliably transfer binary | |
197 | data. On most systems, setting the escape character to | |
198 | .Dq none | |
199 | will also make the session transparent even if a tty is used. | |
200 | .Pp | |
201 | The session terminates when the command or shell in on the remote | |
202 | machine exists and all X11 and TCP/IP connections have been closed. | |
203 | The exit status of the remote program is returned as the exit status | |
204 | of | |
205 | .Nm ssh . | |
206 | .Pp | |
207 | If the user is using X11 (the | |
208 | .Ev DISPLAY | |
209 | environment variable is set), the connection to the X11 display is | |
210 | automatically forwarded to the remote side in such a way that any X11 | |
211 | programs started from the shell (or command) will go through the | |
212 | encrypted channel, and the connection to the real X server will be made | |
213 | from the local machine. The user should not manually set | |
214 | .Ev DISPLAY . | |
215 | Forwarding of X11 connections can be | |
216 | configured on the command line or in configuration files. | |
217 | .Pp | |
218 | The | |
219 | .Ev DISPLAY | |
220 | value set by | |
221 | .Nm | |
222 | will point to the server machine, but with a display number greater | |
223 | than zero. This is normal, and happens because | |
224 | .Nm | |
225 | creates a | |
226 | .Dq proxy | |
227 | X server on the server machine for forwarding the | |
228 | connections over the encrypted channel. | |
229 | .Pp | |
230 | .Nm | |
231 | will also automatically set up Xauthority data on the server machine. | |
232 | For this purpose, it will generate a random authorization cookie, | |
233 | store it in Xauthority on the server, and verify that any forwarded | |
234 | connections carry this cookie and replace it by the real cookie when | |
235 | the connection is opened. The real authentication cookie is never | |
236 | sent to the server machine (and no cookies are sent in the plain). | |
237 | .Pp | |
238 | If the user is using an authentication agent, the connection to the agent | |
239 | is automatically forwarded to the remote side unless disabled on | |
240 | command line or in a configuration file. | |
241 | .Pp | |
242 | Forwarding of arbitrary TCP/IP connections over the secure channel can | |
243 | be specified either on command line or in a configuration file. One | |
244 | possible application of TCP/IP forwarding is a secure connection to an | |
245 | electronic purse; another is going trough firewalls. | |
246 | .Pp | |
247 | .Nm | |
248 | automatically maintains and checks a database containing RSA-based | |
249 | identifications for all hosts it has ever been used with. The | |
250 | database is stored in | |
251 | .Pa \&.ssh/known_hosts | |
252 | in the user's home directory. Additionally, the file | |
5f4fdfae | 253 | .Pa /etc/ssh_known_hosts |
bf740959 | 254 | is automatically checked for known hosts. Any new hosts are |
255 | automatically added to the user's file. If a host's identification | |
256 | ever changes, | |
257 | .Nm | |
258 | warns about this and disables password authentication to prevent a | |
259 | trojan horse from getting the user's password. Another purpose of | |
260 | this mechanism is to prevent man-in-the-middle attacks which could | |
261 | otherwise be used to circumvent the encryption. The | |
262 | .Cm StrictHostKeyChecking | |
263 | option (see below) can be used to prevent logins to machines whose | |
264 | host key is not known or has changed. | |
265 | .Sh OPTIONS | |
266 | .Bl -tag -width Ds | |
267 | .It Fl a | |
268 | Disables forwarding of the authentication agent connection. This may | |
269 | also be specified on a per-host basis in the configuration file. | |
270 | .It Fl c Ar blowfish|3des | |
271 | Selects the cipher to use for encrypting the session. | |
272 | .Ar 3des | |
273 | is used by default. It is believed to be secure. | |
274 | .Ar 3des | |
275 | (triple-des) is an encrypt-decrypt-encrypt triple with three different keys. | |
276 | It is presumably more secure than the | |
277 | .Ar des | |
278 | cipher which is no longer supported in ssh. | |
279 | .Ar blowfish | |
280 | is a fast block cipher, it appears very secure and is much faster than | |
281 | .Ar 3des . | |
282 | .It Fl e Ar ch|^ch|none | |
283 | Sets the escape character for sessions with a pty (default: | |
284 | .Ql ~ ) . | |
285 | The escape character is only recognized at the beginning of a line. The | |
286 | escape character followed by a dot | |
287 | .Pq Ql \&. | |
288 | closes the connection, followed | |
289 | by control-Z suspends the connection, and followed by itself sends the | |
290 | escape character once. Setting the character to | |
291 | .Dq none | |
292 | disables any escapes and makes the session fully transparent. | |
293 | .It Fl f | |
294 | Requests | |
295 | .Nm | |
aa3378df | 296 | to go to background just before command execution. This is useful |
bf740959 | 297 | if |
298 | .Nm | |
299 | is going to ask for passwords or passphrases, but the user | |
300 | wants it in the background. This implies | |
301 | .Fl n . | |
302 | The recommended way to start X11 programs at a remote site is with | |
303 | something like | |
304 | .Ic ssh -f host xterm . | |
7b2ea3a1 | 305 | .It Fl g |
306 | Allows remote hosts to connect to local forwarded ports. | |
bf740959 | 307 | .It Fl i Ar identity_file |
308 | Selects the file from which the identity (private key) for | |
309 | RSA authentication is read. Default is | |
310 | .Pa \&.ssh/identity | |
311 | in the user's home directory. Identity files may also be specified on | |
312 | a per-host basis in the configuration file. It is possible to have | |
313 | multiple | |
314 | .Fl i | |
315 | options (and multiple identities specified in | |
316 | configuration files). | |
bf740959 | 317 | .It Fl k |
318 | Disables forwarding of Kerberos tickets and AFS tokens. This may | |
319 | also be specified on a per-host basis in the configuration file. | |
320 | .It Fl l Ar login_name | |
321 | Specifies the user to log in as on the remote machine. This may also | |
322 | be specified on a per-host basis in the configuration file. | |
323 | .It Fl n | |
324 | Redirects stdin from | |
325 | .Pa /dev/null | |
326 | (actually, prevents reading from stdin). | |
327 | This must be used when | |
328 | .Nm | |
329 | is run in the background. A common trick is to use this to run X11 | |
330 | programs in a remote machine. For example, | |
331 | .Ic ssh -n shadows.cs.hut.fi emacs & | |
332 | will start an emacs on shadows.cs.hut.fi, and the X11 | |
333 | connection will be automatically forwarded over an encrypted channel. | |
334 | The | |
335 | .Nm | |
336 | program will be put in the background. | |
337 | (This does not work if | |
338 | .Nm | |
339 | needs to ask for a password or passphrase; see also the | |
340 | .Fl f | |
341 | option.) | |
342 | .It Fl o Ar option | |
343 | Can be used to give options in the format used in the config file. | |
344 | This is useful for specifying options for which there is no separate | |
345 | command-line flag. The option has the same format as a line in the | |
346 | configuration file. | |
347 | .It Fl p Ar port | |
348 | Port to connect to on the remote host. This can be specified on a | |
349 | per-host basis in the configuration file. | |
350 | .It Fl P | |
351 | Use a non-privileged port for outgoing connections. | |
352 | This can be used if your firewall does | |
353 | not permit connections from privileged ports. | |
95f1eccc | 354 | Note that this option turns off |
bf740959 | 355 | .Cm RhostsAuthentication |
356 | and | |
357 | .Cm RhostsRSAAuthentication . | |
358 | .It Fl q | |
359 | Quiet mode. Causes all warning and diagnostic messages to be | |
360 | suppressed. Only fatal errors are displayed. | |
361 | .It Fl t | |
362 | Force pseudo-tty allocation. This can be used to execute arbitary | |
363 | screen-based programs on a remote machine, which can be very useful | |
364 | e.g. when implementing menu services. | |
365 | .It Fl v | |
366 | Verbose mode. Causes | |
367 | .Nm | |
368 | to print debugging messages about its progress. This is helpful in | |
369 | debugging connection, authentication, and configuration problems. | |
370 | The verbose mode is also used to display | |
371 | .Xr skey 1 | |
372 | challenges, if the user entered "s/key" as password. | |
373 | .It Fl x | |
374 | Disables X11 forwarding. This can also be specified on a per-host | |
375 | basis in a configuration file. | |
376 | .It Fl X | |
377 | Enables X11 forwarding. | |
378 | .It Fl C | |
379 | Requests compression of all data (including stdin, stdout, stderr, and | |
380 | data for forwarded X11 and TCP/IP connections). The compression | |
7b2ea3a1 | 381 | algorithm is the same used by |
382 | .Xr gzip 1 , | |
383 | and the | |
bf740959 | 384 | .Dq level |
385 | can be controlled by the | |
386 | .Cm CompressionLevel | |
387 | option (see below). Compression is desirable on modem lines and other | |
388 | slow connections, but will only slow down things on fast networks. | |
389 | The default value can be set on a host-by-host basis in the | |
390 | configuration files; see the | |
391 | .Cm Compress | |
392 | option below. | |
393 | .It Fl L Ar port:host:hostport | |
394 | Specifies that the given port on the local (client) host is to be | |
395 | forwarded to the given host and port on the remote side. This works | |
396 | by allocating a socket to listen to | |
397 | .Ar port | |
398 | on the local side, and whenever a connection is made to this port, the | |
399 | connection is forwarded over the secure channel, and a connection is | |
400 | made to | |
48e671d5 | 401 | .Ar host |
402 | port | |
403 | .Ar hostport | |
bf740959 | 404 | from the remote machine. Port forwardings can also be specified in the |
405 | configuration file. Only root can forward privileged ports. | |
48e671d5 | 406 | IPv6 addresses can be specified with an alternative syntax: |
407 | .Ar port/host/hostport | |
bf740959 | 408 | .It Fl R Ar port:host:hostport |
409 | Specifies that the given port on the remote (server) host is to be | |
410 | forwarded to the given host and port on the local side. This works | |
411 | by allocating a socket to listen to | |
412 | .Ar port | |
413 | on the remote side, and whenever a connection is made to this port, the | |
414 | connection is forwarded over the secure channel, and a connection is | |
415 | made to | |
48e671d5 | 416 | .Ar host |
417 | port | |
418 | .Ar hostport | |
bf740959 | 419 | from the local machine. Port forwardings can also be specified in the |
420 | configuration file. Privileged ports can be forwarded only when | |
421 | logging in as root on the remote machine. | |
48e671d5 | 422 | .It Fl 4 |
423 | Forces | |
424 | .Nm | |
425 | to use IPv4 addresses only. | |
426 | .It Fl 6 | |
427 | Forces | |
428 | .Nm | |
429 | to use IPv6 addresses only. | |
bf740959 | 430 | .El |
431 | .Sh CONFIGURATION FILES | |
432 | .Nm | |
433 | obtains configuration data from the following sources (in this order): | |
434 | command line options, user's configuration file | |
435 | .Pq Pa $HOME/.ssh/config , | |
436 | and system-wide configuration file | |
5f4fdfae | 437 | .Pq Pa /etc/ssh_config . |
bf740959 | 438 | For each parameter, the first obtained value |
439 | will be used. The configuration files contain sections bracketed by | |
440 | "Host" specifications, and that section is only applied for hosts that | |
441 | match one of the patterns given in the specification. The matched | |
442 | host name is the one given on the command line. | |
443 | .Pp | |
444 | Since the first obtained value for each parameter is used, more | |
445 | host-specific declarations should be given near the beginning of the | |
446 | file, and general defaults at the end. | |
447 | .Pp | |
448 | The configuration file has the following format: | |
449 | .Pp | |
450 | Empty lines and lines starting with | |
451 | .Ql # | |
452 | are comments. | |
453 | .Pp | |
454 | Otherwise a line is of the format | |
455 | .Dq keyword arguments . | |
456 | The possible | |
457 | keywords and their meanings are as follows (note that the | |
458 | configuration files are case-sensitive): | |
459 | .Bl -tag -width Ds | |
460 | .It Cm Host | |
461 | Restricts the following declarations (up to the next | |
462 | .Cm Host | |
463 | keyword) to be only for those hosts that match one of the patterns | |
464 | given after the keyword. | |
465 | .Ql \&* | |
466 | and | |
467 | .Ql ? | |
468 | can be used as wildcards in the | |
469 | patterns. A single | |
470 | .Ql \&* | |
471 | as a pattern can be used to provide global | |
472 | defaults for all hosts. The host is the | |
473 | .Ar hostname | |
474 | argument given on the command line (i.e., the name is not converted to | |
475 | a canonicalized host name before matching). | |
476 | .It Cm AFSTokenPassing | |
477 | Specifies whether to pass AFS tokens to remote host. The argument to | |
478 | this keyword must be | |
479 | .Dq yes | |
480 | or | |
481 | .Dq no . | |
482 | .It Cm BatchMode | |
483 | If set to | |
484 | .Dq yes , | |
485 | passphrase/password querying will be disabled. This | |
486 | option is useful in scripts and other batch jobs where you have no | |
487 | user to supply the password. The argument must be | |
488 | .Dq yes | |
489 | or | |
490 | .Dq no . | |
7b2ea3a1 | 491 | .It Cm CheckHostIP |
492 | If this flag is set to | |
493 | .Dq yes , | |
494 | ssh will additionally check the host ip address in the | |
495 | .Pa known_hosts | |
496 | file. This allows ssh to detect if a host key changed due to DNS spoofing. | |
497 | If the option is set to | |
498 | .Dq no , | |
499 | the check will not be executed. | |
bf740959 | 500 | .It Cm Cipher |
501 | Specifies the cipher to use for encrypting the session. Currently, | |
502 | .Dq blowfish , | |
503 | and | |
504 | .Dq 3des | |
505 | are supported. The default is | |
506 | .Dq 3des . | |
507 | .It Cm Compression | |
508 | Specifies whether to use compression. The argument must be | |
509 | .Dq yes | |
510 | or | |
511 | .Dq no . | |
512 | .It Cm CompressionLevel | |
513 | Specifies the compression level to use if compression is enable. The | |
514 | argument must be an integer from 1 (fast) to 9 (slow, best). The | |
515 | default level is 6, which is good for most applications. The meaning | |
7b2ea3a1 | 516 | of the values is the same as in |
517 | .Xr gzip 1 . | |
bf740959 | 518 | .It Cm ConnectionAttempts |
519 | Specifies the number of tries (one per second) to make before falling | |
520 | back to rsh or exiting. The argument must be an integer. This may be | |
521 | useful in scripts if the connection sometimes fails. | |
522 | .It Cm EscapeChar | |
523 | Sets the escape character (default: | |
524 | .Ql ~ ) . | |
525 | The escape character can also | |
526 | be set on the command line. The argument should be a single | |
527 | character, | |
528 | .Ql ^ | |
529 | followed by a letter, or | |
530 | .Dq none | |
531 | to disable the escape | |
532 | character entirely (making the connection transparent for binary | |
533 | data). | |
534 | .It Cm FallBackToRsh | |
535 | Specifies that if connecting via | |
536 | .Nm | |
537 | fails due to a connection refused error (there is no | |
538 | .Xr sshd 8 | |
539 | listening on the remote host), | |
540 | .Xr rsh 1 | |
541 | should automatically be used instead (after a suitable warning about | |
542 | the session being unencrypted). The argument must be | |
543 | .Dq yes | |
544 | or | |
545 | .Dq no . | |
546 | .It Cm ForwardAgent | |
547 | Specifies whether the connection to the authentication agent (if any) | |
548 | will be forwarded to the remote machine. The argument must be | |
549 | .Dq yes | |
550 | or | |
551 | .Dq no . | |
552 | .It Cm ForwardX11 | |
553 | Specifies whether X11 connections will be automatically redirected | |
554 | over the secure channel and | |
555 | .Ev DISPLAY | |
556 | set. The argument must be | |
557 | .Dq yes | |
558 | or | |
559 | .Dq no . | |
560 | .It Cm GatewayPorts | |
561 | Specifies whether remote hosts are allowed to connect to local | |
562 | forwarded ports. | |
563 | The argument must be | |
564 | .Dq yes | |
565 | or | |
566 | .Dq no . | |
567 | The default is | |
568 | .Dq no . | |
569 | .It Cm GlobalKnownHostsFile | |
570 | Specifies a file to use instead of | |
5f4fdfae | 571 | .Pa /etc/ssh_known_hosts . |
bf740959 | 572 | .It Cm HostName |
573 | Specifies the real host name to log into. This can be used to specify | |
574 | nicnames or abbreviations for hosts. Default is the name given on the | |
575 | command line. Numeric IP addresses are also permitted (both on the | |
576 | command line and in | |
577 | .Cm HostName | |
578 | specifications). | |
579 | .It Cm IdentityFile | |
580 | Specifies the file from which the user's RSA authentication identity | |
581 | is read (default | |
582 | .Pa .ssh/identity | |
583 | in the user's home directory). | |
584 | Additionally, any identities represented by the authentication agent | |
585 | will be used for authentication. The file name may use the tilde | |
586 | syntax to refer to a user's home directory. It is possible to have | |
587 | multiple identity files specified in configuration files; all these | |
588 | identities will be tried in sequence. | |
589 | .It Cm KeepAlive | |
590 | Specifies whether the system should send keepalive messages to the | |
591 | other side. If they are sent, death of the connection or crash of one | |
592 | of the machines will be properly noticed. However, this means that | |
593 | connections will die if the route is down temporarily, and some people | |
594 | find it annoying. | |
595 | .Pp | |
596 | The default is | |
597 | .Dq yes | |
598 | (to send keepalives), and the client will notice | |
599 | if the network goes down or the remote host dies. This is important | |
600 | in scripts, and many users want it too. | |
601 | .Pp | |
602 | To disable keepalives, the value should be set to | |
603 | .Dq no | |
604 | in both the server and the client configuration files. | |
605 | .It Cm KerberosAuthentication | |
606 | Specifies whether Kerberos authentication will be used. The argument to | |
607 | this keyword must be | |
608 | .Dq yes | |
609 | or | |
610 | .Dq no . | |
611 | .It Cm KerberosTgtPassing | |
612 | Specifies whether a Kerberos TGT will be forwarded to the server. This | |
613 | will only work if the Kerberos server is actually an AFS kaserver. The | |
614 | argument to this keyword must be | |
615 | .Dq yes | |
616 | or | |
617 | .Dq no . | |
618 | .It Cm LocalForward | |
619 | Specifies that a TCP/IP port on the local machine be forwarded over | |
620 | the secure channel to given host:port from the remote machine. The | |
621 | first argument must be a port number, and the second must be | |
622 | host:port. Multiple forwardings may be specified, and additional | |
623 | forwardings can be given on the command line. Only the root can | |
624 | forward privileged ports. | |
6a17f9c2 | 625 | .It Cm LogLevel |
626 | Gives the verbosity level that is used when logging messages from | |
627 | .Nm ssh . | |
628 | The possible values are: | |
629 | QUIET, FATAL, ERROR, INFO, CHAT and DEBUG. | |
630 | The default is INFO. | |
bf740959 | 631 | .It Cm NumberOfPasswordPrompts |
632 | Specifies the number of password prompts before giving up. The | |
633 | argument to this keyword must be an integer. Default is 3. | |
7b2ea3a1 | 634 | .It Cm PasswordAuthentication |
635 | Specifies whether to use password authentication. The argument to | |
636 | this keyword must be | |
637 | .Dq yes | |
638 | or | |
639 | .Dq no . | |
bf740959 | 640 | .It Cm Port |
641 | Specifies the port number to connect on the remote host. Default is | |
642 | 22. | |
643 | .It Cm ProxyCommand | |
644 | Specifies the command to use to connect to the server. The command | |
645 | string extends to the end of the line, and is executed with /bin/sh. | |
646 | In the command string, %h will be substituted by the host name to | |
647 | connect and %p by the port. The command can be basically anything, | |
648 | and should read from its stdin and write to its stdout. It should | |
649 | eventually connect an | |
650 | .Xr sshd 8 | |
651 | server running on some machine, or execute | |
652 | .Ic sshd -i | |
653 | somewhere. Host key management will be done using the | |
654 | HostName of the host being connected (defaulting to the name typed by | |
655 | the user). | |
57112b5a | 656 | Note that |
657 | .Cm CheckHostIP | |
658 | is not available for connects with a proxy command. | |
bf740959 | 659 | .Pp |
660 | .It Cm RemoteForward | |
661 | Specifies that a TCP/IP port on the remote machine be forwarded over | |
662 | the secure channel to given host:port from the local machine. The | |
663 | first argument must be a port number, and the second must be | |
664 | host:port. Multiple forwardings may be specified, and additional | |
665 | forwardings can be given on the command line. Only the root can | |
666 | forward privileged ports. | |
667 | .It Cm RhostsAuthentication | |
668 | Specifies whether to try rhosts based authentication. Note that this | |
669 | declaration only affects the client side and has no effect whatsoever | |
670 | on security. Disabling rhosts authentication may reduce | |
671 | authentication time on slow connections when rhosts authentication is | |
672 | not used. Most servers do not permit RhostsAuthentication because it | |
673 | is not secure (see RhostsRSAAuthentication). The argument to this | |
674 | keyword must be | |
675 | .Dq yes | |
676 | or | |
677 | .Dq no . | |
678 | .It Cm RhostsRSAAuthentication | |
679 | Specifies whether to try rhosts based authentication with RSA host | |
680 | authentication. This is the primary authentication method for most | |
681 | sites. The argument must be | |
682 | .Dq yes | |
683 | or | |
684 | .Dq no . | |
685 | .It Cm RSAAuthentication | |
686 | Specifies whether to try RSA authentication. The argument to this | |
687 | keyword must be | |
688 | .Dq yes | |
689 | or | |
690 | .Dq no . | |
691 | RSA authentication will only be | |
692 | attempted if the identity file exists, or an authentication agent is | |
693 | running. | |
5260325f | 694 | .It Cm SkeyAuthentication |
695 | Specifies whether to use | |
696 | .Xr skey 1 | |
697 | authentication. The argument to | |
698 | this keyword must be | |
699 | .Dq yes | |
700 | or | |
701 | .Dq no . | |
702 | The default is | |
703 | .Dq no . | |
bf740959 | 704 | .It Cm StrictHostKeyChecking |
705 | If this flag is set to | |
706 | .Dq yes , | |
707 | .Nm | |
708 | ssh will never automatically add host keys to the | |
709 | .Pa $HOME/.ssh/known_hosts | |
710 | file, and refuses to connect hosts whose host key has changed. This | |
711 | provides maximum protection against trojan horse attacks. However, it | |
712 | can be somewhat annoying if you don't have good | |
5f4fdfae | 713 | .Pa /etc/ssh_known_hosts |
bf740959 | 714 | files installed and frequently |
715 | connect new hosts. Basically this option forces the user to manually | |
716 | add any new hosts. Normally this option is disabled, and new hosts | |
717 | will automatically be added to the known host files. The host keys of | |
718 | known hosts will be verified automatically in either case. The | |
719 | argument must be | |
720 | .Dq yes | |
721 | or | |
722 | .Dq no . | |
bf740959 | 723 | .It Cm UsePrivilegedPort |
724 | Specifies whether to use a privileged port for outgoing connections. | |
725 | The argument must be | |
726 | .Dq yes | |
727 | or | |
728 | .Dq no . | |
729 | The default is | |
730 | .Dq yes . | |
731 | Note that setting this option to | |
732 | .Dq no | |
95f1eccc | 733 | turns off |
bf740959 | 734 | .Cm RhostsAuthentication |
735 | and | |
736 | .Cm RhostsRSAAuthentication . | |
7b2ea3a1 | 737 | .It Cm User |
738 | Specifies the user to log in as. This can be useful if you have a | |
739 | different user name in different machines. This saves the trouble of | |
740 | having to remember to give the user name on the command line. | |
741 | .It Cm UserKnownHostsFile | |
742 | Specifies a file to use instead of | |
743 | .Pa $HOME/.ssh/known_hosts . | |
bf740959 | 744 | .It Cm UseRsh |
745 | Specifies that rlogin/rsh should be used for this host. It is | |
746 | possible that the host does not at all support the | |
747 | .Nm | |
748 | protocol. This causes | |
749 | .Nm | |
750 | to immediately exec | |
751 | .Xr rsh 1 . | |
752 | All other options (except | |
753 | .Cm HostName ) | |
754 | are ignored if this has been specified. The argument must be | |
755 | .Dq yes | |
756 | or | |
757 | .Dq no . | |
758 | .Sh ENVIRONMENT | |
759 | .Nm | |
760 | will normally set the following environment variables: | |
761 | .Bl -tag -width Ds | |
762 | .It Ev DISPLAY | |
763 | The | |
764 | .Ev DISPLAY | |
765 | variable indicates the location of the X11 server. It is | |
766 | automatically set by | |
767 | .Nm | |
768 | to point to a value of the form | |
769 | .Dq hostname:n | |
770 | where hostname indicates | |
771 | the host where the shell runs, and n is an integer >= 1. Ssh uses | |
772 | this special value to forward X11 connections over the secure | |
773 | channel. The user should normally not set DISPLAY explicitly, as that | |
774 | will render the X11 connection insecure (and will require the user to | |
775 | manually copy any required authorization cookies). | |
776 | .It Ev HOME | |
777 | Set to the path of the user's home directory. | |
778 | .It Ev LOGNAME | |
779 | Synonym for | |
780 | .Ev USER ; | |
781 | set for compatibility with systems that use this variable. | |
782 | .It Ev MAIL | |
783 | Set to point the user's mailbox. | |
784 | .It Ev PATH | |
785 | Set to the default | |
786 | .Ev PATH , | |
787 | as specified when compiling | |
788 | .Nm ssh . | |
789 | .It Ev SSH_AUTH_SOCK | |
790 | indicates the path of a unix-domain socket used to communicate with the | |
791 | agent. | |
792 | .It Ev SSH_CLIENT | |
793 | Identifies the client end of the connection. The variable contains | |
794 | three space-separated values: client ip-address, client port number, | |
795 | and server port number. | |
796 | .It Ev SSH_TTY | |
797 | This is set to the name of the tty (path to the device) associated | |
798 | with the current shell or command. If the current session has no tty, | |
799 | this variable is not set. | |
800 | .It Ev TZ | |
801 | The timezone variable is set to indicate the present timezone if it | |
802 | was set when the daemon was started (e.i., the daemon passes the value | |
803 | on to new connections). | |
804 | .It Ev USER | |
805 | Set to the name of the user logging in. | |
806 | .El | |
807 | .Pp | |
808 | Additionally, | |
809 | .Nm | |
810 | reads | |
811 | .Pa $HOME/.ssh/environment , | |
812 | and adds lines of the format | |
813 | .Dq VARNAME=value | |
814 | to the environment. | |
815 | .Sh FILES | |
816 | .Bl -tag -width $HOME/.ssh/known_hosts | |
817 | .It Pa $HOME/.ssh/known_hosts | |
818 | Records host keys for all hosts the user has logged into (that are not | |
819 | in | |
5f4fdfae | 820 | .Pa /etc/ssh_known_hosts ) . |
bf740959 | 821 | See |
822 | .Xr sshd 8 . | |
bf740959 | 823 | .It Pa $HOME/.ssh/identity |
824 | Contains the RSA authentication identity of the user. This file | |
825 | contains sensitive data and should be readable by the user but not | |
826 | accessible by others (read/write/execute). | |
827 | Note that | |
828 | .Nm | |
829 | ignores this file if it is accessible by others. | |
830 | It is possible to specify a passphrase when | |
831 | generating the key; the passphrase will be used to encrypt the | |
832 | sensitive part of this file using 3DES. | |
833 | .It Pa $HOME/.ssh/identity.pub | |
834 | Contains the public key for authentication (public part of the | |
835 | identity file in human-readable form). The contents of this file | |
836 | should be added to | |
837 | .Pa $HOME/.ssh/authorized_keys | |
838 | on all machines | |
839 | where you wish to log in using RSA authentication. This file is not | |
840 | sensitive and can (but need not) be readable by anyone. This file is | |
841 | never used automatically and is not necessary; it is only provided for | |
842 | the convenience of the user. | |
843 | .It Pa $HOME/.ssh/config | |
844 | This is the per-user configuration file. The format of this file is | |
845 | described above. This file is used by the | |
846 | .Nm | |
847 | client. This file does not usually contain any sensitive information, | |
848 | but the recommended permissions are read/write for the user, and not | |
849 | accessible by others. | |
850 | .It Pa $HOME/.ssh/authorized_keys | |
851 | Lists the RSA keys that can be used for logging in as this user. The | |
852 | format of this file is described in the | |
853 | .Xr sshd 8 | |
854 | manual page. In the simplest form the format is the same as the .pub | |
855 | identity files (that is, each line contains the number of bits in | |
856 | modulus, public exponent, modulus, and comment fields, separated by | |
857 | spaces). This file is not highly sensitive, but the recommended | |
858 | permissions are read/write for the user, and not accessible by others. | |
5f4fdfae | 859 | .It Pa /etc/ssh_known_hosts |
bf740959 | 860 | Systemwide list of known host keys. This file should be prepared by the |
861 | system administrator to contain the public host keys of all machines in the | |
862 | organization. This file should be world-readable. This file contains | |
863 | public keys, one per line, in the following format (fields separated | |
864 | by spaces): system name, number of bits in modulus, public exponent, | |
865 | modulus, and optional comment field. When different names are used | |
866 | for the same machine, all such names should be listed, separated by | |
867 | commas. The format is described on the | |
868 | .Xr sshd 8 | |
869 | manual page. | |
870 | .Pp | |
871 | The canonical system name (as returned by name servers) is used by | |
872 | .Xr sshd 8 | |
873 | to verify the client host when logging in; other names are needed because | |
874 | .Nm | |
875 | does not convert the user-supplied name to a canonical name before | |
876 | checking the key, because someone with access to the name servers | |
877 | would then be able to fool host authentication. | |
5f4fdfae | 878 | .It Pa /etc/ssh_config |
bf740959 | 879 | Systemwide configuration file. This file provides defaults for those |
880 | values that are not specified in the user's configuration file, and | |
881 | for those users who do not have a configuration file. This file must | |
882 | be world-readable. | |
883 | .It Pa $HOME/.rhosts | |
884 | This file is used in | |
885 | .Pa \&.rhosts | |
886 | authentication to list the | |
887 | host/user pairs that are permitted to log in. (Note that this file is | |
888 | also used by rlogin and rsh, which makes using this file insecure.) | |
889 | Each line of the file contains a host name (in the canonical form | |
890 | returned by name servers), and then a user name on that host, | |
891 | separated by a space. One some machines this file may need to be | |
892 | world-readable if the user's home directory is on a NFS partition, | |
893 | because | |
894 | .Xr sshd 8 | |
895 | reads it as root. Additionally, this file must be owned by the user, | |
896 | and must not have write permissions for anyone else. The recommended | |
897 | permission for most machines is read/write for the user, and not | |
898 | accessible by others. | |
899 | .Pp | |
900 | Note that by default | |
901 | .Xr sshd 8 | |
902 | will be installed so that it requires successful RSA host | |
903 | authentication before permitting \s+2.\s0rhosts authentication. If your | |
904 | server machine does not have the client's host key in | |
5f4fdfae | 905 | .Pa /etc/ssh_known_hosts , |
bf740959 | 906 | you can store it in |
907 | .Pa $HOME/.ssh/known_hosts . | |
908 | The easiest way to do this is to | |
909 | connect back to the client from the server machine using ssh; this | |
910 | will automatically add the host key inxi | |
911 | .Pa $HOME/.ssh/known_hosts . | |
912 | .It Pa $HOME/.shosts | |
913 | This file is used exactly the same way as | |
914 | .Pa \&.rhosts . | |
915 | The purpose for | |
916 | having this file is to be able to use rhosts authentication with | |
917 | .Nm | |
918 | without permitting login with | |
919 | .Xr rlogin 1 | |
920 | or | |
921 | .Xr rsh 1 . | |
922 | .It Pa /etc/hosts.equiv | |
923 | This file is used during | |
924 | .Pa \&.rhosts authentication. It contains | |
925 | canonical hosts names, one per line (the full format is described on | |
926 | the | |
927 | .Xr sshd 8 | |
928 | manual page). If the client host is found in this file, login is | |
929 | automatically permitted provided client and server user names are the | |
930 | same. Additionally, successful RSA host authentication is normally | |
931 | required. This file should only be writable by root. | |
5f4fdfae | 932 | .It Pa /etc/shosts.equiv |
bf740959 | 933 | This file is processed exactly as |
934 | .Pa /etc/hosts.equiv . | |
935 | This file may be useful to permit logins using | |
936 | .Nm | |
937 | but not using rsh/rlogin. | |
5f4fdfae | 938 | .It Pa /etc/sshrc |
bf740959 | 939 | Commands in this file are executed by |
940 | .Nm | |
941 | when the user logs in just before the user's shell (or command) is started. | |
942 | See the | |
943 | .Xr sshd 8 | |
944 | manual page for more information. | |
945 | .It Pa $HOME/.ssh/rc | |
946 | Commands in this file are executed by | |
947 | .Nm | |
948 | when the user logs in just before the user's shell (or command) is | |
949 | started. | |
950 | See the | |
951 | .Xr sshd 8 | |
952 | manual page for more information. | |
83b7f649 | 953 | .It Pa $HOME/.ssh/environment |
954 | Contains additional definitions for environment variables, see section | |
955 | .Sx ENVIRONMENT | |
956 | above. | |
bf740959 | 957 | .It Pa libcrypto.so.X.1 |
958 | A version of this library which includes support for the RSA algorithm | |
959 | is required for proper operation. | |
960 | .Sh AUTHOR | |
961 | Tatu Ylonen <ylo@cs.hut.fi> | |
962 | .Pp | |
963 | Issues can be found from the SSH WWW home page: | |
964 | .Pp | |
965 | .Dl http://www.cs.hut.fi/ssh | |
966 | .Pp | |
967 | OpenSSH | |
968 | is a derivative of the original (free) ssh 1.2.12 release, but with bugs | |
969 | removed and newer features re-added. Rapidly after the 1.2.12 release, | |
970 | newer versions bore successively more restrictive licenses. This version | |
971 | of OpenSSH | |
972 | .Bl -bullet | |
973 | .It | |
974 | has all components of a restrictive nature (ie. patents, see | |
975 | .Xr ssl 8 ) | |
976 | directly removed from the source code; any licensed or patented components | |
977 | are chosen from | |
978 | external libraries. | |
979 | .It | |
980 | has been updated to support ssh protocol 1.5. | |
981 | .It | |
982 | contains added support for | |
983 | .Xr kerberos 8 | |
984 | authentication and ticket passing. | |
985 | .It | |
986 | supports one-time password authentication with | |
987 | .Xr skey 1 . | |
988 | .El | |
989 | .Pp | |
990 | The libraries described in | |
991 | .Xr ssl 8 | |
992 | are required for proper operation. | |
f095fcc7 | 993 | .Pp |
0c16a097 | 994 | OpenSSH has been created by Aaron Campbell, Bob Beck, Markus Friedl, |
f095fcc7 | 995 | Niels Provos, Theo de Raadt, and Dug Song. |
bf740959 | 996 | .Sh SEE ALSO |
997 | .Xr rlogin 1 , | |
998 | .Xr rsh 1 , | |
999 | .Xr scp 1 , | |
1000 | .Xr ssh-add 1 , | |
1001 | .Xr ssh-agent 1 , | |
1002 | .Xr ssh-keygen 1 , | |
1003 | .Xr telnet 1 , | |
1004 | .Xr sshd 8 , | |
1005 | .Xr ssl 8 |