Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1 | .\" -*- nroff -*- |
| 2 | .\" |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 3 | .\" Author: Tatu Ylonen <ylo@cs.hut.fi> |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 4 | .\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
| 5 | .\" All rights reserved |
| 6 | .\" |
Damien Miller | e4340be | 2000-09-16 13:29:08 +1100 | [diff] [blame] | 7 | .\" As far as I am concerned, the code I have written for this software |
| 8 | .\" can be used freely for any purpose. Any derived versions of this |
| 9 | .\" software must be clearly marked as such, and if the derived work is |
| 10 | .\" incompatible with the protocol description in the RFC file, it must be |
| 11 | .\" called by a name other than "ssh" or "Secure Shell". |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 12 | .\" |
Ben Lindstrom | 92a2e38 | 2001-03-05 06:59:27 +0000 | [diff] [blame] | 13 | .\" Copyright (c) 1999,2000 Markus Friedl. All rights reserved. |
| 14 | .\" Copyright (c) 1999 Aaron Campbell. All rights reserved. |
| 15 | .\" Copyright (c) 1999 Theo de Raadt. All rights reserved. |
Damien Miller | e4340be | 2000-09-16 13:29:08 +1100 | [diff] [blame] | 16 | .\" |
| 17 | .\" Redistribution and use in source and binary forms, with or without |
| 18 | .\" modification, are permitted provided that the following conditions |
| 19 | .\" are met: |
| 20 | .\" 1. Redistributions of source code must retain the above copyright |
| 21 | .\" notice, this list of conditions and the following disclaimer. |
| 22 | .\" 2. Redistributions in binary form must reproduce the above copyright |
| 23 | .\" notice, this list of conditions and the following disclaimer in the |
| 24 | .\" documentation and/or other materials provided with the distribution. |
| 25 | .\" |
| 26 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
| 27 | .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| 28 | .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| 29 | .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 30 | .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
| 31 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 32 | .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 33 | .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 34 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 35 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 36 | .\" |
Ben Lindstrom | 9ffdcb5 | 2001-04-20 12:50:51 +0000 | [diff] [blame^] | 37 | .\" $OpenBSD: ssh.1,v 1.104 2001/04/20 07:17:51 djm Exp $ |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 38 | .Dd September 25, 1999 |
| 39 | .Dt SSH 1 |
| 40 | .Os |
| 41 | .Sh NAME |
| 42 | .Nm ssh |
Ben Lindstrom | d58eb5f | 2001-03-07 06:07:22 +0000 | [diff] [blame] | 43 | .Nd OpenSSH SSH client (remote login program) |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 44 | .Sh SYNOPSIS |
| 45 | .Nm ssh |
| 46 | .Op Fl l Ar login_name |
| 47 | .Op Ar hostname | user@hostname |
| 48 | .Op Ar command |
| 49 | .Pp |
| 50 | .Nm ssh |
Ben Lindstrom | 5ab6ae1 | 2001-02-10 22:08:03 +0000 | [diff] [blame] | 51 | .Op Fl afgknqstvxACNPTX1246 |
Damien Miller | 30c3d42 | 2000-05-09 11:02:59 +1000 | [diff] [blame] | 52 | .Op Fl c Ar cipher_spec |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 53 | .Op Fl e Ar escape_char |
| 54 | .Op Fl i Ar identity_file |
| 55 | .Op Fl l Ar login_name |
Ben Lindstrom | 06b33aa | 2001-02-15 03:01:59 +0000 | [diff] [blame] | 56 | .Op Fl m Ar mac_spec |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 57 | .Op Fl o Ar option |
| 58 | .Op Fl p Ar port |
| 59 | .Oo Fl L Xo |
| 60 | .Sm off |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 61 | .Ar port : |
Damien Miller | 396691a | 2000-01-20 22:44:08 +1100 | [diff] [blame] | 62 | .Ar host : |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 63 | .Ar hostport |
| 64 | .Sm on |
| 65 | .Xc |
| 66 | .Oc |
| 67 | .Oo Fl R Xo |
| 68 | .Sm off |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 69 | .Ar port : |
Damien Miller | 396691a | 2000-01-20 22:44:08 +1100 | [diff] [blame] | 70 | .Ar host : |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 71 | .Ar hostport |
| 72 | .Sm on |
| 73 | .Xc |
| 74 | .Oc |
| 75 | .Op Ar hostname | user@hostname |
| 76 | .Op Ar command |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 77 | .Sh DESCRIPTION |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 78 | .Nm |
Ben Lindstrom | d58eb5f | 2001-03-07 06:07:22 +0000 | [diff] [blame] | 79 | (SSH client) is a program for logging into a remote machine and for |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 80 | executing commands on a remote machine. |
| 81 | It is intended to replace |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 82 | rlogin and rsh, and provide secure encrypted communications between |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 83 | two untrusted hosts over an insecure network. |
| 84 | X11 connections and |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 85 | arbitrary TCP/IP ports can also be forwarded over the secure channel. |
| 86 | .Pp |
| 87 | .Nm |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 88 | connects and logs into the specified |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 89 | .Ar hostname . |
| 90 | The user must prove |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 91 | his/her identity to the remote machine using one of several methods |
| 92 | depending on the protocol version used: |
| 93 | .Pp |
| 94 | .Ss SSH protocol version 1 |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 95 | .Pp |
| 96 | First, if the machine the user logs in from is listed in |
| 97 | .Pa /etc/hosts.equiv |
| 98 | or |
Damien Miller | 886c63a | 2000-01-20 23:13:36 +1100 | [diff] [blame] | 99 | .Pa /etc/shosts.equiv |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 100 | on the remote machine, and the user names are |
| 101 | the same on both sides, the user is immediately permitted to log in. |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 102 | Second, if |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 103 | .Pa \&.rhosts |
| 104 | or |
| 105 | .Pa \&.shosts |
| 106 | exists in the user's home directory on the |
| 107 | remote machine and contains a line containing the name of the client |
| 108 | machine and the name of the user on that machine, the user is |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 109 | permitted to log in. |
| 110 | This form of authentication alone is normally not |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 111 | allowed by the server because it is not secure. |
| 112 | .Pp |
| 113 | The second (and primary) authentication method is the |
| 114 | .Pa rhosts |
| 115 | or |
| 116 | .Pa hosts.equiv |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 117 | method combined with RSA-based host authentication. |
| 118 | It means that if the login would be permitted by |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 119 | .Pa $HOME/.rhosts , |
| 120 | .Pa $HOME/.shosts , |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 121 | .Pa /etc/hosts.equiv , |
| 122 | or |
Damien Miller | 886c63a | 2000-01-20 23:13:36 +1100 | [diff] [blame] | 123 | .Pa /etc/shosts.equiv , |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 124 | and if additionally the server can verify the client's |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 125 | host key (see |
Damien Miller | 886c63a | 2000-01-20 23:13:36 +1100 | [diff] [blame] | 126 | .Pa /etc/ssh_known_hosts |
Damien Miller | 33e511e | 1999-11-11 11:43:13 +1100 | [diff] [blame] | 127 | and |
| 128 | .Pa $HOME/.ssh/known_hosts |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 129 | in the |
| 130 | .Sx FILES |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 131 | section), only then login is permitted. |
| 132 | This authentication method closes security holes due to IP |
| 133 | spoofing, DNS spoofing and routing spoofing. |
| 134 | [Note to the administrator: |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 135 | .Pa /etc/hosts.equiv , |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 136 | .Pa $HOME/.rhosts , |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 137 | and the rlogin/rsh protocol in general, are inherently insecure and should be |
| 138 | disabled if security is desired.] |
| 139 | .Pp |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 140 | As a third authentication method, |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 141 | .Nm |
| 142 | supports RSA based authentication. |
| 143 | The scheme is based on public-key cryptography: there are cryptosystems |
| 144 | where encryption and decryption are done using separate keys, and it |
| 145 | is not possible to derive the decryption key from the encryption key. |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 146 | RSA is one such system. |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 147 | The idea is that each user creates a public/private |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 148 | key pair for authentication purposes. |
| 149 | The server knows the public key, and only the user knows the private key. |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 150 | The file |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 151 | .Pa $HOME/.ssh/authorized_keys |
| 152 | lists the public keys that are permitted for logging |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 153 | in. |
| 154 | When the user logs in, the |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 155 | .Nm |
| 156 | program tells the server which key pair it would like to use for |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 157 | authentication. |
| 158 | The server checks if this key is permitted, and if |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 159 | so, sends the user (actually the |
| 160 | .Nm |
| 161 | program running on behalf of the user) a challenge, a random number, |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 162 | encrypted by the user's public key. |
| 163 | The challenge can only be |
| 164 | decrypted using the proper private key. |
| 165 | The user's client then decrypts the |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 166 | challenge using the private key, proving that he/she knows the private |
| 167 | key but without disclosing it to the server. |
| 168 | .Pp |
| 169 | .Nm |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 170 | implements the RSA authentication protocol automatically. |
| 171 | The user creates his/her RSA key pair by running |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 172 | .Xr ssh-keygen 1 . |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 173 | This stores the private key in |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 174 | .Pa $HOME/.ssh/identity |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 175 | and the public key in |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 176 | .Pa $HOME/.ssh/identity.pub |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 177 | in the user's home directory. |
| 178 | The user should then copy the |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 179 | .Pa identity.pub |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 180 | to |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 181 | .Pa $HOME/.ssh/authorized_keys |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 182 | in his/her home directory on the remote machine (the |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 183 | .Pa authorized_keys |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 184 | file corresponds to the conventional |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 185 | .Pa $HOME/.rhosts |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 186 | file, and has one key |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 187 | per line, though the lines can be very long). |
| 188 | After this, the user can log in without giving the password. |
| 189 | RSA authentication is much |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 190 | more secure than rhosts authentication. |
| 191 | .Pp |
| 192 | The most convenient way to use RSA authentication may be with an |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 193 | authentication agent. |
| 194 | See |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 195 | .Xr ssh-agent 1 |
| 196 | for more information. |
| 197 | .Pp |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 198 | If other authentication methods fail, |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 199 | .Nm |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 200 | prompts the user for a password. |
| 201 | The password is sent to the remote |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 202 | host for checking; however, since all communications are encrypted, |
| 203 | the password cannot be seen by someone listening on the network. |
| 204 | .Pp |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 205 | .Ss SSH protocol version 2 |
| 206 | .Pp |
| 207 | When a user connects using the protocol version 2 |
| 208 | different authentication methods are available: |
| 209 | At first, the client attempts to authenticate using the public key method. |
| 210 | If this method fails password authentication is tried. |
| 211 | .Pp |
| 212 | The public key method is similar to RSA authentication described |
Damien Miller | 0bc1bd8 | 2000-11-13 22:57:25 +1100 | [diff] [blame] | 213 | in the previous section except that the DSA or RSA algorithm is used |
| 214 | instead. |
Ben Lindstrom | 18a82ac | 2001-04-11 15:59:35 +0000 | [diff] [blame] | 215 | The client uses his private key, |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 216 | .Pa $HOME/.ssh/id_dsa |
Ben Lindstrom | 18a82ac | 2001-04-11 15:59:35 +0000 | [diff] [blame] | 217 | or |
| 218 | .Pa $HOME/.ssh/id_rsa , |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 219 | to sign the session identifier and sends the result to the server. |
| 220 | The server checks whether the matching public key is listed in |
| 221 | .Pa $HOME/.ssh/authorized_keys2 |
| 222 | and grants access if both the key is found and the signature is correct. |
| 223 | The session identifier is derived from a shared Diffie-Hellman value |
| 224 | and is only known to the client and the server. |
| 225 | .Pp |
| 226 | If public key authentication fails or is not available a password |
| 227 | can be sent encrypted to the remote host for proving the user's identity. |
| 228 | This protocol 2 implementation does not yet support Kerberos or |
| 229 | S/Key authentication. |
| 230 | .Pp |
| 231 | Protocol 2 provides additional mechanisms for confidentiality |
Damien Miller | 30c3d42 | 2000-05-09 11:02:59 +1000 | [diff] [blame] | 232 | (the traffic is encrypted using 3DES, Blowfish, CAST128 or Arcfour) |
Ben Lindstrom | ec26fb1 | 2001-03-06 01:05:23 +0000 | [diff] [blame] | 233 | and integrity (hmac-md5, hmac-sha1). |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 234 | Note that protocol 1 lacks a strong mechanism for ensuring the |
| 235 | integrity of the connection. |
| 236 | .Pp |
| 237 | .Ss Login session and remote execution |
| 238 | .Pp |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 239 | When the user's identity has been accepted by the server, the server |
| 240 | either executes the given command, or logs into the machine and gives |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 241 | the user a normal shell on the remote machine. |
| 242 | All communication with |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 243 | the remote command or shell will be automatically encrypted. |
| 244 | .Pp |
| 245 | If a pseudo-terminal has been allocated (normal login session), the |
Ben Lindstrom | 9ffdcb5 | 2001-04-20 12:50:51 +0000 | [diff] [blame^] | 246 | user may use the escape characters noted below. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 247 | .Pp |
| 248 | If no pseudo tty has been allocated, the |
| 249 | session is transparent and can be used to reliably transfer binary |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 250 | data. |
| 251 | On most systems, setting the escape character to |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 252 | .Dq none |
| 253 | will also make the session transparent even if a tty is used. |
| 254 | .Pp |
Ben Lindstrom | a688561 | 2000-12-09 03:45:32 +0000 | [diff] [blame] | 255 | The session terminates when the command or shell on the remote |
Ben Lindstrom | ebd888d | 2001-03-05 05:49:29 +0000 | [diff] [blame] | 256 | machine exits and all X11 and TCP/IP connections have been closed. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 257 | The exit status of the remote program is returned as the exit status |
| 258 | of |
| 259 | .Nm ssh . |
| 260 | .Pp |
Ben Lindstrom | 9ffdcb5 | 2001-04-20 12:50:51 +0000 | [diff] [blame^] | 261 | .Ss Escape Characters |
| 262 | .Pp |
| 263 | When a pseudo terminal has been requested, ssh supports a number of functions |
| 264 | through the use of an escape charater. |
| 265 | .Pp |
| 266 | A single tilde character can be sent as |
| 267 | .Ic ~~ |
| 268 | (or by following the tilde by a character other than those described above). |
| 269 | The escape character must always follow a newline to be interpreted as |
| 270 | special. |
| 271 | The escape character can be changed in configuration files using the |
| 272 | .Cm EscapeChar |
| 273 | configuration directive or on the command line by the |
| 274 | .Fl e |
| 275 | option. |
| 276 | .Pp |
| 277 | The supported escapes (assuming the default |
| 278 | .Ql ~ ) |
| 279 | are: |
| 280 | .Bl -tag -width Ds |
| 281 | .It Cm ~. |
| 282 | Disconnect |
| 283 | .It Cm ~^Z |
| 284 | Background ssh |
| 285 | .It Cm ~# |
| 286 | List forwarded connections |
| 287 | .It Cm ~& |
| 288 | Background ssh at logout when waiting for forwarded connection / X11 sessions |
| 289 | to terminate (this does not currently work for SSH protocol version 2) |
| 290 | .It Cm ~? |
| 291 | Display a list of escape characters |
| 292 | .It Cm ~R |
| 293 | Request rekeying of connection (only useful for SSH protocol version 2 and if |
| 294 | the peer supports it) |
| 295 | .El |
| 296 | .Pp |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 297 | .Ss X11 and TCP forwarding |
| 298 | .Pp |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 299 | If the user is using X11 (the |
| 300 | .Ev DISPLAY |
| 301 | environment variable is set), the connection to the X11 display is |
| 302 | automatically forwarded to the remote side in such a way that any X11 |
| 303 | programs started from the shell (or command) will go through the |
| 304 | encrypted channel, and the connection to the real X server will be made |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 305 | from the local machine. |
| 306 | The user should not manually set |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 307 | .Ev DISPLAY . |
| 308 | Forwarding of X11 connections can be |
| 309 | configured on the command line or in configuration files. |
| 310 | .Pp |
| 311 | The |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 312 | .Ev DISPLAY |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 313 | value set by |
| 314 | .Nm |
| 315 | will point to the server machine, but with a display number greater |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 316 | than zero. |
| 317 | This is normal, and happens because |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 318 | .Nm |
| 319 | creates a |
| 320 | .Dq proxy |
| 321 | X server on the server machine for forwarding the |
| 322 | connections over the encrypted channel. |
| 323 | .Pp |
| 324 | .Nm |
| 325 | will also automatically set up Xauthority data on the server machine. |
| 326 | For this purpose, it will generate a random authorization cookie, |
| 327 | store it in Xauthority on the server, and verify that any forwarded |
| 328 | connections carry this cookie and replace it by the real cookie when |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 329 | the connection is opened. |
| 330 | The real authentication cookie is never |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 331 | sent to the server machine (and no cookies are sent in the plain). |
| 332 | .Pp |
| 333 | If the user is using an authentication agent, the connection to the agent |
| 334 | is automatically forwarded to the remote side unless disabled on |
| 335 | command line or in a configuration file. |
| 336 | .Pp |
| 337 | Forwarding of arbitrary TCP/IP connections over the secure channel can |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 338 | be specified either on command line or in a configuration file. |
| 339 | One possible application of TCP/IP forwarding is a secure connection to an |
Ben Lindstrom | ebd888d | 2001-03-05 05:49:29 +0000 | [diff] [blame] | 340 | electronic purse; another is going through firewalls. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 341 | .Pp |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 342 | .Ss Server authentication |
| 343 | .Pp |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 344 | .Nm |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 345 | automatically maintains and checks a database containing |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 346 | identifications for all hosts it has ever been used with. |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 347 | RSA host keys are stored in |
| 348 | .Pa $HOME/.ssh/known_hosts |
| 349 | and |
Damien Miller | 0bc1bd8 | 2000-11-13 22:57:25 +1100 | [diff] [blame] | 350 | host keys used in the protocol version 2 are stored in |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 351 | .Pa $HOME/.ssh/known_hosts2 |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 352 | in the user's home directory. |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 353 | Additionally, the files |
Damien Miller | 886c63a | 2000-01-20 23:13:36 +1100 | [diff] [blame] | 354 | .Pa /etc/ssh_known_hosts |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 355 | and |
| 356 | .Pa /etc/ssh_known_hosts2 |
| 357 | are automatically checked for known hosts. |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 358 | Any new hosts are automatically added to the user's file. |
| 359 | If a host's identification |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 360 | ever changes, |
| 361 | .Nm |
| 362 | warns about this and disables password authentication to prevent a |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 363 | trojan horse from getting the user's password. |
| 364 | Another purpose of |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 365 | this mechanism is to prevent man-in-the-middle attacks which could |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 366 | otherwise be used to circumvent the encryption. |
| 367 | The |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 368 | .Cm StrictHostKeyChecking |
| 369 | option (see below) can be used to prevent logins to machines whose |
| 370 | host key is not known or has changed. |
Damien Miller | 0bc1bd8 | 2000-11-13 22:57:25 +1100 | [diff] [blame] | 371 | .Pp |
| 372 | The options are as follows: |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 373 | .Bl -tag -width Ds |
| 374 | .It Fl a |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 375 | Disables forwarding of the authentication agent connection. |
Damien Miller | b1715dc | 2000-05-30 13:44:51 +1000 | [diff] [blame] | 376 | .It Fl A |
| 377 | Enables forwarding of the authentication agent connection. |
| 378 | This can also be specified on a per-host basis in a configuration file. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 379 | .It Fl c Ar blowfish|3des |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 380 | Selects the cipher to use for encrypting the session. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 381 | .Ar 3des |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 382 | is used by default. |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 383 | It is believed to be secure. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 384 | .Ar 3des |
| 385 | (triple-des) is an encrypt-decrypt-encrypt triple with three different keys. |
| 386 | It is presumably more secure than the |
| 387 | .Ar des |
Damien Miller | 69b69aa | 2000-10-28 14:19:58 +1100 | [diff] [blame] | 388 | cipher which is no longer fully supported in |
Damien Miller | 30c3d42 | 2000-05-09 11:02:59 +1000 | [diff] [blame] | 389 | .Nm ssh . |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 390 | .Ar blowfish |
| 391 | is a fast block cipher, it appears very secure and is much faster than |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 392 | .Ar 3des . |
Ben Lindstrom | 5ab6ae1 | 2001-02-10 22:08:03 +0000 | [diff] [blame] | 393 | .It Fl c Ar cipher_spec |
Damien Miller | 30c3d42 | 2000-05-09 11:02:59 +1000 | [diff] [blame] | 394 | Additionally, for protocol version 2 a comma-separated list of ciphers can |
Damien Miller | 874d77b | 2000-10-14 16:23:11 +1100 | [diff] [blame] | 395 | be specified in order of preference. |
Ben Lindstrom | 5ab6ae1 | 2001-02-10 22:08:03 +0000 | [diff] [blame] | 396 | See |
| 397 | .Cm Ciphers |
| 398 | for more information. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 399 | .It Fl e Ar ch|^ch|none |
| 400 | Sets the escape character for sessions with a pty (default: |
| 401 | .Ql ~ ) . |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 402 | The escape character is only recognized at the beginning of a line. |
| 403 | The escape character followed by a dot |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 404 | .Pq Ql \&. |
| 405 | closes the connection, followed |
| 406 | by control-Z suspends the connection, and followed by itself sends the |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 407 | escape character once. |
| 408 | Setting the character to |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 409 | .Dq none |
| 410 | disables any escapes and makes the session fully transparent. |
| 411 | .It Fl f |
| 412 | Requests |
| 413 | .Nm |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 414 | to go to background just before command execution. |
| 415 | This is useful if |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 416 | .Nm |
| 417 | is going to ask for passwords or passphrases, but the user |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 418 | wants it in the background. |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 419 | This implies |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 420 | .Fl n . |
| 421 | The recommended way to start X11 programs at a remote site is with |
| 422 | something like |
| 423 | .Ic ssh -f host xterm . |
Damien Miller | 396691a | 2000-01-20 22:44:08 +1100 | [diff] [blame] | 424 | .It Fl g |
| 425 | Allows remote hosts to connect to local forwarded ports. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 426 | .It Fl i Ar identity_file |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 427 | Selects the file from which the identity (private key) for |
Damien Miller | 0bc1bd8 | 2000-11-13 22:57:25 +1100 | [diff] [blame] | 428 | RSA or DSA authentication is read. |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 429 | Default is |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 430 | .Pa $HOME/.ssh/identity |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 431 | in the user's home directory. |
| 432 | Identity files may also be specified on |
| 433 | a per-host basis in the configuration file. |
| 434 | It is possible to have multiple |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 435 | .Fl i |
| 436 | options (and multiple identities specified in |
| 437 | configuration files). |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 438 | .It Fl k |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 439 | Disables forwarding of Kerberos tickets and AFS tokens. |
| 440 | This may also be specified on a per-host basis in the configuration file. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 441 | .It Fl l Ar login_name |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 442 | Specifies the user to log in as on the remote machine. |
| 443 | This also may be specified on a per-host basis in the configuration file. |
Ben Lindstrom | 06b33aa | 2001-02-15 03:01:59 +0000 | [diff] [blame] | 444 | .It Fl m Ar mac_spec |
| 445 | Additionally, for protocol version 2 a comma-separated list of MAC |
| 446 | (message authentication code) algorithms can |
| 447 | be specified in order of preference. |
| 448 | See the |
| 449 | .Cm MACs |
| 450 | keyword for more information. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 451 | .It Fl n |
| 452 | Redirects stdin from |
| 453 | .Pa /dev/null |
| 454 | (actually, prevents reading from stdin). |
| 455 | This must be used when |
| 456 | .Nm |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 457 | is run in the background. |
| 458 | A common trick is to use this to run X11 programs on a remote machine. |
| 459 | For example, |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 460 | .Ic ssh -n shadows.cs.hut.fi emacs & |
| 461 | will start an emacs on shadows.cs.hut.fi, and the X11 |
| 462 | connection will be automatically forwarded over an encrypted channel. |
| 463 | The |
| 464 | .Nm |
| 465 | program will be put in the background. |
| 466 | (This does not work if |
| 467 | .Nm |
| 468 | needs to ask for a password or passphrase; see also the |
| 469 | .Fl f |
| 470 | option.) |
Damien Miller | dcb6ecd | 2000-05-17 22:34:22 +1000 | [diff] [blame] | 471 | .It Fl N |
| 472 | Do not execute a remote command. |
Ben Lindstrom | c72745a | 2000-12-02 19:03:54 +0000 | [diff] [blame] | 473 | This is useful if you just want to forward ports |
Damien Miller | dcb6ecd | 2000-05-17 22:34:22 +1000 | [diff] [blame] | 474 | (protocol version 2 only). |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 475 | .It Fl o Ar option |
| 476 | Can be used to give options in the format used in the config file. |
| 477 | This is useful for specifying options for which there is no separate |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 478 | command-line flag. |
| 479 | The option has the same format as a line in the configuration file. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 480 | .It Fl p Ar port |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 481 | Port to connect to on the remote host. |
| 482 | This can be specified on a |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 483 | per-host basis in the configuration file. |
| 484 | .It Fl P |
| 485 | Use a non-privileged port for outgoing connections. |
| 486 | This can be used if your firewall does |
| 487 | not permit connections from privileged ports. |
Damien Miller | a34a28b | 1999-12-14 10:47:15 +1100 | [diff] [blame] | 488 | Note that this option turns off |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 489 | .Cm RhostsAuthentication |
| 490 | and |
Kevin Steves | fcec7f8 | 2000-12-15 19:55:48 +0000 | [diff] [blame] | 491 | .Cm RhostsRSAAuthentication |
| 492 | for older servers. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 493 | .It Fl q |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 494 | Quiet mode. |
| 495 | Causes all warning and diagnostic messages to be suppressed. |
| 496 | Only fatal errors are displayed. |
Damien Miller | 832562e | 2001-01-30 09:30:01 +1100 | [diff] [blame] | 497 | .It Fl s |
| 498 | May be used to request invocation of a subsystem on the remote system. Subsystems are a feature of the SSH2 protocol which facilitate the use |
| 499 | of SSH as a secure transport for other application (eg. sftp). The |
| 500 | subsystem is specified as the remote command. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 501 | .It Fl t |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 502 | Force pseudo-tty allocation. |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 503 | This can be used to execute arbitrary |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 504 | screen-based programs on a remote machine, which can be very useful, |
| 505 | e.g., when implementing menu services. |
Ben Lindstrom | 4dccfa5 | 2000-12-28 16:40:05 +0000 | [diff] [blame] | 506 | Multiple |
| 507 | .Fl t |
| 508 | options force tty allocation, even if |
| 509 | .Nm |
| 510 | has no local tty. |
Damien Miller | dcb6ecd | 2000-05-17 22:34:22 +1000 | [diff] [blame] | 511 | .It Fl T |
Ben Lindstrom | c72745a | 2000-12-02 19:03:54 +0000 | [diff] [blame] | 512 | Disable pseudo-tty allocation. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 513 | .It Fl v |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 514 | Verbose mode. |
| 515 | Causes |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 516 | .Nm |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 517 | to print debugging messages about its progress. |
| 518 | This is helpful in |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 519 | debugging connection, authentication, and configuration problems. |
Ben Lindstrom | 4dccfa5 | 2000-12-28 16:40:05 +0000 | [diff] [blame] | 520 | Multiple |
| 521 | .Fl v |
| 522 | options increases the verbosity. |
Damien Miller | 874d77b | 2000-10-14 16:23:11 +1100 | [diff] [blame] | 523 | Maximum is 3. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 524 | .It Fl x |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 525 | Disables X11 forwarding. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 526 | .It Fl X |
| 527 | Enables X11 forwarding. |
Damien Miller | b1715dc | 2000-05-30 13:44:51 +1000 | [diff] [blame] | 528 | This can also be specified on a per-host basis in a configuration file. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 529 | .It Fl C |
| 530 | Requests compression of all data (including stdin, stdout, stderr, and |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 531 | data for forwarded X11 and TCP/IP connections). |
| 532 | The compression algorithm is the same used by |
Damien Miller | 396691a | 2000-01-20 22:44:08 +1100 | [diff] [blame] | 533 | .Xr gzip 1 , |
| 534 | and the |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 535 | .Dq level |
| 536 | can be controlled by the |
| 537 | .Cm CompressionLevel |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 538 | option (see below). |
| 539 | Compression is desirable on modem lines and other |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 540 | slow connections, but will only slow down things on fast networks. |
| 541 | The default value can be set on a host-by-host basis in the |
| 542 | configuration files; see the |
| 543 | .Cm Compress |
| 544 | option below. |
| 545 | .It Fl L Ar port:host:hostport |
| 546 | Specifies that the given port on the local (client) host is to be |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 547 | forwarded to the given host and port on the remote side. |
| 548 | This works by allocating a socket to listen to |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 549 | .Ar port |
| 550 | on the local side, and whenever a connection is made to this port, the |
| 551 | connection is forwarded over the secure channel, and a connection is |
| 552 | made to |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 553 | .Ar host |
| 554 | port |
| 555 | .Ar hostport |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 556 | from the remote machine. |
| 557 | Port forwardings can also be specified in the configuration file. |
| 558 | Only root can forward privileged ports. |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 559 | IPv6 addresses can be specified with an alternative syntax: |
| 560 | .Ar port/host/hostport |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 561 | .It Fl R Ar port:host:hostport |
| 562 | Specifies that the given port on the remote (server) host is to be |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 563 | forwarded to the given host and port on the local side. |
| 564 | This works by allocating a socket to listen to |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 565 | .Ar port |
| 566 | on the remote side, and whenever a connection is made to this port, the |
| 567 | connection is forwarded over the secure channel, and a connection is |
| 568 | made to |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 569 | .Ar host |
| 570 | port |
| 571 | .Ar hostport |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 572 | from the local machine. |
| 573 | Port forwardings can also be specified in the configuration file. |
| 574 | Privileged ports can be forwarded only when |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 575 | logging in as root on the remote machine. |
Ben Lindstrom | 5ab6ae1 | 2001-02-10 22:08:03 +0000 | [diff] [blame] | 576 | .It Fl 1 |
| 577 | Forces |
| 578 | .Nm |
| 579 | to try protocol version 1 only. |
Damien Miller | 4af5130 | 2000-04-16 11:18:38 +1000 | [diff] [blame] | 580 | .It Fl 2 |
| 581 | Forces |
| 582 | .Nm |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 583 | to try protocol version 2 only. |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 584 | .It Fl 4 |
| 585 | Forces |
| 586 | .Nm |
| 587 | to use IPv4 addresses only. |
| 588 | .It Fl 6 |
| 589 | Forces |
| 590 | .Nm |
| 591 | to use IPv6 addresses only. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 592 | .El |
| 593 | .Sh CONFIGURATION FILES |
| 594 | .Nm |
| 595 | obtains configuration data from the following sources (in this order): |
| 596 | command line options, user's configuration file |
| 597 | .Pq Pa $HOME/.ssh/config , |
| 598 | and system-wide configuration file |
Damien Miller | 886c63a | 2000-01-20 23:13:36 +1100 | [diff] [blame] | 599 | .Pq Pa /etc/ssh_config . |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 600 | For each parameter, the first obtained value |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 601 | will be used. |
| 602 | The configuration files contain sections bracketed by |
| 603 | .Dq Host |
| 604 | specifications, and that section is only applied for hosts that |
| 605 | match one of the patterns given in the specification. |
| 606 | The matched host name is the one given on the command line. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 607 | .Pp |
| 608 | Since the first obtained value for each parameter is used, more |
| 609 | host-specific declarations should be given near the beginning of the |
| 610 | file, and general defaults at the end. |
| 611 | .Pp |
| 612 | The configuration file has the following format: |
| 613 | .Pp |
| 614 | Empty lines and lines starting with |
| 615 | .Ql # |
| 616 | are comments. |
| 617 | .Pp |
| 618 | Otherwise a line is of the format |
| 619 | .Dq keyword arguments . |
| 620 | The possible |
| 621 | keywords and their meanings are as follows (note that the |
| 622 | configuration files are case-sensitive): |
| 623 | .Bl -tag -width Ds |
| 624 | .It Cm Host |
| 625 | Restricts the following declarations (up to the next |
| 626 | .Cm Host |
| 627 | keyword) to be only for those hosts that match one of the patterns |
| 628 | given after the keyword. |
| 629 | .Ql \&* |
| 630 | and |
| 631 | .Ql ? |
| 632 | can be used as wildcards in the |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 633 | patterns. |
| 634 | A single |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 635 | .Ql \&* |
| 636 | as a pattern can be used to provide global |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 637 | defaults for all hosts. |
| 638 | The host is the |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 639 | .Ar hostname |
| 640 | argument given on the command line (i.e., the name is not converted to |
| 641 | a canonicalized host name before matching). |
| 642 | .It Cm AFSTokenPassing |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 643 | Specifies whether to pass AFS tokens to remote host. |
| 644 | The argument to this keyword must be |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 645 | .Dq yes |
| 646 | or |
| 647 | .Dq no . |
| 648 | .It Cm BatchMode |
| 649 | If set to |
| 650 | .Dq yes , |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 651 | passphrase/password querying will be disabled. |
| 652 | This option is useful in scripts and other batch jobs where you have no |
| 653 | user to supply the password. |
| 654 | The argument must be |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 655 | .Dq yes |
| 656 | or |
| 657 | .Dq no . |
Ben Lindstrom | 89b0bd6 | 2001-03-29 00:27:11 +0000 | [diff] [blame] | 658 | The default is |
| 659 | .Dq no . |
Damien Miller | 396691a | 2000-01-20 22:44:08 +1100 | [diff] [blame] | 660 | .It Cm CheckHostIP |
| 661 | If this flag is set to |
| 662 | .Dq yes , |
Ben Lindstrom | 89b0bd6 | 2001-03-29 00:27:11 +0000 | [diff] [blame] | 663 | ssh will additionally check the host IP address in the |
Damien Miller | 396691a | 2000-01-20 22:44:08 +1100 | [diff] [blame] | 664 | .Pa known_hosts |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 665 | file. |
| 666 | This allows ssh to detect if a host key changed due to DNS spoofing. |
Damien Miller | 396691a | 2000-01-20 22:44:08 +1100 | [diff] [blame] | 667 | If the option is set to |
| 668 | .Dq no , |
| 669 | the check will not be executed. |
Ben Lindstrom | 89b0bd6 | 2001-03-29 00:27:11 +0000 | [diff] [blame] | 670 | The default is |
| 671 | .Dq yes . |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 672 | .It Cm Cipher |
Damien Miller | 50a41ed | 2000-10-16 12:14:42 +1100 | [diff] [blame] | 673 | Specifies the cipher to use for encrypting the session |
Damien Miller | 69b69aa | 2000-10-28 14:19:58 +1100 | [diff] [blame] | 674 | in protocol version 1. |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 675 | Currently, |
Damien Miller | 69b69aa | 2000-10-28 14:19:58 +1100 | [diff] [blame] | 676 | .Dq blowfish |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 677 | and |
| 678 | .Dq 3des |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 679 | are supported. |
| 680 | The default is |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 681 | .Dq 3des . |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 682 | .It Cm Ciphers |
| 683 | Specifies the ciphers allowed for protocol version 2 |
| 684 | in order of preference. |
| 685 | Multiple ciphers must be comma-separated. |
| 686 | The default is |
Ben Lindstrom | 5ab6ae1 | 2001-02-10 22:08:03 +0000 | [diff] [blame] | 687 | .Pp |
| 688 | .Bd -literal |
Ben Lindstrom | ec26fb1 | 2001-03-06 01:05:23 +0000 | [diff] [blame] | 689 | ``aes128-cbc,3des-cbc,blowfish-cbc,cast128-cbc,arcfour, |
Ben Lindstrom | 5ab6ae1 | 2001-02-10 22:08:03 +0000 | [diff] [blame] | 690 | aes192-cbc,aes256-cbc,rijndael128-cbc,rijndael192-cbc, |
| 691 | rijndael256-cbc,rijndael-cbc@lysator.liu.se'' |
| 692 | .Ed |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 693 | .It Cm Compression |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 694 | Specifies whether to use compression. |
| 695 | The argument must be |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 696 | .Dq yes |
| 697 | or |
| 698 | .Dq no . |
Ben Lindstrom | 89b0bd6 | 2001-03-29 00:27:11 +0000 | [diff] [blame] | 699 | The default is |
| 700 | .Dq no . |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 701 | .It Cm CompressionLevel |
Ben Lindstrom | 89b0bd6 | 2001-03-29 00:27:11 +0000 | [diff] [blame] | 702 | Specifies the compression level to use if compression is enabled. |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 703 | The argument must be an integer from 1 (fast) to 9 (slow, best). |
| 704 | The default level is 6, which is good for most applications. |
| 705 | The meaning of the values is the same as in |
Damien Miller | 396691a | 2000-01-20 22:44:08 +1100 | [diff] [blame] | 706 | .Xr gzip 1 . |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 707 | .It Cm ConnectionAttempts |
| 708 | Specifies the number of tries (one per second) to make before falling |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 709 | back to rsh or exiting. |
| 710 | The argument must be an integer. |
| 711 | This may be useful in scripts if the connection sometimes fails. |
Ben Lindstrom | 89b0bd6 | 2001-03-29 00:27:11 +0000 | [diff] [blame] | 712 | The default is 4. |
Damien Miller | 0bc1bd8 | 2000-11-13 22:57:25 +1100 | [diff] [blame] | 713 | .It Cm PubkeyAuthentication |
| 714 | Specifies whether to try public key authentication. |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 715 | The argument to this keyword must be |
| 716 | .Dq yes |
| 717 | or |
| 718 | .Dq no . |
Ben Lindstrom | 89b0bd6 | 2001-03-29 00:27:11 +0000 | [diff] [blame] | 719 | The default is |
| 720 | .Dq yes . |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 721 | Note that this option applies to protocol version 2 only. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 722 | .It Cm EscapeChar |
| 723 | Sets the escape character (default: |
| 724 | .Ql ~ ) . |
| 725 | The escape character can also |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 726 | be set on the command line. |
| 727 | The argument should be a single character, |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 728 | .Ql ^ |
| 729 | followed by a letter, or |
| 730 | .Dq none |
| 731 | to disable the escape |
| 732 | character entirely (making the connection transparent for binary |
| 733 | data). |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 734 | .It Cm FallBackToRsh |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 735 | Specifies that if connecting via |
| 736 | .Nm |
| 737 | fails due to a connection refused error (there is no |
| 738 | .Xr sshd 8 |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 739 | listening on the remote host), |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 740 | .Xr rsh 1 |
| 741 | should automatically be used instead (after a suitable warning about |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 742 | the session being unencrypted). |
| 743 | The argument must be |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 744 | .Dq yes |
| 745 | or |
| 746 | .Dq no . |
Ben Lindstrom | 89b0bd6 | 2001-03-29 00:27:11 +0000 | [diff] [blame] | 747 | The default is |
| 748 | .Dq no . |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 749 | .It Cm ForwardAgent |
| 750 | Specifies whether the connection to the authentication agent (if any) |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 751 | will be forwarded to the remote machine. |
| 752 | The argument must be |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 753 | .Dq yes |
| 754 | or |
| 755 | .Dq no . |
Damien Miller | b1715dc | 2000-05-30 13:44:51 +1000 | [diff] [blame] | 756 | The default is |
| 757 | .Dq no . |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 758 | .It Cm ForwardX11 |
| 759 | Specifies whether X11 connections will be automatically redirected |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 760 | over the secure channel and |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 761 | .Ev DISPLAY |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 762 | set. |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 763 | The argument must be |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 764 | .Dq yes |
| 765 | or |
| 766 | .Dq no . |
Damien Miller | 98c7ad6 | 2000-03-09 21:27:49 +1100 | [diff] [blame] | 767 | The default is |
| 768 | .Dq no . |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 769 | .It Cm GatewayPorts |
| 770 | Specifies whether remote hosts are allowed to connect to local |
| 771 | forwarded ports. |
| 772 | The argument must be |
| 773 | .Dq yes |
| 774 | or |
| 775 | .Dq no . |
| 776 | The default is |
| 777 | .Dq no . |
| 778 | .It Cm GlobalKnownHostsFile |
Ben Lindstrom | 1e62174 | 2001-03-06 01:10:53 +0000 | [diff] [blame] | 779 | Specifies a file to use for the protocol version 1 global |
| 780 | host key database instead of |
Damien Miller | 886c63a | 2000-01-20 23:13:36 +1100 | [diff] [blame] | 781 | .Pa /etc/ssh_known_hosts . |
Ben Lindstrom | 1e62174 | 2001-03-06 01:10:53 +0000 | [diff] [blame] | 782 | .It Cm GlobalKnownHostsFile2 |
| 783 | Specifies a file to use for the protocol version 2 global |
| 784 | host key database instead of |
| 785 | .Pa /etc/ssh_known_hosts2 . |
Ben Lindstrom | 4dccfa5 | 2000-12-28 16:40:05 +0000 | [diff] [blame] | 786 | .It Cm HostKeyAlias |
| 787 | Specifies an alias that should be used instead of the |
| 788 | real host name when looking up or saving the host key |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 789 | in the known_hosts files. |
| 790 | This option is useful for tunneling ssh connections |
Ben Lindstrom | 4dccfa5 | 2000-12-28 16:40:05 +0000 | [diff] [blame] | 791 | or if you have multiple servers running on a single host. |
Ben Lindstrom | 982dbbc | 2001-04-17 18:11:36 +0000 | [diff] [blame] | 792 | .It Cm HostKeyAlgorithms |
| 793 | Specfies the protocol version 2 host key algorithms |
| 794 | that the client wants to use in order of preference. |
| 795 | The default for this option is: |
| 796 | .Dq ssh-rsa,ssh-dss |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 797 | .It Cm HostName |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 798 | Specifies the real host name to log into. |
| 799 | This can be used to specify nicknames or abbreviations for hosts. |
| 800 | Default is the name given on the command line. |
| 801 | Numeric IP addresses are also permitted (both on the command line and in |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 802 | .Cm HostName |
| 803 | specifications). |
| 804 | .It Cm IdentityFile |
| 805 | Specifies the file from which the user's RSA authentication identity |
| 806 | is read (default |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 807 | .Pa $HOME/.ssh/identity |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 808 | in the user's home directory). |
| 809 | Additionally, any identities represented by the authentication agent |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 810 | will be used for authentication. |
| 811 | The file name may use the tilde |
| 812 | syntax to refer to a user's home directory. |
| 813 | It is possible to have |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 814 | multiple identity files specified in configuration files; all these |
| 815 | identities will be tried in sequence. |
| 816 | .It Cm KeepAlive |
| 817 | Specifies whether the system should send keepalive messages to the |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 818 | other side. |
| 819 | If they are sent, death of the connection or crash of one |
| 820 | of the machines will be properly noticed. |
| 821 | However, this means that |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 822 | connections will die if the route is down temporarily, and some people |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 823 | find it annoying. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 824 | .Pp |
| 825 | The default is |
| 826 | .Dq yes |
| 827 | (to send keepalives), and the client will notice |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 828 | if the network goes down or the remote host dies. |
| 829 | This is important in scripts, and many users want it too. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 830 | .Pp |
| 831 | To disable keepalives, the value should be set to |
| 832 | .Dq no |
| 833 | in both the server and the client configuration files. |
| 834 | .It Cm KerberosAuthentication |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 835 | Specifies whether Kerberos authentication will be used. |
| 836 | The argument to this keyword must be |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 837 | .Dq yes |
| 838 | or |
| 839 | .Dq no . |
| 840 | .It Cm KerberosTgtPassing |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 841 | Specifies whether a Kerberos TGT will be forwarded to the server. |
| 842 | This will only work if the Kerberos server is actually an AFS kaserver. |
| 843 | The argument to this keyword must be |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 844 | .Dq yes |
| 845 | or |
| 846 | .Dq no . |
| 847 | .It Cm LocalForward |
| 848 | Specifies that a TCP/IP port on the local machine be forwarded over |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 849 | the secure channel to given host:port from the remote machine. |
| 850 | The first argument must be a port number, and the second must be |
| 851 | host:port. |
| 852 | Multiple forwardings may be specified, and additional |
| 853 | forwardings can be given on the command line. |
| 854 | Only the superuser can forward privileged ports. |
Damien Miller | 5ce662a | 1999-11-11 17:57:39 +1100 | [diff] [blame] | 855 | .It Cm LogLevel |
| 856 | Gives the verbosity level that is used when logging messages from |
| 857 | .Nm ssh . |
| 858 | The possible values are: |
Ben Lindstrom | db65e8f | 2001-01-19 04:26:52 +0000 | [diff] [blame] | 859 | QUIET, FATAL, ERROR, INFO, VERBOSE and DEBUG. |
| 860 | The default is INFO. |
Ben Lindstrom | 06b33aa | 2001-02-15 03:01:59 +0000 | [diff] [blame] | 861 | .It Cm MACs |
| 862 | Specifies the MAC (message authentication code) algorithms |
| 863 | in order of preference. |
| 864 | The MAC algorithm is used in protocol version 2 |
| 865 | for data integrity protection. |
| 866 | Multiple algorithms must be comma-separated. |
| 867 | The default is |
| 868 | .Pp |
| 869 | .Bd -literal |
Ben Lindstrom | ec26fb1 | 2001-03-06 01:05:23 +0000 | [diff] [blame] | 870 | ``hmac-md5,hmac-sha1,hmac-ripemd160,hmac-ripemd160@openssh.com, |
Ben Lindstrom | 06b33aa | 2001-02-15 03:01:59 +0000 | [diff] [blame] | 871 | hmac-sha1-96,hmac-md5-96'' |
| 872 | .Ed |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 873 | .It Cm NumberOfPasswordPrompts |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 874 | Specifies the number of password prompts before giving up. |
| 875 | The argument to this keyword must be an integer. |
| 876 | Default is 3. |
Damien Miller | 396691a | 2000-01-20 22:44:08 +1100 | [diff] [blame] | 877 | .It Cm PasswordAuthentication |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 878 | Specifies whether to use password authentication. |
| 879 | The argument to this keyword must be |
Damien Miller | 396691a | 2000-01-20 22:44:08 +1100 | [diff] [blame] | 880 | .Dq yes |
| 881 | or |
| 882 | .Dq no . |
Ben Lindstrom | 89b0bd6 | 2001-03-29 00:27:11 +0000 | [diff] [blame] | 883 | The default is |
| 884 | .Dq yes . |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 885 | Note that this option applies to both protocol version 1 and 2. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 886 | .It Cm Port |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 887 | Specifies the port number to connect on the remote host. |
| 888 | Default is 22. |
Damien Miller | 1e42f30 | 2001-03-19 23:59:11 +1100 | [diff] [blame] | 889 | .It Cm PreferredAuthentications |
| 890 | Specifies the order in which the client should try protocol 2 |
| 891 | authentication methods. This allows a client to prefer one method (e.g. |
| 892 | .Cm keyboard-interactive ) |
| 893 | over another method (e.g. |
| 894 | .Cm password ) |
| 895 | The default for this option is: |
| 896 | .Dq publickey, password, keyboard-interactive |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 897 | .It Cm Protocol |
| 898 | Specifies the protocol versions |
| 899 | .Nm |
| 900 | should support in order of preference. |
| 901 | The possible values are |
| 902 | .Dq 1 |
| 903 | and |
| 904 | .Dq 2 . |
| 905 | Multiple versions must be comma-separated. |
| 906 | The default is |
Ben Lindstrom | f327235 | 2001-04-05 23:29:59 +0000 | [diff] [blame] | 907 | .Dq 2,1 . |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 908 | This means that |
| 909 | .Nm |
Ben Lindstrom | f327235 | 2001-04-05 23:29:59 +0000 | [diff] [blame] | 910 | tries version 2 and falls back to version 1 |
| 911 | if version 2 is not available. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 912 | .It Cm ProxyCommand |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 913 | Specifies the command to use to connect to the server. |
| 914 | The command |
| 915 | string extends to the end of the line, and is executed with |
| 916 | .Pa /bin/sh . |
| 917 | In the command string, |
| 918 | .Ql %h |
| 919 | will be substituted by the host name to |
| 920 | connect and |
| 921 | .Ql %p |
| 922 | by the port. |
| 923 | The command can be basically anything, |
| 924 | and should read from its standard input and write to its standard output. |
| 925 | It should eventually connect an |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 926 | .Xr sshd 8 |
| 927 | server running on some machine, or execute |
| 928 | .Ic sshd -i |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 929 | somewhere. |
| 930 | Host key management will be done using the |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 931 | HostName of the host being connected (defaulting to the name typed by |
| 932 | the user). |
Damien Miller | aae6c61 | 1999-12-06 11:47:28 +1100 | [diff] [blame] | 933 | Note that |
| 934 | .Cm CheckHostIP |
| 935 | is not available for connects with a proxy command. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 936 | .Pp |
| 937 | .It Cm RemoteForward |
| 938 | Specifies that a TCP/IP port on the remote machine be forwarded over |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 939 | the secure channel to given host:port from the local machine. |
| 940 | The first argument must be a port number, and the second must be |
| 941 | host:port. |
| 942 | Multiple forwardings may be specified, and additional |
| 943 | forwardings can be given on the command line. |
| 944 | Only the superuser can forward privileged ports. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 945 | .It Cm RhostsAuthentication |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 946 | Specifies whether to try rhosts based authentication. |
| 947 | Note that this |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 948 | declaration only affects the client side and has no effect whatsoever |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 949 | on security. |
| 950 | Disabling rhosts authentication may reduce |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 951 | authentication time on slow connections when rhosts authentication is |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 952 | not used. |
| 953 | Most servers do not permit RhostsAuthentication because it |
| 954 | is not secure (see RhostsRSAAuthentication). |
| 955 | The argument to this keyword must be |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 956 | .Dq yes |
| 957 | or |
| 958 | .Dq no . |
Ben Lindstrom | 89b0bd6 | 2001-03-29 00:27:11 +0000 | [diff] [blame] | 959 | The default is |
| 960 | .Dq yes . |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 961 | .It Cm RhostsRSAAuthentication |
| 962 | Specifies whether to try rhosts based authentication with RSA host |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 963 | authentication. |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 964 | The argument must be |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 965 | .Dq yes |
| 966 | or |
| 967 | .Dq no . |
Ben Lindstrom | 89b0bd6 | 2001-03-29 00:27:11 +0000 | [diff] [blame] | 968 | The default is |
| 969 | .Dq yes . |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 970 | .It Cm RSAAuthentication |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 971 | Specifies whether to try RSA authentication. |
| 972 | The argument to this keyword must be |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 973 | .Dq yes |
| 974 | or |
| 975 | .Dq no . |
| 976 | RSA authentication will only be |
| 977 | attempted if the identity file exists, or an authentication agent is |
| 978 | running. |
Ben Lindstrom | 89b0bd6 | 2001-03-29 00:27:11 +0000 | [diff] [blame] | 979 | The default is |
| 980 | .Dq yes . |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 981 | Note that this option applies to protocol version 1 only. |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 982 | .It Cm ChallengeResponseAuthentication |
| 983 | Specifies whether to use challenge response authentication. |
| 984 | Currently there is only support for |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 985 | .Xr skey 1 |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 986 | authentication. |
| 987 | The argument to this keyword must be |
Damien Miller | 95def09 | 1999-11-25 00:26:21 +1100 | [diff] [blame] | 988 | .Dq yes |
| 989 | or |
| 990 | .Dq no . |
| 991 | The default is |
| 992 | .Dq no . |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 993 | .It Cm StrictHostKeyChecking |
| 994 | If this flag is set to |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 995 | .Dq yes , |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 996 | .Nm |
Ben Lindstrom | eb930d4 | 2001-01-29 08:37:08 +0000 | [diff] [blame] | 997 | will never automatically add host keys to the |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 998 | .Pa $HOME/.ssh/known_hosts |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 999 | and |
| 1000 | .Pa $HOME/.ssh/known_hosts2 |
Ben Lindstrom | eb930d4 | 2001-01-29 08:37:08 +0000 | [diff] [blame] | 1001 | files, and refuses to connect to hosts whose host key has changed. |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1002 | This provides maximum protection against trojan horse attacks. |
| 1003 | However, it can be somewhat annoying if you don't have good |
Damien Miller | 886c63a | 2000-01-20 23:13:36 +1100 | [diff] [blame] | 1004 | .Pa /etc/ssh_known_hosts |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 1005 | and |
| 1006 | .Pa /etc/ssh_known_hosts2 |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1007 | files installed and frequently |
Ben Lindstrom | eb930d4 | 2001-01-29 08:37:08 +0000 | [diff] [blame] | 1008 | connect to new hosts. |
| 1009 | This option forces the user to manually |
| 1010 | add all new hosts. |
| 1011 | If this flag is set to |
| 1012 | .Dq no , |
| 1013 | .Nm |
| 1014 | will automatically add new host keys to the |
| 1015 | user known hosts files. |
| 1016 | If this flag is set to |
| 1017 | .Dq ask , |
| 1018 | new host keys |
| 1019 | will be added to the user known host files only after the user |
| 1020 | has confirmed that is what they really want to do, and |
| 1021 | .Nm |
| 1022 | will refuse to connect to hosts whose host key has changed. |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1023 | The host keys of |
Ben Lindstrom | eb930d4 | 2001-01-29 08:37:08 +0000 | [diff] [blame] | 1024 | known hosts will be verified automatically in all cases. |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1025 | The argument must be |
Ben Lindstrom | eb930d4 | 2001-01-29 08:37:08 +0000 | [diff] [blame] | 1026 | .Dq yes , |
| 1027 | .Dq no |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1028 | or |
Ben Lindstrom | eb930d4 | 2001-01-29 08:37:08 +0000 | [diff] [blame] | 1029 | .Dq ask . |
| 1030 | The default is |
| 1031 | .Dq ask . |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1032 | .It Cm UsePrivilegedPort |
| 1033 | Specifies whether to use a privileged port for outgoing connections. |
| 1034 | The argument must be |
| 1035 | .Dq yes |
| 1036 | or |
| 1037 | .Dq no . |
| 1038 | The default is |
Ben Lindstrom | cebc858 | 2001-03-08 03:39:10 +0000 | [diff] [blame] | 1039 | .Dq no . |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1040 | Note that setting this option to |
| 1041 | .Dq no |
Damien Miller | a34a28b | 1999-12-14 10:47:15 +1100 | [diff] [blame] | 1042 | turns off |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1043 | .Cm RhostsAuthentication |
| 1044 | and |
Kevin Steves | fcec7f8 | 2000-12-15 19:55:48 +0000 | [diff] [blame] | 1045 | .Cm RhostsRSAAuthentication |
| 1046 | for older servers. |
Damien Miller | 396691a | 2000-01-20 22:44:08 +1100 | [diff] [blame] | 1047 | .It Cm User |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1048 | Specifies the user to log in as. |
| 1049 | This can be useful if you have a different user name on different machines. |
| 1050 | This saves the trouble of |
Damien Miller | 396691a | 2000-01-20 22:44:08 +1100 | [diff] [blame] | 1051 | having to remember to give the user name on the command line. |
| 1052 | .It Cm UserKnownHostsFile |
Ben Lindstrom | 1e62174 | 2001-03-06 01:10:53 +0000 | [diff] [blame] | 1053 | Specifies a file to use for the protocol version 1 user |
| 1054 | host key database instead of |
Damien Miller | 396691a | 2000-01-20 22:44:08 +1100 | [diff] [blame] | 1055 | .Pa $HOME/.ssh/known_hosts . |
Ben Lindstrom | 1e62174 | 2001-03-06 01:10:53 +0000 | [diff] [blame] | 1056 | .It Cm UserKnownHostsFile2 |
| 1057 | Specifies a file to use for the protocol version 2 user |
| 1058 | host key database instead of |
| 1059 | .Pa $HOME/.ssh/known_hosts2 . |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1060 | .It Cm UseRsh |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1061 | Specifies that rlogin/rsh should be used for this host. |
| 1062 | It is possible that the host does not at all support the |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1063 | .Nm |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1064 | protocol. |
| 1065 | This causes |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1066 | .Nm |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1067 | to immediately execute |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1068 | .Xr rsh 1 . |
| 1069 | All other options (except |
| 1070 | .Cm HostName ) |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1071 | are ignored if this has been specified. |
| 1072 | The argument must be |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1073 | .Dq yes |
| 1074 | or |
| 1075 | .Dq no . |
Damien Miller | d3a1857 | 2000-06-07 19:55:44 +1000 | [diff] [blame] | 1076 | .It Cm XAuthLocation |
| 1077 | Specifies the location of the |
| 1078 | .Xr xauth 1 |
| 1079 | program. |
| 1080 | The default is |
| 1081 | .Pa /usr/X11R6/bin/xauth . |
Damien Miller | 7b28dc5 | 2000-09-05 13:34:53 +1100 | [diff] [blame] | 1082 | .El |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1083 | .Sh ENVIRONMENT |
| 1084 | .Nm |
| 1085 | will normally set the following environment variables: |
| 1086 | .Bl -tag -width Ds |
| 1087 | .It Ev DISPLAY |
| 1088 | The |
| 1089 | .Ev DISPLAY |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1090 | variable indicates the location of the X11 server. |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 1091 | It is automatically set by |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1092 | .Nm |
| 1093 | to point to a value of the form |
| 1094 | .Dq hostname:n |
| 1095 | where hostname indicates |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1096 | the host where the shell runs, and n is an integer >= 1. |
| 1097 | .Nm |
| 1098 | uses this special value to forward X11 connections over the secure |
| 1099 | channel. |
| 1100 | The user should normally not set DISPLAY explicitly, as that |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1101 | will render the X11 connection insecure (and will require the user to |
| 1102 | manually copy any required authorization cookies). |
| 1103 | .It Ev HOME |
| 1104 | Set to the path of the user's home directory. |
| 1105 | .It Ev LOGNAME |
| 1106 | Synonym for |
| 1107 | .Ev USER ; |
| 1108 | set for compatibility with systems that use this variable. |
| 1109 | .It Ev MAIL |
| 1110 | Set to point the user's mailbox. |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1111 | .It Ev PATH |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1112 | Set to the default |
| 1113 | .Ev PATH , |
| 1114 | as specified when compiling |
| 1115 | .Nm ssh . |
| 1116 | .It Ev SSH_AUTH_SOCK |
| 1117 | indicates the path of a unix-domain socket used to communicate with the |
| 1118 | agent. |
| 1119 | .It Ev SSH_CLIENT |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1120 | Identifies the client end of the connection. |
| 1121 | The variable contains |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1122 | three space-separated values: client ip-address, client port number, |
| 1123 | and server port number. |
Ben Lindstrom | 4dccfa5 | 2000-12-28 16:40:05 +0000 | [diff] [blame] | 1124 | .It Ev SSH_ORIGINAL_COMMAND |
| 1125 | The variable contains the original command line if a forced command |
| 1126 | is executed. |
| 1127 | It can be used to extract the original arguments. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1128 | .It Ev SSH_TTY |
| 1129 | This is set to the name of the tty (path to the device) associated |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1130 | with the current shell or command. |
| 1131 | If the current session has no tty, |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1132 | this variable is not set. |
| 1133 | .It Ev TZ |
| 1134 | The timezone variable is set to indicate the present timezone if it |
Damien Miller | 942da03 | 2000-08-18 13:59:06 +1000 | [diff] [blame] | 1135 | was set when the daemon was started (i.e., the daemon passes the value |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1136 | on to new connections). |
| 1137 | .It Ev USER |
| 1138 | Set to the name of the user logging in. |
| 1139 | .El |
| 1140 | .Pp |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 1141 | Additionally, |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1142 | .Nm |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 1143 | reads |
| 1144 | .Pa $HOME/.ssh/environment , |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1145 | and adds lines of the format |
| 1146 | .Dq VARNAME=value |
| 1147 | to the environment. |
| 1148 | .Sh FILES |
Damien Miller | 98c7ad6 | 2000-03-09 21:27:49 +1100 | [diff] [blame] | 1149 | .Bl -tag -width Ds |
Ben Lindstrom | 1e62174 | 2001-03-06 01:10:53 +0000 | [diff] [blame] | 1150 | .It Pa $HOME/.ssh/known_hosts, $HOME/.ssh/known_hosts2 |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1151 | Records host keys for all hosts the user has logged into (that are not |
| 1152 | in |
Ben Lindstrom | 1e62174 | 2001-03-06 01:10:53 +0000 | [diff] [blame] | 1153 | .Pa /etc/ssh_known_hosts |
| 1154 | for protocol version 1 or |
| 1155 | .Pa /etc/ssh_known_hosts2 |
| 1156 | for protocol version 2). |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1157 | See |
| 1158 | .Xr sshd 8 . |
Ben Lindstrom | 18a82ac | 2001-04-11 15:59:35 +0000 | [diff] [blame] | 1159 | .It Pa $HOME/.ssh/identity, $HOME/.ssh/id_dsa, $HOME/.ssh/id_rsa |
| 1160 | Contains the authentication identity of the user. |
| 1161 | They are for protocol 1 RSA, protocol 2 DSA, and protocol 2 RSA, respectively. |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 1162 | These files |
| 1163 | contain sensitive data and should be readable by the user but not |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1164 | accessible by others (read/write/execute). |
| 1165 | Note that |
| 1166 | .Nm |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 1167 | ignores a private key file if it is accessible by others. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1168 | It is possible to specify a passphrase when |
| 1169 | generating the key; the passphrase will be used to encrypt the |
| 1170 | sensitive part of this file using 3DES. |
Ben Lindstrom | 18a82ac | 2001-04-11 15:59:35 +0000 | [diff] [blame] | 1171 | .It Pa $HOME/.ssh/identity.pub, $HOME/.ssh/id_dsa.pub, $HOME/.ssh/id_rsa.pub |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1172 | Contains the public key for authentication (public part of the |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1173 | identity file in human-readable form). |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 1174 | The contents of the |
| 1175 | .Pa $HOME/.ssh/identity.pub |
| 1176 | file should be added to |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1177 | .Pa $HOME/.ssh/authorized_keys |
| 1178 | on all machines |
Ben Lindstrom | 18a82ac | 2001-04-11 15:59:35 +0000 | [diff] [blame] | 1179 | where you wish to log in using protocol version 1 RSA authentication. |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 1180 | The contents of the |
| 1181 | .Pa $HOME/.ssh/id_dsa.pub |
Ben Lindstrom | 18a82ac | 2001-04-11 15:59:35 +0000 | [diff] [blame] | 1182 | and |
| 1183 | .Pa $HOME/.ssh/id_rsa.pub |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 1184 | file should be added to |
| 1185 | .Pa $HOME/.ssh/authorized_keys2 |
| 1186 | on all machines |
Ben Lindstrom | 18a82ac | 2001-04-11 15:59:35 +0000 | [diff] [blame] | 1187 | where you wish to log in using protocol version 2 DSA/RSA authentication. |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 1188 | These files are not |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1189 | sensitive and can (but need not) be readable by anyone. |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 1190 | These files are |
Kevin Steves | 3c034ae | 2001-02-05 13:47:11 +0000 | [diff] [blame] | 1191 | never used automatically and are not necessary; they are only provided for |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1192 | the convenience of the user. |
| 1193 | .It Pa $HOME/.ssh/config |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1194 | This is the per-user configuration file. |
| 1195 | The format of this file is described above. |
| 1196 | This file is used by the |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1197 | .Nm |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1198 | client. |
| 1199 | This file does not usually contain any sensitive information, |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1200 | but the recommended permissions are read/write for the user, and not |
| 1201 | accessible by others. |
| 1202 | .It Pa $HOME/.ssh/authorized_keys |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1203 | Lists the RSA keys that can be used for logging in as this user. |
| 1204 | The format of this file is described in the |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1205 | .Xr sshd 8 |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1206 | manual page. |
| 1207 | In the simplest form the format is the same as the .pub |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1208 | identity files (that is, each line contains the number of bits in |
| 1209 | modulus, public exponent, modulus, and comment fields, separated by |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1210 | spaces). |
| 1211 | This file is not highly sensitive, but the recommended |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1212 | permissions are read/write for the user, and not accessible by others. |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 1213 | .It Pa $HOME/.ssh/authorized_keys2 |
Damien Miller | 0bc1bd8 | 2000-11-13 22:57:25 +1100 | [diff] [blame] | 1214 | Lists the public keys (DSA/RSA) that can be used for logging in as this user. |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 1215 | This file is not highly sensitive, but the recommended |
| 1216 | permissions are read/write for the user, and not accessible by others. |
| 1217 | .It Pa /etc/ssh_known_hosts, /etc/ssh_known_hosts2 |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1218 | Systemwide list of known host keys. |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 1219 | .Pa /etc/ssh_known_hosts |
| 1220 | contains RSA and |
| 1221 | .Pa /etc/ssh_known_hosts2 |
Damien Miller | 0bc1bd8 | 2000-11-13 22:57:25 +1100 | [diff] [blame] | 1222 | contains DSA or RSA keys for protocol version 2. |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 1223 | These files should be prepared by the |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1224 | system administrator to contain the public host keys of all machines in the |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1225 | organization. |
| 1226 | This file should be world-readable. |
| 1227 | This file contains |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1228 | public keys, one per line, in the following format (fields separated |
| 1229 | by spaces): system name, number of bits in modulus, public exponent, |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1230 | modulus, and optional comment field. |
| 1231 | When different names are used |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1232 | for the same machine, all such names should be listed, separated by |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1233 | commas. |
| 1234 | The format is described on the |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1235 | .Xr sshd 8 |
| 1236 | manual page. |
| 1237 | .Pp |
| 1238 | The canonical system name (as returned by name servers) is used by |
| 1239 | .Xr sshd 8 |
| 1240 | to verify the client host when logging in; other names are needed because |
| 1241 | .Nm |
| 1242 | does not convert the user-supplied name to a canonical name before |
| 1243 | checking the key, because someone with access to the name servers |
| 1244 | would then be able to fool host authentication. |
Damien Miller | 886c63a | 2000-01-20 23:13:36 +1100 | [diff] [blame] | 1245 | .It Pa /etc/ssh_config |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1246 | Systemwide configuration file. |
| 1247 | This file provides defaults for those |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1248 | values that are not specified in the user's configuration file, and |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1249 | for those users who do not have a configuration file. |
| 1250 | This file must be world-readable. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1251 | .It Pa $HOME/.rhosts |
| 1252 | This file is used in |
| 1253 | .Pa \&.rhosts |
| 1254 | authentication to list the |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1255 | host/user pairs that are permitted to log in. |
| 1256 | (Note that this file is |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1257 | also used by rlogin and rsh, which makes using this file insecure.) |
| 1258 | Each line of the file contains a host name (in the canonical form |
| 1259 | returned by name servers), and then a user name on that host, |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1260 | separated by a space. |
Ben Lindstrom | ebd888d | 2001-03-05 05:49:29 +0000 | [diff] [blame] | 1261 | On some machines this file may need to be |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1262 | world-readable if the user's home directory is on a NFS partition, |
| 1263 | because |
| 1264 | .Xr sshd 8 |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1265 | reads it as root. |
| 1266 | Additionally, this file must be owned by the user, |
| 1267 | and must not have write permissions for anyone else. |
| 1268 | The recommended |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1269 | permission for most machines is read/write for the user, and not |
| 1270 | accessible by others. |
| 1271 | .Pp |
| 1272 | Note that by default |
| 1273 | .Xr sshd 8 |
| 1274 | will be installed so that it requires successful RSA host |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1275 | authentication before permitting \s+2.\s0rhosts authentication. |
| 1276 | If your server machine does not have the client's host key in |
Damien Miller | 886c63a | 2000-01-20 23:13:36 +1100 | [diff] [blame] | 1277 | .Pa /etc/ssh_known_hosts , |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1278 | you can store it in |
| 1279 | .Pa $HOME/.ssh/known_hosts . |
| 1280 | The easiest way to do this is to |
| 1281 | connect back to the client from the server machine using ssh; this |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 1282 | will automatically add the host key to |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1283 | .Pa $HOME/.ssh/known_hosts . |
| 1284 | .It Pa $HOME/.shosts |
| 1285 | This file is used exactly the same way as |
| 1286 | .Pa \&.rhosts . |
| 1287 | The purpose for |
| 1288 | having this file is to be able to use rhosts authentication with |
| 1289 | .Nm |
| 1290 | without permitting login with |
| 1291 | .Xr rlogin 1 |
| 1292 | or |
| 1293 | .Xr rsh 1 . |
| 1294 | .It Pa /etc/hosts.equiv |
| 1295 | This file is used during |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1296 | .Pa \&.rhosts authentication. |
| 1297 | It contains |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1298 | canonical hosts names, one per line (the full format is described on |
| 1299 | the |
| 1300 | .Xr sshd 8 |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1301 | manual page). |
| 1302 | If the client host is found in this file, login is |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1303 | automatically permitted provided client and server user names are the |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1304 | same. |
| 1305 | Additionally, successful RSA host authentication is normally |
| 1306 | required. |
| 1307 | This file should only be writable by root. |
Damien Miller | 886c63a | 2000-01-20 23:13:36 +1100 | [diff] [blame] | 1308 | .It Pa /etc/shosts.equiv |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 1309 | This file is processed exactly as |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1310 | .Pa /etc/hosts.equiv . |
| 1311 | This file may be useful to permit logins using |
| 1312 | .Nm |
| 1313 | but not using rsh/rlogin. |
Damien Miller | 886c63a | 2000-01-20 23:13:36 +1100 | [diff] [blame] | 1314 | .It Pa /etc/sshrc |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1315 | Commands in this file are executed by |
| 1316 | .Nm |
| 1317 | when the user logs in just before the user's shell (or command) is started. |
| 1318 | See the |
| 1319 | .Xr sshd 8 |
| 1320 | manual page for more information. |
| 1321 | .It Pa $HOME/.ssh/rc |
| 1322 | Commands in this file are executed by |
| 1323 | .Nm |
| 1324 | when the user logs in just before the user's shell (or command) is |
| 1325 | started. |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 1326 | See the |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1327 | .Xr sshd 8 |
| 1328 | manual page for more information. |
Damien Miller | 4f0fa56 | 1999-12-26 14:24:41 +1100 | [diff] [blame] | 1329 | .It Pa $HOME/.ssh/environment |
| 1330 | Contains additional definitions for environment variables, see section |
| 1331 | .Sx ENVIRONMENT |
| 1332 | above. |
Damien Miller | 7b28dc5 | 2000-09-05 13:34:53 +1100 | [diff] [blame] | 1333 | .El |
Damien Miller | 0bc1bd8 | 2000-11-13 22:57:25 +1100 | [diff] [blame] | 1334 | .Sh AUTHORS |
Ben Lindstrom | 035782e | 2001-01-29 08:34:16 +0000 | [diff] [blame] | 1335 | OpenSSH is a derivative of the original and free |
| 1336 | ssh 1.2.12 release by Tatu Ylonen. |
| 1337 | Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, |
| 1338 | Theo de Raadt and Dug Song |
| 1339 | removed many bugs, re-added newer features and |
| 1340 | created OpenSSH. |
| 1341 | Markus Friedl contributed the support for SSH |
| 1342 | protocol versions 1.5 and 2.0. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1343 | .Sh SEE ALSO |
| 1344 | .Xr rlogin 1 , |
| 1345 | .Xr rsh 1 , |
| 1346 | .Xr scp 1 , |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 1347 | .Xr sftp 1 , |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1348 | .Xr ssh-add 1 , |
| 1349 | .Xr ssh-agent 1 , |
| 1350 | .Xr ssh-keygen 1 , |
| 1351 | .Xr telnet 1 , |
Ben Lindstrom | 5ab6ae1 | 2001-02-10 22:08:03 +0000 | [diff] [blame] | 1352 | .Xr sshd 8 |