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