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