Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1 | .\" |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 2 | .\" Author: Tatu Ylonen <ylo@cs.hut.fi> |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 3 | .\" Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland |
| 4 | .\" All rights reserved |
| 5 | .\" |
Damien Miller | e4340be | 2000-09-16 13:29:08 +1100 | [diff] [blame] | 6 | .\" As far as I am concerned, the code I have written for this software |
| 7 | .\" can be used freely for any purpose. Any derived versions of this |
| 8 | .\" software must be clearly marked as such, and if the derived work is |
| 9 | .\" incompatible with the protocol description in the RFC file, it must be |
| 10 | .\" called by a name other than "ssh" or "Secure Shell". |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 11 | .\" |
Ben Lindstrom | 92a2e38 | 2001-03-05 06:59:27 +0000 | [diff] [blame] | 12 | .\" Copyright (c) 1999,2000 Markus Friedl. All rights reserved. |
| 13 | .\" Copyright (c) 1999 Aaron Campbell. All rights reserved. |
| 14 | .\" Copyright (c) 1999 Theo de Raadt. All rights reserved. |
Damien Miller | e4340be | 2000-09-16 13:29:08 +1100 | [diff] [blame] | 15 | .\" |
| 16 | .\" Redistribution and use in source and binary forms, with or without |
| 17 | .\" modification, are permitted provided that the following conditions |
| 18 | .\" are met: |
| 19 | .\" 1. Redistributions of source code must retain the above copyright |
| 20 | .\" notice, this list of conditions and the following disclaimer. |
| 21 | .\" 2. Redistributions in binary form must reproduce the above copyright |
| 22 | .\" notice, this list of conditions and the following disclaimer in the |
| 23 | .\" documentation and/or other materials provided with the distribution. |
| 24 | .\" |
| 25 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
| 26 | .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| 27 | .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| 28 | .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 29 | .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
| 30 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 31 | .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 32 | .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 33 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 34 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 35 | .\" |
jmc@openbsd.org | e4eb7d9 | 2016-07-16 06:57:55 +0000 | [diff] [blame] | 36 | .\" $OpenBSD: ssh.1,v 1.376 2016/07/16 06:57:55 jmc Exp $ |
| 37 | .Dd $Mdocdate: July 16 2016 $ |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 38 | .Dt SSH 1 |
| 39 | .Os |
| 40 | .Sh NAME |
| 41 | .Nm ssh |
Ben Lindstrom | d58eb5f | 2001-03-07 06:07:22 +0000 | [diff] [blame] | 42 | .Nd OpenSSH SSH client (remote login program) |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 43 | .Sh SYNOPSIS |
| 44 | .Nm ssh |
Damien Miller | bcfbc48 | 2010-07-16 13:59:11 +1000 | [diff] [blame] | 45 | .Bk -words |
jmc@openbsd.org | b1ba15f | 2014-10-09 06:21:31 +0000 | [diff] [blame] | 46 | .Op Fl 1246AaCfGgKkMNnqsTtVvXxYy |
Ben Lindstrom | e0f8804 | 2001-04-30 13:06:24 +0000 | [diff] [blame] | 47 | .Op Fl b Ar bind_address |
Damien Miller | 30c3d42 | 2000-05-09 11:02:59 +1000 | [diff] [blame] | 48 | .Op Fl c Ar cipher_spec |
Damien Miller | bcfbc48 | 2010-07-16 13:59:11 +1000 | [diff] [blame] | 49 | .Op Fl D Oo Ar bind_address : Oc Ns Ar port |
Damien Miller | 03d4d7e | 2013-04-23 15:21:06 +1000 | [diff] [blame] | 50 | .Op Fl E Ar log_file |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 51 | .Op Fl e Ar escape_char |
Ben Lindstrom | 14f31ab | 2001-09-12 17:48:04 +0000 | [diff] [blame] | 52 | .Op Fl F Ar configfile |
Damien Miller | 048dc93 | 2010-02-12 09:22:04 +1100 | [diff] [blame] | 53 | .Op Fl I Ar pkcs11 |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 54 | .Op Fl i Ar identity_file |
jmc@openbsd.org | e4eb7d9 | 2016-07-16 06:57:55 +0000 | [diff] [blame] | 55 | .Op Fl J Oo Ar user Ns @ Oc Ns Ar host Ns Op : Ns Ar port |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 56 | .Op Fl L Ar address |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 57 | .Op Fl l Ar login_name |
| 58 | .Op Fl m Ar mac_spec |
Darren Tucker | 7ebfc10 | 2004-11-07 20:06:19 +1100 | [diff] [blame] | 59 | .Op Fl O Ar ctl_cmd |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 60 | .Op Fl o Ar option |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 61 | .Op Fl p Ar port |
djm@openbsd.org | c0f55db | 2015-09-11 03:42:32 +0000 | [diff] [blame] | 62 | .Op Fl Q Ar query_option |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 63 | .Op Fl R Ar address |
Darren Tucker | 7ebfc10 | 2004-11-07 20:06:19 +1100 | [diff] [blame] | 64 | .Op Fl S Ar ctl_path |
Darren Tucker | 7ad8dd2 | 2010-01-12 19:40:27 +1100 | [diff] [blame] | 65 | .Op Fl W Ar host : Ns Ar port |
Damien Miller | bcfbc48 | 2010-07-16 13:59:11 +1000 | [diff] [blame] | 66 | .Op Fl w Ar local_tun Ns Op : Ns Ar remote_tun |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 67 | .Oo Ar user Ns @ Oc Ns Ar hostname |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 68 | .Op Ar command |
Damien Miller | bcfbc48 | 2010-07-16 13:59:11 +1000 | [diff] [blame] | 69 | .Ek |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 70 | .Sh DESCRIPTION |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 71 | .Nm |
Ben Lindstrom | d58eb5f | 2001-03-07 06:07:22 +0000 | [diff] [blame] | 72 | (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] | 73 | executing commands on a remote machine. |
mmcc@openbsd.org | 5e28892 | 2015-11-06 00:31:41 +0000 | [diff] [blame] | 74 | It is intended to provide secure encrypted communications between |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 75 | two untrusted hosts over an insecure network. |
Damien Miller | a8a0f65 | 2014-07-30 12:32:28 +1000 | [diff] [blame] | 76 | X11 connections, arbitrary TCP ports and |
| 77 | .Ux Ns -domain |
| 78 | sockets can also be forwarded over the secure channel. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 79 | .Pp |
| 80 | .Nm |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 81 | connects and logs into the specified |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 82 | .Ar hostname |
| 83 | (with optional |
| 84 | .Ar user |
| 85 | name). |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 86 | The user must prove |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 87 | his/her identity to the remote machine using one of several methods |
mmcc@openbsd.org | 5e28892 | 2015-11-06 00:31:41 +0000 | [diff] [blame] | 88 | (see below). |
Damien Miller | e247cc4 | 2000-05-07 12:03:14 +1000 | [diff] [blame] | 89 | .Pp |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 90 | If |
| 91 | .Ar command |
| 92 | is specified, |
Darren Tucker | b18c867 | 2005-12-20 16:10:09 +1100 | [diff] [blame] | 93 | it is executed on the remote host instead of a login shell. |
Darren Tucker | 0b42e6d | 2004-08-13 21:22:40 +1000 | [diff] [blame] | 94 | .Pp |
Damien Miller | 0bc1bd8 | 2000-11-13 22:57:25 +1100 | [diff] [blame] | 95 | The options are as follows: |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 96 | .Pp |
millert@openbsd.org | ebe27eb | 2015-07-20 18:44:12 +0000 | [diff] [blame] | 97 | .Bl -tag -width Ds -compact |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 98 | .It Fl 1 |
| 99 | Forces |
| 100 | .Nm |
| 101 | to try protocol version 1 only. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 102 | .Pp |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 103 | .It Fl 2 |
| 104 | Forces |
| 105 | .Nm |
| 106 | to try protocol version 2 only. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 107 | .Pp |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 108 | .It Fl 4 |
| 109 | Forces |
| 110 | .Nm |
| 111 | to use IPv4 addresses only. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 112 | .Pp |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 113 | .It Fl 6 |
| 114 | Forces |
| 115 | .Nm |
| 116 | to use IPv6 addresses only. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 117 | .Pp |
Damien Miller | b1715dc | 2000-05-30 13:44:51 +1000 | [diff] [blame] | 118 | .It Fl A |
| 119 | Enables forwarding of the authentication agent connection. |
| 120 | This can also be specified on a per-host basis in a configuration file. |
Damien Miller | b5fdfaa | 2002-09-12 09:52:03 +1000 | [diff] [blame] | 121 | .Pp |
Damien Miller | 495dca3 | 2003-04-01 21:42:14 +1000 | [diff] [blame] | 122 | Agent forwarding should be enabled with caution. |
| 123 | Users with the ability to bypass file permissions on the remote host |
Darren Tucker | ae69e1d | 2009-10-24 11:41:34 +1100 | [diff] [blame] | 124 | (for the agent's |
Darren Tucker | 98c9aec | 2009-10-24 11:42:44 +1100 | [diff] [blame] | 125 | .Ux Ns -domain |
| 126 | socket) can access the local agent through the forwarded connection. |
Damien Miller | 495dca3 | 2003-04-01 21:42:14 +1000 | [diff] [blame] | 127 | An attacker cannot obtain key material from the agent, |
Damien Miller | b5fdfaa | 2002-09-12 09:52:03 +1000 | [diff] [blame] | 128 | however they can perform operations on the keys that enable them to |
| 129 | authenticate using the identities loaded into the agent. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 130 | .Pp |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 131 | .It Fl a |
| 132 | Disables forwarding of the authentication agent connection. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 133 | .Pp |
Ben Lindstrom | e0f8804 | 2001-04-30 13:06:24 +0000 | [diff] [blame] | 134 | .It Fl b Ar bind_address |
Darren Tucker | a5cf855 | 2005-07-14 17:04:18 +1000 | [diff] [blame] | 135 | Use |
| 136 | .Ar bind_address |
| 137 | on the local machine as the source address |
| 138 | of the connection. |
| 139 | Only useful on systems with more than one address. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 140 | .Pp |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 141 | .It Fl C |
| 142 | Requests compression of all data (including stdin, stdout, stderr, and |
Damien Miller | a8a0f65 | 2014-07-30 12:32:28 +1000 | [diff] [blame] | 143 | data for forwarded X11, TCP and |
| 144 | .Ux Ns -domain |
| 145 | connections). |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 146 | The compression algorithm is the same used by |
| 147 | .Xr gzip 1 , |
| 148 | and the |
| 149 | .Dq level |
| 150 | can be controlled by the |
| 151 | .Cm CompressionLevel |
| 152 | option for protocol version 1. |
| 153 | Compression is desirable on modem lines and other |
| 154 | slow connections, but will only slow down things on fast networks. |
| 155 | The default value can be set on a host-by-host basis in the |
| 156 | configuration files; see the |
| 157 | .Cm Compression |
| 158 | option. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 159 | .Pp |
Damien Miller | 05202ff | 2004-06-15 10:30:39 +1000 | [diff] [blame] | 160 | .It Fl c Ar cipher_spec |
| 161 | Selects the cipher specification for encrypting the session. |
| 162 | .Pp |
| 163 | Protocol version 1 allows specification of a single cipher. |
Darren Tucker | 1e4308e | 2005-10-03 18:18:40 +1000 | [diff] [blame] | 164 | The supported values are |
Damien Miller | 05202ff | 2004-06-15 10:30:39 +1000 | [diff] [blame] | 165 | .Dq 3des , |
Darren Tucker | ff9f484 | 2005-12-20 16:10:45 +1100 | [diff] [blame] | 166 | .Dq blowfish , |
Damien Miller | 05202ff | 2004-06-15 10:30:39 +1000 | [diff] [blame] | 167 | and |
| 168 | .Dq des . |
Damien Miller | 3597821 | 2005-12-24 14:56:47 +1100 | [diff] [blame] | 169 | For protocol version 2, |
Damien Miller | 05202ff | 2004-06-15 10:30:39 +1000 | [diff] [blame] | 170 | .Ar cipher_spec |
| 171 | is a comma-separated list of ciphers |
| 172 | listed in order of preference. |
Darren Tucker | 3a6a51f | 2009-06-21 17:48:52 +1000 | [diff] [blame] | 173 | See the |
| 174 | .Cm Ciphers |
Damien Miller | 081f3c7 | 2010-08-03 16:05:25 +1000 | [diff] [blame] | 175 | keyword in |
| 176 | .Xr ssh_config 5 |
| 177 | for more information. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 178 | .Pp |
Darren Tucker | c8d6421 | 2005-10-03 18:13:42 +1000 | [diff] [blame] | 179 | .It Fl D Xo |
| 180 | .Sm off |
| 181 | .Oo Ar bind_address : Oc |
| 182 | .Ar port |
| 183 | .Sm on |
| 184 | .Xc |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 185 | Specifies a local |
| 186 | .Dq dynamic |
| 187 | application-level port forwarding. |
| 188 | This works by allocating a socket to listen to |
| 189 | .Ar port |
Darren Tucker | c8d6421 | 2005-10-03 18:13:42 +1000 | [diff] [blame] | 190 | on the local side, optionally bound to the specified |
| 191 | .Ar bind_address . |
| 192 | Whenever a connection is made to this port, the |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 193 | connection is forwarded over the secure channel, and the application |
| 194 | protocol is then used to determine where to connect to from the |
| 195 | remote machine. |
| 196 | Currently the SOCKS4 and SOCKS5 protocols are supported, and |
| 197 | .Nm |
| 198 | will act as a SOCKS server. |
| 199 | Only root can forward privileged ports. |
| 200 | Dynamic port forwardings can also be specified in the configuration file. |
Darren Tucker | c8d6421 | 2005-10-03 18:13:42 +1000 | [diff] [blame] | 201 | .Pp |
Damien Miller | 7fa9660 | 2010-08-05 13:03:13 +1000 | [diff] [blame] | 202 | IPv6 addresses can be specified by enclosing the address in square brackets. |
Darren Tucker | c8d6421 | 2005-10-03 18:13:42 +1000 | [diff] [blame] | 203 | Only the superuser can forward privileged ports. |
| 204 | By default, the local port is bound in accordance with the |
| 205 | .Cm GatewayPorts |
| 206 | setting. |
| 207 | However, an explicit |
| 208 | .Ar bind_address |
| 209 | may be used to bind the connection to a specific address. |
| 210 | The |
| 211 | .Ar bind_address |
| 212 | of |
| 213 | .Dq localhost |
| 214 | indicates that the listening port be bound for local use only, while an |
| 215 | empty address or |
| 216 | .Sq * |
| 217 | indicates that the port should be available from all interfaces. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 218 | .Pp |
Damien Miller | 03d4d7e | 2013-04-23 15:21:06 +1000 | [diff] [blame] | 219 | .It Fl E Ar log_file |
| 220 | Append debug logs to |
| 221 | .Ar log_file |
| 222 | instead of standard error. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 223 | .Pp |
Damien Miller | 2142ba0 | 2005-12-24 14:56:29 +1100 | [diff] [blame] | 224 | .It Fl e Ar escape_char |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 225 | Sets the escape character for sessions with a pty (default: |
| 226 | .Ql ~ ) . |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 227 | The escape character is only recognized at the beginning of a line. |
| 228 | The escape character followed by a dot |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 229 | .Pq Ql \&. |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 230 | closes the connection; |
| 231 | followed by control-Z suspends the connection; |
| 232 | and followed by itself sends the escape character once. |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 233 | Setting the character to |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 234 | .Dq none |
| 235 | disables any escapes and makes the session fully transparent. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 236 | .Pp |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 237 | .It Fl F Ar configfile |
| 238 | Specifies an alternative per-user configuration file. |
| 239 | If a configuration file is given on the command line, |
| 240 | the system-wide configuration file |
| 241 | .Pq Pa /etc/ssh/ssh_config |
| 242 | will be ignored. |
| 243 | The default for the per-user configuration file is |
Damien Miller | 167ea5d | 2005-05-26 12:04:02 +1000 | [diff] [blame] | 244 | .Pa ~/.ssh/config . |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 245 | .Pp |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 246 | .It Fl f |
| 247 | Requests |
| 248 | .Nm |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 249 | to go to background just before command execution. |
| 250 | This is useful if |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 251 | .Nm |
| 252 | is going to ask for passwords or passphrases, but the user |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 253 | wants it in the background. |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 254 | This implies |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 255 | .Fl n . |
| 256 | The recommended way to start X11 programs at a remote site is with |
| 257 | something like |
| 258 | .Ic ssh -f host xterm . |
Darren Tucker | 9a2a609 | 2008-07-04 12:53:50 +1000 | [diff] [blame] | 259 | .Pp |
| 260 | If the |
| 261 | .Cm ExitOnForwardFailure |
| 262 | configuration option is set to |
| 263 | .Dq yes , |
| 264 | then a client started with |
| 265 | .Fl f |
| 266 | will wait for all remote port forwards to be successfully established |
| 267 | before placing itself in the background. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 268 | .Pp |
djm@openbsd.org | 957fbce | 2014-10-08 22:20:25 +0000 | [diff] [blame] | 269 | .It Fl G |
| 270 | Causes |
| 271 | .Nm |
| 272 | to print its configuration after evaluating |
| 273 | .Cm Host |
| 274 | and |
| 275 | .Cm Match |
| 276 | blocks and exit. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 277 | .Pp |
Damien Miller | 396691a | 2000-01-20 22:44:08 +1100 | [diff] [blame] | 278 | .It Fl g |
| 279 | Allows remote hosts to connect to local forwarded ports. |
Damien Miller | 49d9bfe | 2014-07-03 21:26:42 +1000 | [diff] [blame] | 280 | If used on a multiplexed connection, then this option must be specified |
| 281 | on the master process. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 282 | .Pp |
Damien Miller | 7ea845e | 2010-02-12 09:21:02 +1100 | [diff] [blame] | 283 | .It Fl I Ar pkcs11 |
Damien Miller | d400da5 | 2010-02-12 09:26:23 +1100 | [diff] [blame] | 284 | Specify the PKCS#11 shared library |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 285 | .Nm |
Damien Miller | a761844 | 2010-02-12 09:26:02 +1100 | [diff] [blame] | 286 | should use to communicate with a PKCS#11 token providing the user's |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 287 | private RSA key. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 288 | .Pp |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 289 | .It Fl i Ar identity_file |
Damien Miller | fae2386 | 2002-01-22 23:32:26 +1100 | [diff] [blame] | 290 | Selects a file from which the identity (private key) for |
Damien Miller | eb8b60e | 2010-08-31 22:41:14 +1000 | [diff] [blame] | 291 | public key authentication is read. |
Damien Miller | fae2386 | 2002-01-22 23:32:26 +1100 | [diff] [blame] | 292 | The default is |
Damien Miller | 167ea5d | 2005-05-26 12:04:02 +1000 | [diff] [blame] | 293 | .Pa ~/.ssh/identity |
Damien Miller | fae2386 | 2002-01-22 23:32:26 +1100 | [diff] [blame] | 294 | for protocol version 1, and |
Damien Miller | eb8b60e | 2010-08-31 22:41:14 +1000 | [diff] [blame] | 295 | .Pa ~/.ssh/id_dsa , |
Damien Miller | 8ba0ead | 2013-12-18 17:46:27 +1100 | [diff] [blame] | 296 | .Pa ~/.ssh/id_ecdsa , |
| 297 | .Pa ~/.ssh/id_ed25519 |
Damien Miller | fae2386 | 2002-01-22 23:32:26 +1100 | [diff] [blame] | 298 | and |
Damien Miller | eb8b60e | 2010-08-31 22:41:14 +1000 | [diff] [blame] | 299 | .Pa ~/.ssh/id_rsa |
Damien Miller | fae2386 | 2002-01-22 23:32:26 +1100 | [diff] [blame] | 300 | for protocol version 2. |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 301 | Identity files may also be specified on |
| 302 | a per-host basis in the configuration file. |
| 303 | It is possible to have multiple |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 304 | .Fl i |
| 305 | options (and multiple identities specified in |
| 306 | configuration files). |
jmc@openbsd.org | c5f7c08 | 2015-09-25 18:19:54 +0000 | [diff] [blame] | 307 | If no certificates have been explicitly specified by the |
djm@openbsd.org | 4e44a79 | 2015-09-24 06:15:11 +0000 | [diff] [blame] | 308 | .Cm CertificateFile |
| 309 | directive, |
Damien Miller | 5059d8d | 2010-03-05 21:31:11 +1100 | [diff] [blame] | 310 | .Nm |
| 311 | will also try to load certificate information from the filename obtained |
| 312 | by appending |
| 313 | .Pa -cert.pub |
| 314 | to identity filenames. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 315 | .Pp |
djm@openbsd.org | ed877ef | 2016-07-15 00:24:30 +0000 | [diff] [blame] | 316 | .It Fl J Xo |
| 317 | .Sm off |
jmc@openbsd.org | e4eb7d9 | 2016-07-16 06:57:55 +0000 | [diff] [blame] | 318 | .Op Ar user No @ |
| 319 | .Ar host |
| 320 | .Op : Ar port |
djm@openbsd.org | ed877ef | 2016-07-15 00:24:30 +0000 | [diff] [blame] | 321 | .Sm on |
| 322 | .Xc |
| 323 | Connect to the target host by first making a |
| 324 | .Nm |
jmc@openbsd.org | e4eb7d9 | 2016-07-16 06:57:55 +0000 | [diff] [blame] | 325 | connection to the jump |
| 326 | .Ar host |
| 327 | and then establishing a TCP forwarding to the ultimate destination from |
djm@openbsd.org | ed877ef | 2016-07-15 00:24:30 +0000 | [diff] [blame] | 328 | there. |
| 329 | Multiple jump hops may be specified separated by comma characters. |
| 330 | This is a shortcut to specify a |
| 331 | .Cm ProxyJump |
| 332 | configuration directive. |
| 333 | .Pp |
Darren Tucker | 415bddc | 2007-06-12 23:43:16 +1000 | [diff] [blame] | 334 | .It Fl K |
| 335 | Enables GSSAPI-based authentication and forwarding (delegation) of GSSAPI |
| 336 | credentials to the server. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 337 | .Pp |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 338 | .It Fl k |
Damien Miller | e0113cc | 2003-11-24 13:10:09 +1100 | [diff] [blame] | 339 | Disables forwarding (delegation) of GSSAPI credentials to the server. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 340 | .Pp |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 341 | .It Fl L Xo |
| 342 | .Sm off |
Damien Miller | f91ee4c | 2005-03-01 21:24:33 +1100 | [diff] [blame] | 343 | .Oo Ar bind_address : Oc |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 344 | .Ar port : host : hostport |
| 345 | .Sm on |
| 346 | .Xc |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 347 | .It Fl L Xo |
| 348 | .Sm off |
| 349 | .Oo Ar bind_address : Oc |
| 350 | .Ar port : remote_socket |
| 351 | .Sm on |
| 352 | .Xc |
| 353 | .It Fl L Xo |
| 354 | .Sm off |
| 355 | .Ar local_socket : host : hostport |
| 356 | .Sm on |
| 357 | .Xc |
| 358 | .It Fl L Xo |
| 359 | .Sm off |
| 360 | .Ar local_socket : remote_socket |
| 361 | .Sm on |
| 362 | .Xc |
| 363 | Specifies that connections to the given TCP port or Unix socket on the local |
| 364 | (client) host are to be forwarded to the given host and port, or Unix socket, |
| 365 | on the remote side. |
| 366 | This works by allocating a socket to listen to either a TCP |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 367 | .Ar port |
Damien Miller | f91ee4c | 2005-03-01 21:24:33 +1100 | [diff] [blame] | 368 | on the local side, optionally bound to the specified |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 369 | .Ar bind_address , |
| 370 | or to a Unix socket. |
| 371 | Whenever a connection is made to the local port or socket, the |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 372 | connection is forwarded over the secure channel, and a connection is |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 373 | made to either |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 374 | .Ar host |
| 375 | port |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 376 | .Ar hostport , |
| 377 | or the Unix socket |
| 378 | .Ar remote_socket , |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 379 | from the remote machine. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 380 | .Pp |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 381 | Port forwardings can also be specified in the configuration file. |
Damien Miller | f91ee4c | 2005-03-01 21:24:33 +1100 | [diff] [blame] | 382 | Only the superuser can forward privileged ports. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 383 | IPv6 addresses can be specified by enclosing the address in square brackets. |
| 384 | .Pp |
Damien Miller | f91ee4c | 2005-03-01 21:24:33 +1100 | [diff] [blame] | 385 | By default, the local port is bound in accordance with the |
| 386 | .Cm GatewayPorts |
| 387 | setting. |
| 388 | However, an explicit |
| 389 | .Ar bind_address |
| 390 | may be used to bind the connection to a specific address. |
| 391 | The |
| 392 | .Ar bind_address |
| 393 | of |
| 394 | .Dq localhost |
Damien Miller | 36bf7dd | 2005-03-02 12:02:47 +1100 | [diff] [blame] | 395 | indicates that the listening port be bound for local use only, while an |
| 396 | empty address or |
| 397 | .Sq * |
Damien Miller | f91ee4c | 2005-03-01 21:24:33 +1100 | [diff] [blame] | 398 | indicates that the port should be available from all interfaces. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 399 | .Pp |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 400 | .It Fl l Ar login_name |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 401 | Specifies the user to log in as on the remote machine. |
| 402 | This also may be specified on a per-host basis in the configuration file. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 403 | .Pp |
Damien Miller | 0e220db | 2004-06-15 10:34:08 +1000 | [diff] [blame] | 404 | .It Fl M |
| 405 | Places the |
| 406 | .Nm |
| 407 | client into |
| 408 | .Dq master |
| 409 | mode for connection sharing. |
Damien Miller | 88b2552 | 2005-12-31 16:23:15 +1100 | [diff] [blame] | 410 | Multiple |
| 411 | .Fl M |
| 412 | options places |
| 413 | .Nm |
| 414 | into |
| 415 | .Dq master |
| 416 | mode with confirmation required before slave connections are accepted. |
Damien Miller | 0e220db | 2004-06-15 10:34:08 +1000 | [diff] [blame] | 417 | Refer to the description of |
| 418 | .Cm ControlMaster |
| 419 | in |
| 420 | .Xr ssh_config 5 |
| 421 | for details. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 422 | .Pp |
Damien Miller | 5d1eceb | 2004-06-30 22:37:57 +1000 | [diff] [blame] | 423 | .It Fl m Ar mac_spec |
jmc@openbsd.org | a685ae8 | 2016-02-17 07:38:19 +0000 | [diff] [blame] | 424 | A comma-separated list of MAC (message authentication code) algorithms, |
| 425 | specified in order of preference. |
Damien Miller | 5d1eceb | 2004-06-30 22:37:57 +1000 | [diff] [blame] | 426 | See the |
| 427 | .Cm MACs |
| 428 | keyword for more information. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 429 | .Pp |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 430 | .It Fl N |
| 431 | Do not execute a remote command. |
jmc@openbsd.org | a685ae8 | 2016-02-17 07:38:19 +0000 | [diff] [blame] | 432 | This is useful for just forwarding ports. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 433 | .Pp |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 434 | .It Fl n |
| 435 | Redirects stdin from |
| 436 | .Pa /dev/null |
| 437 | (actually, prevents reading from stdin). |
| 438 | This must be used when |
| 439 | .Nm |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 440 | is run in the background. |
| 441 | A common trick is to use this to run X11 programs on a remote machine. |
| 442 | For example, |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 443 | .Ic ssh -n shadows.cs.hut.fi emacs & |
| 444 | will start an emacs on shadows.cs.hut.fi, and the X11 |
| 445 | connection will be automatically forwarded over an encrypted channel. |
| 446 | The |
| 447 | .Nm |
| 448 | program will be put in the background. |
| 449 | (This does not work if |
| 450 | .Nm |
| 451 | needs to ask for a password or passphrase; see also the |
| 452 | .Fl f |
| 453 | option.) |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 454 | .Pp |
Darren Tucker | e04644c | 2004-12-03 14:08:45 +1100 | [diff] [blame] | 455 | .It Fl O Ar ctl_cmd |
| 456 | Control an active connection multiplexing master process. |
| 457 | When the |
| 458 | .Fl O |
| 459 | option is specified, the |
| 460 | .Ar ctl_cmd |
| 461 | argument is interpreted and passed to the master process. |
| 462 | Valid commands are: |
| 463 | .Dq check |
Damien Miller | 388f6fc | 2010-05-21 14:57:35 +1000 | [diff] [blame] | 464 | (check that the master process is running), |
| 465 | .Dq forward |
Damien Miller | 8cb1cda | 2011-05-05 14:16:56 +1000 | [diff] [blame] | 466 | (request forwardings without command execution), |
Damien Miller | 1bcbd0a | 2011-09-22 21:40:45 +1000 | [diff] [blame] | 467 | .Dq cancel |
| 468 | (cancel forwardings), |
Darren Tucker | e04644c | 2004-12-03 14:08:45 +1100 | [diff] [blame] | 469 | .Dq exit |
Damien Miller | 8cb1cda | 2011-05-05 14:16:56 +1000 | [diff] [blame] | 470 | (request the master to exit), and |
Damien Miller | 6c3eec7 | 2011-05-05 14:16:22 +1000 | [diff] [blame] | 471 | .Dq stop |
| 472 | (request the master to stop accepting further multiplexing requests). |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 473 | .Pp |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 474 | .It Fl o Ar option |
Ben Lindstrom | 14c62eb | 2001-08-15 23:25:46 +0000 | [diff] [blame] | 475 | Can be used to give options in the format used in the configuration file. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 476 | This is useful for specifying options for which there is no separate |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 477 | command-line flag. |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 478 | For full details of the options listed below, and their possible values, see |
| 479 | .Xr ssh_config 5 . |
| 480 | .Pp |
| 481 | .Bl -tag -width Ds -offset indent -compact |
jcs@openbsd.org | f361df4 | 2015-11-15 22:26:49 +0000 | [diff] [blame] | 482 | .It AddKeysToAgent |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 483 | .It AddressFamily |
| 484 | .It BatchMode |
| 485 | .It BindAddress |
Damien Miller | 0faf747 | 2013-10-17 11:47:23 +1100 | [diff] [blame] | 486 | .It CanonicalDomains |
Damien Miller | 3850559 | 2013-10-17 11:48:13 +1100 | [diff] [blame] | 487 | .It CanonicalizeFallbackLocal |
| 488 | .It CanonicalizeHostname |
| 489 | .It CanonicalizeMaxDots |
| 490 | .It CanonicalizePermittedCNAMEs |
djm@openbsd.org | 4e44a79 | 2015-09-24 06:15:11 +0000 | [diff] [blame] | 491 | .It CertificateFile |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 492 | .It ChallengeResponseAuthentication |
| 493 | .It CheckHostIP |
| 494 | .It Cipher |
| 495 | .It Ciphers |
| 496 | .It ClearAllForwardings |
| 497 | .It Compression |
| 498 | .It CompressionLevel |
| 499 | .It ConnectionAttempts |
Darren Tucker | edae0ec | 2004-05-02 22:15:52 +1000 | [diff] [blame] | 500 | .It ConnectTimeout |
Damien Miller | 0e220db | 2004-06-15 10:34:08 +1000 | [diff] [blame] | 501 | .It ControlMaster |
| 502 | .It ControlPath |
Damien Miller | efad727 | 2011-09-22 21:33:53 +1000 | [diff] [blame] | 503 | .It ControlPersist |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 504 | .It DynamicForward |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 505 | .It EscapeChar |
Darren Tucker | e7d4b19 | 2006-07-12 22:17:10 +1000 | [diff] [blame] | 506 | .It ExitOnForwardFailure |
jmc@openbsd.org | 8abd803 | 2014-12-22 09:26:31 +0000 | [diff] [blame] | 507 | .It FingerprintHash |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 508 | .It ForwardAgent |
| 509 | .It ForwardX11 |
Damien Miller | efad727 | 2011-09-22 21:33:53 +1000 | [diff] [blame] | 510 | .It ForwardX11Timeout |
Darren Tucker | 0a118da | 2003-10-15 15:54:32 +1000 | [diff] [blame] | 511 | .It ForwardX11Trusted |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 512 | .It GatewayPorts |
| 513 | .It GlobalKnownHostsFile |
| 514 | .It GSSAPIAuthentication |
| 515 | .It GSSAPIDelegateCredentials |
Damien Miller | e177615 | 2005-03-01 21:47:37 +1100 | [diff] [blame] | 516 | .It HashKnownHosts |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 517 | .It Host |
| 518 | .It HostbasedAuthentication |
djm@openbsd.org | 46347ed | 2015-01-30 11:43:14 +0000 | [diff] [blame] | 519 | .It HostbasedKeyTypes |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 520 | .It HostKeyAlgorithms |
| 521 | .It HostKeyAlias |
| 522 | .It HostName |
jmc@openbsd.org | 772e6ce | 2016-06-29 17:14:28 +0000 | [diff] [blame] | 523 | .It IdentitiesOnly |
markus@openbsd.org | b02ad1c | 2016-05-04 12:21:53 +0000 | [diff] [blame] | 524 | .It IdentityAgent |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 525 | .It IdentityFile |
djm@openbsd.org | dc7990b | 2016-04-15 00:30:19 +0000 | [diff] [blame] | 526 | .It Include |
Damien Miller | 0a18473 | 2010-11-20 15:21:03 +1100 | [diff] [blame] | 527 | .It IPQoS |
Damien Miller | efad727 | 2011-09-22 21:33:53 +1000 | [diff] [blame] | 528 | .It KbdInteractiveAuthentication |
Darren Tucker | 636ca90 | 2004-11-05 20:22:00 +1100 | [diff] [blame] | 529 | .It KbdInteractiveDevices |
Damien Miller | 7fe2b1f | 2010-09-24 22:11:53 +1000 | [diff] [blame] | 530 | .It KexAlgorithms |
Damien Miller | d27b947 | 2005-12-13 19:29:02 +1100 | [diff] [blame] | 531 | .It LocalCommand |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 532 | .It LocalForward |
| 533 | .It LogLevel |
| 534 | .It MACs |
Damien Miller | d77b81f | 2013-10-17 11:39:00 +1100 | [diff] [blame] | 535 | .It Match |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 536 | .It NoHostAuthenticationForLocalhost |
| 537 | .It NumberOfPasswordPrompts |
| 538 | .It PasswordAuthentication |
Damien Miller | d27b947 | 2005-12-13 19:29:02 +1100 | [diff] [blame] | 539 | .It PermitLocalCommand |
Damien Miller | 7ea845e | 2010-02-12 09:21:02 +1100 | [diff] [blame] | 540 | .It PKCS11Provider |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 541 | .It Port |
| 542 | .It PreferredAuthentications |
| 543 | .It Protocol |
| 544 | .It ProxyCommand |
djm@openbsd.org | ed877ef | 2016-07-15 00:24:30 +0000 | [diff] [blame] | 545 | .It ProxyJump |
Damien Miller | f2f6c31 | 2013-08-21 02:44:58 +1000 | [diff] [blame] | 546 | .It ProxyUseFdpass |
markus@openbsd.org | 3a1638d | 2015-07-10 06:21:53 +0000 | [diff] [blame] | 547 | .It PubkeyAcceptedKeyTypes |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 548 | .It PubkeyAuthentication |
Darren Tucker | 62388b2 | 2006-01-20 11:31:47 +1100 | [diff] [blame] | 549 | .It RekeyLimit |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 550 | .It RemoteForward |
Damien Miller | f4b32aa | 2011-05-15 08:47:43 +1000 | [diff] [blame] | 551 | .It RequestTTY |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 552 | .It RhostsRSAAuthentication |
| 553 | .It RSAAuthentication |
Darren Tucker | 7a6c066 | 2004-05-02 22:14:03 +1000 | [diff] [blame] | 554 | .It SendEnv |
Damien Miller | 509b010 | 2003-12-17 16:33:10 +1100 | [diff] [blame] | 555 | .It ServerAliveInterval |
| 556 | .It ServerAliveCountMax |
Damien Miller | 6d57656 | 2014-07-18 15:02:06 +1000 | [diff] [blame] | 557 | .It StreamLocalBindMask |
| 558 | .It StreamLocalBindUnlink |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 559 | .It StrictHostKeyChecking |
Damien Miller | 12c150e | 2003-12-17 16:31:10 +1100 | [diff] [blame] | 560 | .It TCPKeepAlive |
Damien Miller | d27b947 | 2005-12-13 19:29:02 +1100 | [diff] [blame] | 561 | .It Tunnel |
| 562 | .It TunnelDevice |
djm@openbsd.org | 1d1092b | 2015-01-26 12:16:36 +0000 | [diff] [blame] | 563 | .It UpdateHostKeys |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 564 | .It UsePrivilegedPort |
| 565 | .It User |
| 566 | .It UserKnownHostsFile |
| 567 | .It VerifyHostKeyDNS |
Damien Miller | 8639920 | 2008-06-30 00:04:31 +1000 | [diff] [blame] | 568 | .It VisualHostKey |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 569 | .It XAuthLocation |
| 570 | .El |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 571 | .Pp |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 572 | .It Fl p Ar port |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 573 | Port to connect to on the remote host. |
| 574 | This can be specified on a |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 575 | per-host basis in the configuration file. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 576 | .Pp |
djm@openbsd.org | c0f55db | 2015-09-11 03:42:32 +0000 | [diff] [blame] | 577 | .It Fl Q Ar query_option |
Damien Miller | ea11119 | 2013-04-23 19:24:32 +1000 | [diff] [blame] | 578 | Queries |
| 579 | .Nm |
Damien Miller | d937dc0 | 2013-12-05 10:19:54 +1100 | [diff] [blame] | 580 | for the algorithms supported for the specified version 2. |
| 581 | The available features are: |
| 582 | .Ar cipher |
Damien Miller | ea11119 | 2013-04-23 19:24:32 +1000 | [diff] [blame] | 583 | (supported symmetric ciphers), |
Damien Miller | d937dc0 | 2013-12-05 10:19:54 +1100 | [diff] [blame] | 584 | .Ar cipher-auth |
Damien Miller | 0fde8ac | 2013-11-21 14:12:23 +1100 | [diff] [blame] | 585 | (supported symmetric ciphers that support authenticated encryption), |
Damien Miller | d937dc0 | 2013-12-05 10:19:54 +1100 | [diff] [blame] | 586 | .Ar mac |
Damien Miller | ea11119 | 2013-04-23 19:24:32 +1000 | [diff] [blame] | 587 | (supported message integrity codes), |
Damien Miller | d937dc0 | 2013-12-05 10:19:54 +1100 | [diff] [blame] | 588 | .Ar kex |
Damien Miller | ea11119 | 2013-04-23 19:24:32 +1000 | [diff] [blame] | 589 | (key exchange algorithms), |
Damien Miller | d937dc0 | 2013-12-05 10:19:54 +1100 | [diff] [blame] | 590 | .Ar key |
djm@openbsd.org | c0f55db | 2015-09-11 03:42:32 +0000 | [diff] [blame] | 591 | (key types), |
| 592 | .Ar key-cert |
| 593 | (certificate key types), |
| 594 | .Ar key-plain |
| 595 | (non-certificate key types), and |
djm@openbsd.org | 68d2dfc | 2015-03-03 06:48:58 +0000 | [diff] [blame] | 596 | .Ar protocol-version |
| 597 | (supported SSH protocol versions). |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 598 | .Pp |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 599 | .It Fl q |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 600 | Quiet mode. |
Damien Miller | eb60247 | 2008-02-10 22:21:28 +1100 | [diff] [blame] | 601 | Causes most warning and diagnostic messages to be suppressed. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 602 | .Pp |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 603 | .It Fl R Xo |
| 604 | .Sm off |
Damien Miller | f91ee4c | 2005-03-01 21:24:33 +1100 | [diff] [blame] | 605 | .Oo Ar bind_address : Oc |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 606 | .Ar port : host : hostport |
| 607 | .Sm on |
| 608 | .Xc |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 609 | .It Fl R Xo |
| 610 | .Sm off |
| 611 | .Oo Ar bind_address : Oc |
| 612 | .Ar port : local_socket |
| 613 | .Sm on |
| 614 | .Xc |
| 615 | .It Fl R Xo |
| 616 | .Sm off |
| 617 | .Ar remote_socket : host : hostport |
| 618 | .Sm on |
| 619 | .Xc |
| 620 | .It Fl R Xo |
| 621 | .Sm off |
| 622 | .Ar remote_socket : local_socket |
| 623 | .Sm on |
| 624 | .Xc |
| 625 | Specifies that connections to the given TCP port or Unix socket on the remote |
| 626 | (server) host are to be forwarded to the given host and port, or Unix socket, |
| 627 | on the local side. |
| 628 | This works by allocating a socket to listen to either a TCP |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 629 | .Ar port |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 630 | or to a Unix socket on the remote side. |
| 631 | Whenever a connection is made to this port or Unix socket, the |
| 632 | connection is forwarded over the secure channel, and a connection |
| 633 | is made to either |
Damien Miller | 34132e5 | 2000-01-14 15:45:46 +1100 | [diff] [blame] | 634 | .Ar host |
| 635 | port |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 636 | .Ar hostport , |
| 637 | or |
| 638 | .Ar local_socket , |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 639 | from the local machine. |
Damien Miller | f91ee4c | 2005-03-01 21:24:33 +1100 | [diff] [blame] | 640 | .Pp |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 641 | Port forwardings can also be specified in the configuration file. |
| 642 | Privileged ports can be forwarded only when |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 643 | logging in as root on the remote machine. |
Damien Miller | 70b2d55 | 2012-04-22 11:26:10 +1000 | [diff] [blame] | 644 | IPv6 addresses can be specified by enclosing the address in square brackets. |
Damien Miller | f91ee4c | 2005-03-01 21:24:33 +1100 | [diff] [blame] | 645 | .Pp |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 646 | By default, TCP listening sockets on the server will be bound to the loopback |
Damien Miller | f91ee4c | 2005-03-01 21:24:33 +1100 | [diff] [blame] | 647 | interface only. |
Darren Tucker | 63917bd | 2008-11-11 16:33:48 +1100 | [diff] [blame] | 648 | This may be overridden by specifying a |
Damien Miller | f91ee4c | 2005-03-01 21:24:33 +1100 | [diff] [blame] | 649 | .Ar bind_address . |
Damien Miller | 36bf7dd | 2005-03-02 12:02:47 +1100 | [diff] [blame] | 650 | An empty |
| 651 | .Ar bind_address , |
Damien Miller | f91ee4c | 2005-03-01 21:24:33 +1100 | [diff] [blame] | 652 | or the address |
Damien Miller | 36bf7dd | 2005-03-02 12:02:47 +1100 | [diff] [blame] | 653 | .Ql * , |
Damien Miller | f91ee4c | 2005-03-01 21:24:33 +1100 | [diff] [blame] | 654 | indicates that the remote socket should listen on all interfaces. |
| 655 | Specifying a remote |
| 656 | .Ar bind_address |
Damien Miller | 36bf7dd | 2005-03-02 12:02:47 +1100 | [diff] [blame] | 657 | will only succeed if the server's |
| 658 | .Cm GatewayPorts |
Damien Miller | f91ee4c | 2005-03-01 21:24:33 +1100 | [diff] [blame] | 659 | option is enabled (see |
Damien Miller | 36bf7dd | 2005-03-02 12:02:47 +1100 | [diff] [blame] | 660 | .Xr sshd_config 5 ) . |
Damien Miller | e2f4cc5 | 2009-02-14 16:33:49 +1100 | [diff] [blame] | 661 | .Pp |
| 662 | If the |
| 663 | .Ar port |
| 664 | argument is |
Damien Miller | 65fa4ca | 2009-02-14 16:34:05 +1100 | [diff] [blame] | 665 | .Ql 0 , |
Damien Miller | e2f4cc5 | 2009-02-14 16:33:49 +1100 | [diff] [blame] | 666 | the listen port will be dynamically allocated on the server and reported |
| 667 | to the client at run time. |
Damien Miller | 388f6fc | 2010-05-21 14:57:35 +1000 | [diff] [blame] | 668 | When used together with |
| 669 | .Ic -O forward |
| 670 | the allocated port will be printed to the standard output. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 671 | .Pp |
Darren Tucker | 7ebfc10 | 2004-11-07 20:06:19 +1100 | [diff] [blame] | 672 | .It Fl S Ar ctl_path |
Damien Miller | 67f30d7 | 2010-04-16 15:52:03 +1000 | [diff] [blame] | 673 | Specifies the location of a control socket for connection sharing, |
Damien Miller | 9c60f24 | 2010-03-26 11:28:35 +1100 | [diff] [blame] | 674 | or the string |
| 675 | .Dq none |
| 676 | to disable connection sharing. |
Damien Miller | 0e220db | 2004-06-15 10:34:08 +1000 | [diff] [blame] | 677 | Refer to the description of |
Darren Tucker | ba5c592 | 2004-06-18 16:22:39 +1000 | [diff] [blame] | 678 | .Cm ControlPath |
| 679 | and |
Damien Miller | 0e220db | 2004-06-15 10:34:08 +1000 | [diff] [blame] | 680 | .Cm ControlMaster |
| 681 | in |
| 682 | .Xr ssh_config 5 |
| 683 | for details. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 684 | .Pp |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 685 | .It Fl s |
| 686 | May be used to request invocation of a subsystem on the remote system. |
jmc@openbsd.org | a685ae8 | 2016-02-17 07:38:19 +0000 | [diff] [blame] | 687 | Subsystems facilitate the use of SSH |
| 688 | as a secure transport for other applications (e.g.\& |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 689 | .Xr sftp 1 ) . |
| 690 | The subsystem is specified as the remote command. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 691 | .Pp |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 692 | .It Fl T |
dtucker@openbsd.org | f8484da | 2015-05-06 05:45:17 +0000 | [diff] [blame] | 693 | Disable pseudo-terminal allocation. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 694 | .Pp |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 695 | .It Fl t |
dtucker@openbsd.org | f8484da | 2015-05-06 05:45:17 +0000 | [diff] [blame] | 696 | Force pseudo-terminal allocation. |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 697 | This can be used to execute arbitrary |
| 698 | screen-based programs on a remote machine, which can be very useful, |
Damien Miller | 208f1ed | 2006-03-15 11:56:03 +1100 | [diff] [blame] | 699 | e.g. when implementing menu services. |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 700 | Multiple |
| 701 | .Fl t |
| 702 | options force tty allocation, even if |
Ben Lindstrom | 19ceb17 | 2001-09-12 17:54:24 +0000 | [diff] [blame] | 703 | .Nm |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 704 | has no local tty. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 705 | .Pp |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 706 | .It Fl V |
| 707 | Display the version number and exit. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 708 | .Pp |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 709 | .It Fl v |
| 710 | Verbose mode. |
| 711 | Causes |
Ben Lindstrom | 5ab6ae1 | 2001-02-10 22:08:03 +0000 | [diff] [blame] | 712 | .Nm |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 713 | to print debugging messages about its progress. |
| 714 | This is helpful in |
| 715 | debugging connection, authentication, and configuration problems. |
| 716 | Multiple |
| 717 | .Fl v |
| 718 | options increase the verbosity. |
| 719 | The maximum is 3. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 720 | .Pp |
Darren Tucker | 7ad8dd2 | 2010-01-12 19:40:27 +1100 | [diff] [blame] | 721 | .It Fl W Ar host : Ns Ar port |
| 722 | Requests that standard input and output on the client be forwarded to |
| 723 | .Ar host |
| 724 | on |
| 725 | .Ar port |
| 726 | over the secure channel. |
| 727 | Implies |
| 728 | .Fl N , |
| 729 | .Fl T , |
| 730 | .Cm ExitOnForwardFailure |
| 731 | and |
jmc@openbsd.org | 6915f16 | 2016-06-03 06:44:12 +0000 | [diff] [blame] | 732 | .Cm ClearAllForwardings , |
| 733 | though these can be overridden in the configuration file or using |
dtucker@openbsd.org | 0cb2f4c | 2016-06-03 04:09:38 +0000 | [diff] [blame] | 734 | .Fl o |
| 735 | command line options. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 736 | .Pp |
Damien Miller | 991dba4 | 2006-07-10 20:16:27 +1000 | [diff] [blame] | 737 | .It Fl w Xo |
| 738 | .Ar local_tun Ns Op : Ns Ar remote_tun |
| 739 | .Xc |
| 740 | Requests |
| 741 | tunnel |
| 742 | device forwarding with the specified |
Damien Miller | d27b947 | 2005-12-13 19:29:02 +1100 | [diff] [blame] | 743 | .Xr tun 4 |
Damien Miller | 991dba4 | 2006-07-10 20:16:27 +1000 | [diff] [blame] | 744 | devices between the client |
| 745 | .Pq Ar local_tun |
| 746 | and the server |
| 747 | .Pq Ar remote_tun . |
| 748 | .Pp |
Damien Miller | cf1e342 | 2005-12-24 14:56:04 +1100 | [diff] [blame] | 749 | The devices may be specified by numerical ID or the keyword |
| 750 | .Dq any , |
| 751 | which uses the next available tunnel device. |
Damien Miller | 991dba4 | 2006-07-10 20:16:27 +1000 | [diff] [blame] | 752 | If |
| 753 | .Ar remote_tun |
| 754 | is not specified, it defaults to |
| 755 | .Dq any . |
Damien Miller | cf1e342 | 2005-12-24 14:56:04 +1100 | [diff] [blame] | 756 | See also the |
Damien Miller | d27b947 | 2005-12-13 19:29:02 +1100 | [diff] [blame] | 757 | .Cm Tunnel |
Damien Miller | 991dba4 | 2006-07-10 20:16:27 +1000 | [diff] [blame] | 758 | and |
| 759 | .Cm TunnelDevice |
| 760 | directives in |
Damien Miller | d27b947 | 2005-12-13 19:29:02 +1100 | [diff] [blame] | 761 | .Xr ssh_config 5 . |
Damien Miller | 991dba4 | 2006-07-10 20:16:27 +1000 | [diff] [blame] | 762 | If the |
| 763 | .Cm Tunnel |
| 764 | directive is unset, it is set to the default tunnel mode, which is |
| 765 | .Dq point-to-point . |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 766 | .Pp |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 767 | .It Fl X |
| 768 | Enables X11 forwarding. |
| 769 | This can also be specified on a per-host basis in a configuration file. |
| 770 | .Pp |
| 771 | X11 forwarding should be enabled with caution. |
| 772 | Users with the ability to bypass file permissions on the remote host |
| 773 | (for the user's X authorization database) |
| 774 | can access the local X11 display through the forwarded connection. |
| 775 | An attacker may then be able to perform activities such as keystroke monitoring. |
Damien Miller | 947219e | 2005-03-02 13:22:30 +1100 | [diff] [blame] | 776 | .Pp |
Damien Miller | b022b23 | 2005-03-05 11:22:36 +1100 | [diff] [blame] | 777 | For this reason, X11 forwarding is subjected to X11 SECURITY extension |
Damien Miller | 947219e | 2005-03-02 13:22:30 +1100 | [diff] [blame] | 778 | restrictions by default. |
| 779 | Please refer to the |
| 780 | .Nm |
| 781 | .Fl Y |
| 782 | option and the |
| 783 | .Cm ForwardX11Trusted |
| 784 | directive in |
| 785 | .Xr ssh_config 5 |
| 786 | for more information. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 787 | .Pp |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 788 | .It Fl x |
| 789 | Disables X11 forwarding. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 790 | .Pp |
Darren Tucker | 0a118da | 2003-10-15 15:54:32 +1000 | [diff] [blame] | 791 | .It Fl Y |
| 792 | Enables trusted X11 forwarding. |
Damien Miller | 947219e | 2005-03-02 13:22:30 +1100 | [diff] [blame] | 793 | Trusted X11 forwardings are not subjected to the X11 SECURITY extension |
| 794 | controls. |
millert@openbsd.org | 79ec214 | 2015-07-20 15:39:52 +0000 | [diff] [blame] | 795 | .Pp |
Damien Miller | e272a5b | 2008-11-03 19:22:37 +1100 | [diff] [blame] | 796 | .It Fl y |
| 797 | Send log information using the |
| 798 | .Xr syslog 3 |
| 799 | system module. |
| 800 | By default this information is sent to stderr. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 801 | .El |
Damien Miller | e9b333a | 2005-12-24 14:53:04 +1100 | [diff] [blame] | 802 | .Pp |
| 803 | .Nm |
| 804 | may additionally obtain configuration data from |
| 805 | a per-user configuration file and a system-wide configuration file. |
| 806 | The file format and configuration options are described in |
| 807 | .Xr ssh_config 5 . |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 808 | .Sh AUTHENTICATION |
Darren Tucker | 94299ec | 2006-01-20 11:30:14 +1100 | [diff] [blame] | 809 | The OpenSSH SSH client supports SSH protocols 1 and 2. |
Darren Tucker | 7a4a765 | 2009-10-11 21:51:40 +1100 | [diff] [blame] | 810 | The default is to use protocol 2 only, |
| 811 | though this can be changed via the |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 812 | .Cm Protocol |
| 813 | option in |
Darren Tucker | 7a4a765 | 2009-10-11 21:51:40 +1100 | [diff] [blame] | 814 | .Xr ssh_config 5 |
| 815 | or the |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 816 | .Fl 1 |
| 817 | and |
| 818 | .Fl 2 |
| 819 | options (see above). |
jmc@openbsd.org | a685ae8 | 2016-02-17 07:38:19 +0000 | [diff] [blame] | 820 | Protocol 1 should not be used |
| 821 | and is only offered to support legacy devices. |
| 822 | It suffers from a number of cryptographic weaknesses |
| 823 | and doesn't support many of the advanced features available for protocol 2. |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 824 | .Pp |
| 825 | The methods available for authentication are: |
Damien Miller | fbc94c8 | 2006-06-13 13:03:16 +1000 | [diff] [blame] | 826 | GSSAPI-based authentication, |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 827 | host-based authentication, |
| 828 | public key authentication, |
| 829 | challenge-response authentication, |
| 830 | and password authentication. |
| 831 | Authentication methods are tried in the order specified above, |
jmc@openbsd.org | a685ae8 | 2016-02-17 07:38:19 +0000 | [diff] [blame] | 832 | though |
| 833 | .Cm PreferredAuthentications |
| 834 | can be used to change the default order. |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 835 | .Pp |
| 836 | Host-based authentication works as follows: |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 837 | If the machine the user logs in from is listed in |
| 838 | .Pa /etc/hosts.equiv |
| 839 | or |
| 840 | .Pa /etc/shosts.equiv |
| 841 | on the remote machine, and the user names are |
| 842 | the same on both sides, or if the files |
| 843 | .Pa ~/.rhosts |
| 844 | or |
| 845 | .Pa ~/.shosts |
| 846 | exist in the user's home directory on the |
| 847 | remote machine and contain a line containing the name of the client |
| 848 | machine and the name of the user on that machine, the user is |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 849 | considered for login. |
| 850 | Additionally, the server |
| 851 | .Em must |
| 852 | be able to verify the client's |
| 853 | host key (see the description of |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 854 | .Pa /etc/ssh/ssh_known_hosts |
| 855 | and |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 856 | .Pa ~/.ssh/known_hosts , |
| 857 | below) |
| 858 | for login to be permitted. |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 859 | This authentication method closes security holes due to IP |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 860 | spoofing, DNS spoofing, and routing spoofing. |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 861 | [Note to the administrator: |
| 862 | .Pa /etc/hosts.equiv , |
| 863 | .Pa ~/.rhosts , |
| 864 | and the rlogin/rsh protocol in general, are inherently insecure and should be |
| 865 | disabled if security is desired.] |
| 866 | .Pp |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 867 | Public key authentication works as follows: |
| 868 | The scheme is based on public-key cryptography, |
| 869 | using cryptosystems |
| 870 | where encryption and decryption are done using separate keys, |
| 871 | and it is unfeasible to derive the decryption key from the encryption key. |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 872 | The idea is that each user creates a public/private |
| 873 | key pair for authentication purposes. |
| 874 | The server knows the public key, and only the user knows the private key. |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 875 | .Nm |
| 876 | implements public key authentication protocol automatically, |
sobrado@openbsd.org | f70b22b | 2014-08-30 15:33:50 +0000 | [diff] [blame] | 877 | using one of the DSA, ECDSA, Ed25519 or RSA algorithms. |
Damien Miller | fecfd11 | 2013-07-18 16:11:50 +1000 | [diff] [blame] | 878 | The HISTORY section of |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 879 | .Xr ssl 8 |
Damien Miller | d442790 | 2010-09-10 11:15:10 +1000 | [diff] [blame] | 880 | contains a brief discussion of the DSA and RSA algorithms. |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 881 | .Pp |
| 882 | The file |
| 883 | .Pa ~/.ssh/authorized_keys |
| 884 | lists the public keys that are permitted for logging in. |
| 885 | When the user logs in, the |
| 886 | .Nm |
| 887 | program tells the server which key pair it would like to use for |
| 888 | authentication. |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 889 | The client proves that it has access to the private key |
| 890 | and the server checks that the corresponding public key |
| 891 | is authorized to accept the account. |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 892 | .Pp |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 893 | The user creates his/her key pair by running |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 894 | .Xr ssh-keygen 1 . |
| 895 | This stores the private key in |
| 896 | .Pa ~/.ssh/identity |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 897 | (protocol 1), |
| 898 | .Pa ~/.ssh/id_dsa |
jmc@openbsd.org | a685ae8 | 2016-02-17 07:38:19 +0000 | [diff] [blame] | 899 | (DSA), |
Damien Miller | eb8b60e | 2010-08-31 22:41:14 +1000 | [diff] [blame] | 900 | .Pa ~/.ssh/id_ecdsa |
jmc@openbsd.org | a685ae8 | 2016-02-17 07:38:19 +0000 | [diff] [blame] | 901 | (ECDSA), |
Damien Miller | 8ba0ead | 2013-12-18 17:46:27 +1100 | [diff] [blame] | 902 | .Pa ~/.ssh/id_ed25519 |
jmc@openbsd.org | a685ae8 | 2016-02-17 07:38:19 +0000 | [diff] [blame] | 903 | (Ed25519), |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 904 | or |
| 905 | .Pa ~/.ssh/id_rsa |
jmc@openbsd.org | a685ae8 | 2016-02-17 07:38:19 +0000 | [diff] [blame] | 906 | (RSA) |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 907 | and stores the public key in |
| 908 | .Pa ~/.ssh/identity.pub |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 909 | (protocol 1), |
| 910 | .Pa ~/.ssh/id_dsa.pub |
jmc@openbsd.org | a685ae8 | 2016-02-17 07:38:19 +0000 | [diff] [blame] | 911 | (DSA), |
Damien Miller | eb8b60e | 2010-08-31 22:41:14 +1000 | [diff] [blame] | 912 | .Pa ~/.ssh/id_ecdsa.pub |
jmc@openbsd.org | a685ae8 | 2016-02-17 07:38:19 +0000 | [diff] [blame] | 913 | (ECDSA), |
Damien Miller | 8ba0ead | 2013-12-18 17:46:27 +1100 | [diff] [blame] | 914 | .Pa ~/.ssh/id_ed25519.pub |
jmc@openbsd.org | a685ae8 | 2016-02-17 07:38:19 +0000 | [diff] [blame] | 915 | (Ed25519), |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 916 | or |
| 917 | .Pa ~/.ssh/id_rsa.pub |
jmc@openbsd.org | a685ae8 | 2016-02-17 07:38:19 +0000 | [diff] [blame] | 918 | (RSA) |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 919 | in the user's home directory. |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 920 | The user should then copy the public key |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 921 | to |
| 922 | .Pa ~/.ssh/authorized_keys |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 923 | in his/her home directory on the remote machine. |
| 924 | The |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 925 | .Pa authorized_keys |
| 926 | file corresponds to the conventional |
| 927 | .Pa ~/.rhosts |
| 928 | file, and has one key |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 929 | per line, though the lines can be very long. |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 930 | After this, the user can log in without giving the password. |
| 931 | .Pp |
Damien Miller | 922b541 | 2010-03-05 21:30:54 +1100 | [diff] [blame] | 932 | A variation on public key authentication |
| 933 | is available in the form of certificate authentication: |
| 934 | instead of a set of public/private keys, |
| 935 | signed certificates are used. |
| 936 | This has the advantage that a single trusted certification authority |
| 937 | can be used in place of many public/private keys. |
Damien Miller | fecfd11 | 2013-07-18 16:11:50 +1000 | [diff] [blame] | 938 | See the CERTIFICATES section of |
Damien Miller | 922b541 | 2010-03-05 21:30:54 +1100 | [diff] [blame] | 939 | .Xr ssh-keygen 1 |
| 940 | for more information. |
| 941 | .Pp |
| 942 | The most convenient way to use public key or certificate authentication |
| 943 | may be with an authentication agent. |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 944 | See |
| 945 | .Xr ssh-agent 1 |
jcs@openbsd.org | f361df4 | 2015-11-15 22:26:49 +0000 | [diff] [blame] | 946 | and (optionally) the |
| 947 | .Cm AddKeysToAgent |
| 948 | directive in |
| 949 | .Xr ssh_config 5 |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 950 | for more information. |
| 951 | .Pp |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 952 | Challenge-response authentication works as follows: |
| 953 | The server sends an arbitrary |
| 954 | .Qq challenge |
| 955 | text, and prompts for a response. |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 956 | Examples of challenge-response authentication include |
Damien Miller | b7727df | 2013-08-21 02:43:49 +1000 | [diff] [blame] | 957 | .Bx |
| 958 | Authentication (see |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 959 | .Xr login.conf 5 ) |
Damien Miller | b7727df | 2013-08-21 02:43:49 +1000 | [diff] [blame] | 960 | and PAM (some |
| 961 | .Pf non- Ox |
| 962 | systems). |
Damien Miller | c93a813 | 2005-12-24 14:52:13 +1100 | [diff] [blame] | 963 | .Pp |
| 964 | Finally, if other authentication methods fail, |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 965 | .Nm |
| 966 | prompts the user for a password. |
| 967 | The password is sent to the remote |
| 968 | host for checking; however, since all communications are encrypted, |
| 969 | the password cannot be seen by someone listening on the network. |
Damien Miller | 48c94ab | 2006-01-02 23:38:00 +1100 | [diff] [blame] | 970 | .Pp |
| 971 | .Nm |
| 972 | automatically maintains and checks a database containing |
| 973 | identification for all hosts it has ever been used with. |
| 974 | Host keys are stored in |
| 975 | .Pa ~/.ssh/known_hosts |
| 976 | in the user's home directory. |
| 977 | Additionally, the file |
| 978 | .Pa /etc/ssh/ssh_known_hosts |
| 979 | is automatically checked for known hosts. |
| 980 | Any new hosts are automatically added to the user's file. |
| 981 | If a host's identification ever changes, |
| 982 | .Nm |
| 983 | warns about this and disables password authentication to prevent |
| 984 | server spoofing or man-in-the-middle attacks, |
| 985 | which could otherwise be used to circumvent the encryption. |
| 986 | The |
| 987 | .Cm StrictHostKeyChecking |
| 988 | option can be used to control logins to machines whose |
| 989 | host key is not known or has changed. |
| 990 | .Pp |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 991 | When the user's identity has been accepted by the server, the server |
dtucker@openbsd.org | f8484da | 2015-05-06 05:45:17 +0000 | [diff] [blame] | 992 | either executes the given command in a non-interactive session or, |
| 993 | if no command has been specified, logs into the machine and gives |
| 994 | the user a normal shell as an interactive session. |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 995 | All communication with |
| 996 | the remote command or shell will be automatically encrypted. |
| 997 | .Pp |
dtucker@openbsd.org | f8484da | 2015-05-06 05:45:17 +0000 | [diff] [blame] | 998 | If an interactive session is requested |
| 999 | .Nm |
| 1000 | by default will only request a pseudo-terminal (pty) for interactive |
| 1001 | sessions when the client has one. |
| 1002 | The flags |
| 1003 | .Fl T |
| 1004 | and |
| 1005 | .Fl t |
| 1006 | can be used to override this behaviour. |
| 1007 | .Pp |
| 1008 | If a pseudo-terminal has been allocated the |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 1009 | user may use the escape characters noted below. |
| 1010 | .Pp |
dtucker@openbsd.org | f8484da | 2015-05-06 05:45:17 +0000 | [diff] [blame] | 1011 | If no pseudo-terminal has been allocated, |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 1012 | the session is transparent and can be used to reliably transfer binary data. |
| 1013 | On most systems, setting the escape character to |
| 1014 | .Dq none |
| 1015 | will also make the session transparent even if a tty is used. |
| 1016 | .Pp |
| 1017 | The session terminates when the command or shell on the remote |
Damien Miller | 8bfaf93 | 2006-01-14 10:09:30 +1100 | [diff] [blame] | 1018 | machine exits and all X11 and TCP connections have been closed. |
Damien Miller | 52d2061 | 2005-12-24 14:52:36 +1100 | [diff] [blame] | 1019 | .Sh ESCAPE CHARACTERS |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 1020 | When a pseudo-terminal has been requested, |
| 1021 | .Nm |
| 1022 | supports a number of functions through the use of an escape character. |
| 1023 | .Pp |
| 1024 | A single tilde character can be sent as |
| 1025 | .Ic ~~ |
| 1026 | or by following the tilde by a character other than those described below. |
| 1027 | The escape character must always follow a newline to be interpreted as |
| 1028 | special. |
| 1029 | The escape character can be changed in configuration files using the |
| 1030 | .Cm EscapeChar |
| 1031 | configuration directive or on the command line by the |
| 1032 | .Fl e |
| 1033 | option. |
| 1034 | .Pp |
| 1035 | The supported escapes (assuming the default |
| 1036 | .Ql ~ ) |
| 1037 | are: |
| 1038 | .Bl -tag -width Ds |
| 1039 | .It Cm ~. |
| 1040 | Disconnect. |
| 1041 | .It Cm ~^Z |
| 1042 | Background |
Damien Miller | 1164c29 | 2006-01-02 23:38:37 +1100 | [diff] [blame] | 1043 | .Nm . |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 1044 | .It Cm ~# |
| 1045 | List forwarded connections. |
| 1046 | .It Cm ~& |
| 1047 | Background |
| 1048 | .Nm |
| 1049 | at logout when waiting for forwarded connection / X11 sessions to terminate. |
| 1050 | .It Cm ~? |
| 1051 | Display a list of escape characters. |
| 1052 | .It Cm ~B |
| 1053 | Send a BREAK to the remote system |
jmc@openbsd.org | a685ae8 | 2016-02-17 07:38:19 +0000 | [diff] [blame] | 1054 | (only useful if the peer supports it). |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 1055 | .It Cm ~C |
| 1056 | Open command line. |
| 1057 | Currently this allows the addition of port forwardings using the |
Damien Miller | 0164cb8 | 2008-11-05 16:30:31 +1100 | [diff] [blame] | 1058 | .Fl L , |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 1059 | .Fl R |
Damien Miller | 0164cb8 | 2008-11-05 16:30:31 +1100 | [diff] [blame] | 1060 | and |
| 1061 | .Fl D |
Damien Miller | 329cb01 | 2005-12-24 14:53:23 +1100 | [diff] [blame] | 1062 | options (see above). |
Damien Miller | ff77364 | 2011-09-22 21:39:48 +1000 | [diff] [blame] | 1063 | It also allows the cancellation of existing port-forwardings |
| 1064 | with |
Damien Miller | 57e8ad3 | 2006-07-10 20:20:52 +1000 | [diff] [blame] | 1065 | .Sm off |
Damien Miller | ff77364 | 2011-09-22 21:39:48 +1000 | [diff] [blame] | 1066 | .Fl KL Oo Ar bind_address : Oc Ar port |
Damien Miller | 57e8ad3 | 2006-07-10 20:20:52 +1000 | [diff] [blame] | 1067 | .Sm on |
Damien Miller | ff77364 | 2011-09-22 21:39:48 +1000 | [diff] [blame] | 1068 | for local, |
| 1069 | .Sm off |
| 1070 | .Fl KR Oo Ar bind_address : Oc Ar port |
| 1071 | .Sm on |
| 1072 | for remote and |
| 1073 | .Sm off |
| 1074 | .Fl KD Oo Ar bind_address : Oc Ar port |
| 1075 | .Sm on |
| 1076 | for dynamic port-forwardings. |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 1077 | .Ic !\& Ns Ar command |
| 1078 | allows the user to execute a local command if the |
| 1079 | .Ic PermitLocalCommand |
| 1080 | option is enabled in |
| 1081 | .Xr ssh_config 5 . |
| 1082 | Basic help is available, using the |
| 1083 | .Fl h |
| 1084 | option. |
| 1085 | .It Cm ~R |
| 1086 | Request rekeying of the connection |
jmc@openbsd.org | a685ae8 | 2016-02-17 07:38:19 +0000 | [diff] [blame] | 1087 | (only useful if the peer supports it). |
Darren Tucker | 50a48d0 | 2012-09-06 21:25:37 +1000 | [diff] [blame] | 1088 | .It Cm ~V |
| 1089 | Decrease the verbosity |
| 1090 | .Pq Ic LogLevel |
| 1091 | when errors are being written to stderr. |
| 1092 | .It Cm ~v |
Darren Tucker | 83d0af6 | 2012-09-07 11:21:03 +1000 | [diff] [blame] | 1093 | Increase the verbosity |
Darren Tucker | 50a48d0 | 2012-09-06 21:25:37 +1000 | [diff] [blame] | 1094 | .Pq Ic LogLevel |
| 1095 | when errors are being written to stderr. |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 1096 | .El |
Damien Miller | f317718 | 2006-01-14 10:09:13 +1100 | [diff] [blame] | 1097 | .Sh TCP FORWARDING |
| 1098 | Forwarding of arbitrary TCP connections over the secure channel can |
| 1099 | be specified either on the command line or in a configuration file. |
| 1100 | One possible application of TCP forwarding is a secure connection to a |
| 1101 | mail server; another is going through firewalls. |
| 1102 | .Pp |
| 1103 | In the example below, we look at encrypting communication between |
| 1104 | an IRC client and server, even though the IRC server does not directly |
| 1105 | support encrypted communications. |
| 1106 | This works as follows: |
| 1107 | the user connects to the remote host using |
| 1108 | .Nm , |
| 1109 | specifying a port to be used to forward connections |
| 1110 | to the remote server. |
| 1111 | After that it is possible to start the service which is to be encrypted |
| 1112 | on the client machine, |
| 1113 | connecting to the same local port, |
| 1114 | and |
| 1115 | .Nm |
| 1116 | will encrypt and forward the connection. |
| 1117 | .Pp |
| 1118 | The following example tunnels an IRC session from client machine |
| 1119 | .Dq 127.0.0.1 |
| 1120 | (localhost) |
| 1121 | to remote server |
| 1122 | .Dq server.example.com : |
| 1123 | .Bd -literal -offset 4n |
| 1124 | $ ssh -f -L 1234:localhost:6667 server.example.com sleep 10 |
| 1125 | $ irc -c '#users' -p 1234 pinky 127.0.0.1 |
| 1126 | .Ed |
| 1127 | .Pp |
| 1128 | This tunnels a connection to IRC server |
| 1129 | .Dq server.example.com , |
| 1130 | joining channel |
| 1131 | .Dq #users , |
| 1132 | nickname |
| 1133 | .Dq pinky , |
| 1134 | using port 1234. |
| 1135 | It doesn't matter which port is used, |
| 1136 | as long as it's greater than 1023 |
| 1137 | (remember, only root can open sockets on privileged ports) |
| 1138 | and doesn't conflict with any ports already in use. |
| 1139 | The connection is forwarded to port 6667 on the remote server, |
| 1140 | since that's the standard port for IRC services. |
| 1141 | .Pp |
| 1142 | The |
| 1143 | .Fl f |
| 1144 | option backgrounds |
| 1145 | .Nm |
| 1146 | and the remote command |
| 1147 | .Dq sleep 10 |
| 1148 | is specified to allow an amount of time |
| 1149 | (10 seconds, in the example) |
| 1150 | to start the service which is to be tunnelled. |
| 1151 | If no connections are made within the time specified, |
| 1152 | .Nm |
| 1153 | will exit. |
Damien Miller | f317718 | 2006-01-14 10:09:13 +1100 | [diff] [blame] | 1154 | .Sh X11 FORWARDING |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 1155 | If the |
| 1156 | .Cm ForwardX11 |
| 1157 | variable is set to |
| 1158 | .Dq yes |
| 1159 | (or see the description of the |
Damien Miller | d7f308f | 2005-12-24 14:55:16 +1100 | [diff] [blame] | 1160 | .Fl X , |
| 1161 | .Fl x , |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 1162 | and |
Damien Miller | d7f308f | 2005-12-24 14:55:16 +1100 | [diff] [blame] | 1163 | .Fl Y |
Damien Miller | 9a765b2 | 2005-12-24 14:53:44 +1100 | [diff] [blame] | 1164 | options above) |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 1165 | and the user is using X11 (the |
| 1166 | .Ev DISPLAY |
| 1167 | environment variable is set), the connection to the X11 display is |
| 1168 | automatically forwarded to the remote side in such a way that any X11 |
| 1169 | programs started from the shell (or command) will go through the |
| 1170 | encrypted channel, and the connection to the real X server will be made |
| 1171 | from the local machine. |
| 1172 | The user should not manually set |
| 1173 | .Ev DISPLAY . |
| 1174 | Forwarding of X11 connections can be |
| 1175 | configured on the command line or in configuration files. |
| 1176 | .Pp |
| 1177 | The |
| 1178 | .Ev DISPLAY |
| 1179 | value set by |
| 1180 | .Nm |
| 1181 | will point to the server machine, but with a display number greater than zero. |
| 1182 | This is normal, and happens because |
| 1183 | .Nm |
| 1184 | creates a |
| 1185 | .Dq proxy |
| 1186 | X server on the server machine for forwarding the |
| 1187 | connections over the encrypted channel. |
| 1188 | .Pp |
| 1189 | .Nm |
| 1190 | will also automatically set up Xauthority data on the server machine. |
| 1191 | For this purpose, it will generate a random authorization cookie, |
| 1192 | store it in Xauthority on the server, and verify that any forwarded |
| 1193 | connections carry this cookie and replace it by the real cookie when |
| 1194 | the connection is opened. |
| 1195 | The real authentication cookie is never |
| 1196 | sent to the server machine (and no cookies are sent in the plain). |
| 1197 | .Pp |
| 1198 | If the |
| 1199 | .Cm ForwardAgent |
| 1200 | variable is set to |
| 1201 | .Dq yes |
| 1202 | (or see the description of the |
| 1203 | .Fl A |
| 1204 | and |
| 1205 | .Fl a |
Damien Miller | 9a765b2 | 2005-12-24 14:53:44 +1100 | [diff] [blame] | 1206 | options above) and |
Darren Tucker | d3877b9 | 2005-12-20 16:09:36 +1100 | [diff] [blame] | 1207 | the user is using an authentication agent, the connection to the agent |
| 1208 | is automatically forwarded to the remote side. |
Damien Miller | bbc5909 | 2006-01-31 21:46:51 +1100 | [diff] [blame] | 1209 | .Sh VERIFYING HOST KEYS |
| 1210 | When connecting to a server for the first time, |
| 1211 | a fingerprint of the server's public key is presented to the user |
| 1212 | (unless the option |
| 1213 | .Cm StrictHostKeyChecking |
| 1214 | has been disabled). |
| 1215 | Fingerprints can be determined using |
| 1216 | .Xr ssh-keygen 1 : |
| 1217 | .Pp |
| 1218 | .Dl $ ssh-keygen -l -f /etc/ssh/ssh_host_rsa_key |
| 1219 | .Pp |
Darren Tucker | f6bffb1 | 2008-06-14 09:04:26 +1000 | [diff] [blame] | 1220 | If the fingerprint is already known, it can be matched |
| 1221 | and the key can be accepted or rejected. |
djm@openbsd.org | f948737 | 2015-05-22 05:28:45 +0000 | [diff] [blame] | 1222 | If only legacy (MD5) fingerprints for the server are available, the |
| 1223 | .Xr ssh-keygen 1 |
| 1224 | .Fl E |
| 1225 | option may be used to downgrade the fingerprint algorithm to match. |
| 1226 | .Pp |
Darren Tucker | f6bffb1 | 2008-06-14 09:04:26 +1000 | [diff] [blame] | 1227 | Because of the difficulty of comparing host keys |
djm@openbsd.org | 56d1c83 | 2014-12-21 22:27:55 +0000 | [diff] [blame] | 1228 | just by looking at fingerprint strings, |
Darren Tucker | f6bffb1 | 2008-06-14 09:04:26 +1000 | [diff] [blame] | 1229 | there is also support to compare host keys visually, |
| 1230 | using |
| 1231 | .Em random art . |
| 1232 | By setting the |
Damien Miller | 1028824 | 2008-06-30 00:04:03 +1000 | [diff] [blame] | 1233 | .Cm VisualHostKey |
Darren Tucker | f6bffb1 | 2008-06-14 09:04:26 +1000 | [diff] [blame] | 1234 | option to |
Damien Miller | 1028824 | 2008-06-30 00:04:03 +1000 | [diff] [blame] | 1235 | .Dq yes , |
Darren Tucker | f6bffb1 | 2008-06-14 09:04:26 +1000 | [diff] [blame] | 1236 | a small ASCII graphic gets displayed on every login to a server, no matter |
| 1237 | if the session itself is interactive or not. |
| 1238 | By learning the pattern a known server produces, a user can easily |
| 1239 | find out that the host key has changed when a completely different pattern |
| 1240 | is displayed. |
| 1241 | Because these patterns are not unambiguous however, a pattern that looks |
| 1242 | similar to the pattern remembered only gives a good probability that the |
| 1243 | host key is the same, not guaranteed proof. |
| 1244 | .Pp |
| 1245 | To get a listing of the fingerprints along with their random art for |
| 1246 | all known hosts, the following command line can be used: |
| 1247 | .Pp |
| 1248 | .Dl $ ssh-keygen -lv -f ~/.ssh/known_hosts |
| 1249 | .Pp |
Damien Miller | bbc5909 | 2006-01-31 21:46:51 +1100 | [diff] [blame] | 1250 | If the fingerprint is unknown, |
| 1251 | an alternative method of verification is available: |
| 1252 | SSH fingerprints verified by DNS. |
| 1253 | An additional resource record (RR), |
| 1254 | SSHFP, |
| 1255 | is added to a zonefile |
| 1256 | and the connecting client is able to match the fingerprint |
| 1257 | with that of the key presented. |
| 1258 | .Pp |
| 1259 | In this example, we are connecting a client to a server, |
| 1260 | .Dq host.example.com . |
| 1261 | The SSHFP resource records should first be added to the zonefile for |
| 1262 | host.example.com: |
| 1263 | .Bd -literal -offset indent |
Damien Miller | a1b3d63 | 2006-03-26 00:07:02 +1100 | [diff] [blame] | 1264 | $ ssh-keygen -r host.example.com. |
Damien Miller | bbc5909 | 2006-01-31 21:46:51 +1100 | [diff] [blame] | 1265 | .Ed |
| 1266 | .Pp |
| 1267 | The output lines will have to be added to the zonefile. |
| 1268 | To check that the zone is answering fingerprint queries: |
| 1269 | .Pp |
| 1270 | .Dl $ dig -t SSHFP host.example.com |
| 1271 | .Pp |
| 1272 | Finally the client connects: |
| 1273 | .Bd -literal -offset indent |
| 1274 | $ ssh -o "VerifyHostKeyDNS ask" host.example.com |
| 1275 | [...] |
| 1276 | Matching host key fingerprint found in DNS. |
| 1277 | Are you sure you want to continue connecting (yes/no)? |
| 1278 | .Ed |
| 1279 | .Pp |
| 1280 | See the |
| 1281 | .Cm VerifyHostKeyDNS |
| 1282 | option in |
| 1283 | .Xr ssh_config 5 |
| 1284 | for more information. |
Darren Tucker | 248dd13 | 2006-01-20 11:30:58 +1100 | [diff] [blame] | 1285 | .Sh SSH-BASED VIRTUAL PRIVATE NETWORKS |
| 1286 | .Nm |
| 1287 | contains support for Virtual Private Network (VPN) tunnelling |
| 1288 | using the |
| 1289 | .Xr tun 4 |
| 1290 | network pseudo-device, |
| 1291 | allowing two networks to be joined securely. |
| 1292 | The |
| 1293 | .Xr sshd_config 5 |
| 1294 | configuration option |
| 1295 | .Cm PermitTunnel |
| 1296 | controls whether the server supports this, |
| 1297 | and at what level (layer 2 or 3 traffic). |
| 1298 | .Pp |
| 1299 | The following example would connect client network 10.0.50.0/24 |
Damien Miller | 3975ee2 | 2006-11-05 05:31:33 +1100 | [diff] [blame] | 1300 | with remote network 10.0.99.0/24 using a point-to-point connection |
| 1301 | from 10.1.1.1 to 10.1.1.2, |
| 1302 | provided that the SSH server running on the gateway to the remote network, |
| 1303 | at 192.168.1.15, allows it. |
| 1304 | .Pp |
| 1305 | On the client: |
Darren Tucker | 248dd13 | 2006-01-20 11:30:58 +1100 | [diff] [blame] | 1306 | .Bd -literal -offset indent |
| 1307 | # ssh -f -w 0:1 192.168.1.15 true |
Damien Miller | 3975ee2 | 2006-11-05 05:31:33 +1100 | [diff] [blame] | 1308 | # ifconfig tun0 10.1.1.1 10.1.1.2 netmask 255.255.255.252 |
| 1309 | # route add 10.0.99.0/24 10.1.1.2 |
| 1310 | .Ed |
| 1311 | .Pp |
| 1312 | On the server: |
| 1313 | .Bd -literal -offset indent |
| 1314 | # ifconfig tun1 10.1.1.2 10.1.1.1 netmask 255.255.255.252 |
| 1315 | # route add 10.0.50.0/24 10.1.1.1 |
Darren Tucker | 248dd13 | 2006-01-20 11:30:58 +1100 | [diff] [blame] | 1316 | .Ed |
| 1317 | .Pp |
| 1318 | Client access may be more finely tuned via the |
| 1319 | .Pa /root/.ssh/authorized_keys |
| 1320 | file (see below) and the |
| 1321 | .Cm PermitRootLogin |
| 1322 | server option. |
Damien Miller | e93eaaa | 2006-03-15 11:05:59 +1100 | [diff] [blame] | 1323 | The following entry would permit connections on |
Darren Tucker | 248dd13 | 2006-01-20 11:30:58 +1100 | [diff] [blame] | 1324 | .Xr tun 4 |
Damien Miller | e93eaaa | 2006-03-15 11:05:59 +1100 | [diff] [blame] | 1325 | device 1 from user |
Darren Tucker | 248dd13 | 2006-01-20 11:30:58 +1100 | [diff] [blame] | 1326 | .Dq jane |
Damien Miller | e93eaaa | 2006-03-15 11:05:59 +1100 | [diff] [blame] | 1327 | and on tun device 2 from user |
Darren Tucker | 248dd13 | 2006-01-20 11:30:58 +1100 | [diff] [blame] | 1328 | .Dq john , |
| 1329 | if |
| 1330 | .Cm PermitRootLogin |
| 1331 | is set to |
| 1332 | .Dq forced-commands-only : |
| 1333 | .Bd -literal -offset 2n |
| 1334 | tunnel="1",command="sh /etc/netstart tun1" ssh-rsa ... jane |
Damien Miller | 9f67a21 | 2006-03-15 11:05:35 +1100 | [diff] [blame] | 1335 | tunnel="2",command="sh /etc/netstart tun2" ssh-rsa ... john |
Darren Tucker | 248dd13 | 2006-01-20 11:30:58 +1100 | [diff] [blame] | 1336 | .Ed |
| 1337 | .Pp |
Darren Tucker | ffe88e1 | 2006-10-18 07:53:06 +1000 | [diff] [blame] | 1338 | Since an SSH-based setup entails a fair amount of overhead, |
Darren Tucker | 248dd13 | 2006-01-20 11:30:58 +1100 | [diff] [blame] | 1339 | it may be more suited to temporary setups, |
| 1340 | such as for wireless VPNs. |
| 1341 | More permanent VPNs are better provided by tools such as |
| 1342 | .Xr ipsecctl 8 |
| 1343 | and |
| 1344 | .Xr isakmpd 8 . |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1345 | .Sh ENVIRONMENT |
| 1346 | .Nm |
| 1347 | will normally set the following environment variables: |
Damien Miller | 6aa2290 | 2006-01-06 14:48:34 +1100 | [diff] [blame] | 1348 | .Bl -tag -width "SSH_ORIGINAL_COMMAND" |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1349 | .It Ev DISPLAY |
| 1350 | The |
| 1351 | .Ev DISPLAY |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1352 | variable indicates the location of the X11 server. |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 1353 | It is automatically set by |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1354 | .Nm |
| 1355 | to point to a value of the form |
Damien Miller | 14af93e | 2006-01-02 23:38:21 +1100 | [diff] [blame] | 1356 | .Dq hostname:n , |
| 1357 | where |
| 1358 | .Dq hostname |
| 1359 | indicates the host where the shell runs, and |
| 1360 | .Sq n |
| 1361 | is an integer \*(Ge 1. |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1362 | .Nm |
| 1363 | uses this special value to forward X11 connections over the secure |
| 1364 | channel. |
Ben Lindstrom | c65e6a0 | 2001-04-23 13:02:16 +0000 | [diff] [blame] | 1365 | The user should normally not set |
| 1366 | .Ev DISPLAY |
| 1367 | explicitly, as that |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1368 | will render the X11 connection insecure (and will require the user to |
| 1369 | manually copy any required authorization cookies). |
| 1370 | .It Ev HOME |
| 1371 | Set to the path of the user's home directory. |
| 1372 | .It Ev LOGNAME |
| 1373 | Synonym for |
| 1374 | .Ev USER ; |
| 1375 | set for compatibility with systems that use this variable. |
| 1376 | .It Ev MAIL |
Ben Lindstrom | e59433d | 2001-09-12 16:41:37 +0000 | [diff] [blame] | 1377 | Set to the path of the user's mailbox. |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1378 | .It Ev PATH |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1379 | Set to the default |
| 1380 | .Ev PATH , |
| 1381 | as specified when compiling |
Damien Miller | 1164c29 | 2006-01-02 23:38:37 +1100 | [diff] [blame] | 1382 | .Nm . |
Ben Lindstrom | 5bf5d67 | 2001-07-04 04:31:38 +0000 | [diff] [blame] | 1383 | .It Ev SSH_ASKPASS |
| 1384 | If |
| 1385 | .Nm |
| 1386 | needs a passphrase, it will read the passphrase from the current |
| 1387 | terminal if it was run from a terminal. |
| 1388 | If |
| 1389 | .Nm |
| 1390 | does not have a terminal associated with it but |
| 1391 | .Ev DISPLAY |
| 1392 | and |
| 1393 | .Ev SSH_ASKPASS |
| 1394 | are set, it will execute the program specified by |
| 1395 | .Ev SSH_ASKPASS |
| 1396 | and open an X11 window to read the passphrase. |
| 1397 | This is particularly useful when calling |
| 1398 | .Nm |
| 1399 | from a |
Darren Tucker | 4e4fe00 | 2004-11-05 20:01:03 +1100 | [diff] [blame] | 1400 | .Pa .xsession |
Ben Lindstrom | 5bf5d67 | 2001-07-04 04:31:38 +0000 | [diff] [blame] | 1401 | or related script. |
| 1402 | (Note that on some machines it |
| 1403 | may be necessary to redirect the input from |
| 1404 | .Pa /dev/null |
| 1405 | to make this work.) |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1406 | .It Ev SSH_AUTH_SOCK |
Damien Miller | 14af93e | 2006-01-02 23:38:21 +1100 | [diff] [blame] | 1407 | Identifies the path of a |
| 1408 | .Ux Ns -domain |
| 1409 | socket used to communicate with the agent. |
Damien Miller | f37e246 | 2002-09-19 11:47:55 +1000 | [diff] [blame] | 1410 | .It Ev SSH_CONNECTION |
| 1411 | Identifies the client and server ends of the connection. |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1412 | The variable contains |
Damien Miller | 14af93e | 2006-01-02 23:38:21 +1100 | [diff] [blame] | 1413 | four space-separated values: client IP address, client port number, |
| 1414 | server IP address, and server port number. |
Ben Lindstrom | 4dccfa5 | 2000-12-28 16:40:05 +0000 | [diff] [blame] | 1415 | .It Ev SSH_ORIGINAL_COMMAND |
Damien Miller | 14af93e | 2006-01-02 23:38:21 +1100 | [diff] [blame] | 1416 | This variable contains the original command line if a forced command |
Ben Lindstrom | 4dccfa5 | 2000-12-28 16:40:05 +0000 | [diff] [blame] | 1417 | is executed. |
| 1418 | It can be used to extract the original arguments. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1419 | .It Ev SSH_TTY |
| 1420 | 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] | 1421 | with the current shell or command. |
| 1422 | If the current session has no tty, |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1423 | this variable is not set. |
| 1424 | .It Ev TZ |
Damien Miller | 6dbdb6a | 2005-12-13 19:25:43 +1100 | [diff] [blame] | 1425 | This variable is set to indicate the present time zone if it |
Damien Miller | 208f1ed | 2006-03-15 11:56:03 +1100 | [diff] [blame] | 1426 | 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] | 1427 | on to new connections). |
| 1428 | .It Ev USER |
| 1429 | Set to the name of the user logging in. |
| 1430 | .El |
| 1431 | .Pp |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 1432 | Additionally, |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1433 | .Nm |
Damien Miller | 22c7726 | 2000-04-13 12:26:34 +1000 | [diff] [blame] | 1434 | reads |
Damien Miller | 167ea5d | 2005-05-26 12:04:02 +1000 | [diff] [blame] | 1435 | .Pa ~/.ssh/environment , |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1436 | and adds lines of the format |
| 1437 | .Dq VARNAME=value |
Damien Miller | 14af93e | 2006-01-02 23:38:21 +1100 | [diff] [blame] | 1438 | to the environment if the file exists and users are allowed to |
Ben Lindstrom | dc7adf2 | 2002-08-20 18:38:02 +0000 | [diff] [blame] | 1439 | change their environment. |
Darren Tucker | 6177695 | 2003-10-02 16:19:47 +1000 | [diff] [blame] | 1440 | For more information, see the |
Ben Lindstrom | dc7adf2 | 2002-08-20 18:38:02 +0000 | [diff] [blame] | 1441 | .Cm PermitUserEnvironment |
Ben Lindstrom | bd9bf38 | 2002-08-20 18:54:20 +0000 | [diff] [blame] | 1442 | option in |
Ben Lindstrom | dc7adf2 | 2002-08-20 18:38:02 +0000 | [diff] [blame] | 1443 | .Xr sshd_config 5 . |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1444 | .Sh FILES |
Damien Miller | 7655f5c | 2006-01-06 14:48:18 +1100 | [diff] [blame] | 1445 | .Bl -tag -width Ds -compact |
Damien Miller | afdae61 | 2010-08-31 22:31:14 +1000 | [diff] [blame] | 1446 | .It Pa ~/.rhosts |
Damien Miller | 1bcdb50 | 2006-01-06 14:49:38 +1100 | [diff] [blame] | 1447 | This file is used for host-based authentication (see above). |
Ben Lindstrom | ebd888d | 2001-03-05 05:49:29 +0000 | [diff] [blame] | 1448 | On some machines this file may need to be |
Damien Miller | 1bcdb50 | 2006-01-06 14:49:38 +1100 | [diff] [blame] | 1449 | world-readable if the user's home directory is on an NFS partition, |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1450 | because |
| 1451 | .Xr sshd 8 |
Damien Miller | 7684ee1 | 2000-03-17 23:40:15 +1100 | [diff] [blame] | 1452 | reads it as root. |
| 1453 | Additionally, this file must be owned by the user, |
| 1454 | and must not have write permissions for anyone else. |
| 1455 | The recommended |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1456 | permission for most machines is read/write for the user, and not |
| 1457 | accessible by others. |
| 1458 | .Pp |
Damien Miller | afdae61 | 2010-08-31 22:31:14 +1000 | [diff] [blame] | 1459 | .It Pa ~/.shosts |
Damien Miller | 1bcdb50 | 2006-01-06 14:49:38 +1100 | [diff] [blame] | 1460 | This file is used in exactly the same way as |
| 1461 | .Pa .rhosts , |
| 1462 | but allows host-based authentication without permitting login with |
| 1463 | rlogin/rsh. |
Damien Miller | 7655f5c | 2006-01-06 14:48:18 +1100 | [diff] [blame] | 1464 | .Pp |
Damien Miller | afdae61 | 2010-08-31 22:31:14 +1000 | [diff] [blame] | 1465 | .It Pa ~/.ssh/ |
Damien Miller | 520e615 | 2008-02-10 22:46:22 +1100 | [diff] [blame] | 1466 | This directory is the default location for all user-specific configuration |
| 1467 | and authentication information. |
| 1468 | There is no general requirement to keep the entire contents of this directory |
| 1469 | secret, but the recommended permissions are read/write/execute for the user, |
| 1470 | and not accessible by others. |
| 1471 | .Pp |
Damien Miller | afdae61 | 2010-08-31 22:31:14 +1000 | [diff] [blame] | 1472 | .It Pa ~/.ssh/authorized_keys |
sobrado@openbsd.org | f70b22b | 2014-08-30 15:33:50 +0000 | [diff] [blame] | 1473 | Lists the public keys (DSA, ECDSA, Ed25519, RSA) |
Damien Miller | 8ba0ead | 2013-12-18 17:46:27 +1100 | [diff] [blame] | 1474 | that can be used for logging in as this user. |
Damien Miller | fb8ea74 | 2006-01-06 14:48:52 +1100 | [diff] [blame] | 1475 | The format of this file is described in the |
| 1476 | .Xr sshd 8 |
| 1477 | manual page. |
Damien Miller | fb8ea74 | 2006-01-06 14:48:52 +1100 | [diff] [blame] | 1478 | This file is not highly sensitive, but the recommended |
| 1479 | permissions are read/write for the user, and not accessible by others. |
| 1480 | .Pp |
Damien Miller | afdae61 | 2010-08-31 22:31:14 +1000 | [diff] [blame] | 1481 | .It Pa ~/.ssh/config |
Damien Miller | fb8ea74 | 2006-01-06 14:48:52 +1100 | [diff] [blame] | 1482 | This is the per-user configuration file. |
| 1483 | The file format and configuration options are described in |
| 1484 | .Xr ssh_config 5 . |
| 1485 | Because of the potential for abuse, this file must have strict permissions: |
Damien Miller | d93340c | 2013-07-18 16:14:34 +1000 | [diff] [blame] | 1486 | read/write for the user, and not writable by others. |
Damien Miller | fb8ea74 | 2006-01-06 14:48:52 +1100 | [diff] [blame] | 1487 | .Pp |
Damien Miller | afdae61 | 2010-08-31 22:31:14 +1000 | [diff] [blame] | 1488 | .It Pa ~/.ssh/environment |
Damien Miller | 4c102ee | 2006-01-06 14:49:17 +1100 | [diff] [blame] | 1489 | Contains additional definitions for environment variables; see |
| 1490 | .Sx ENVIRONMENT , |
Damien Miller | fb8ea74 | 2006-01-06 14:48:52 +1100 | [diff] [blame] | 1491 | above. |
| 1492 | .Pp |
Damien Miller | afdae61 | 2010-08-31 22:31:14 +1000 | [diff] [blame] | 1493 | .It Pa ~/.ssh/identity |
| 1494 | .It Pa ~/.ssh/id_dsa |
Damien Miller | eb8b60e | 2010-08-31 22:41:14 +1000 | [diff] [blame] | 1495 | .It Pa ~/.ssh/id_ecdsa |
Damien Miller | 8ba0ead | 2013-12-18 17:46:27 +1100 | [diff] [blame] | 1496 | .It Pa ~/.ssh/id_ed25519 |
Damien Miller | afdae61 | 2010-08-31 22:31:14 +1000 | [diff] [blame] | 1497 | .It Pa ~/.ssh/id_rsa |
Damien Miller | fb8ea74 | 2006-01-06 14:48:52 +1100 | [diff] [blame] | 1498 | Contains the private key for authentication. |
| 1499 | These files |
| 1500 | contain sensitive data and should be readable by the user but not |
| 1501 | accessible by others (read/write/execute). |
| 1502 | .Nm |
| 1503 | will simply ignore a private key file if it is accessible by others. |
| 1504 | It is possible to specify a passphrase when |
| 1505 | generating the key which will be used to encrypt the |
| 1506 | sensitive part of this file using 3DES. |
| 1507 | .Pp |
Damien Miller | afdae61 | 2010-08-31 22:31:14 +1000 | [diff] [blame] | 1508 | .It Pa ~/.ssh/identity.pub |
| 1509 | .It Pa ~/.ssh/id_dsa.pub |
Damien Miller | eb8b60e | 2010-08-31 22:41:14 +1000 | [diff] [blame] | 1510 | .It Pa ~/.ssh/id_ecdsa.pub |
Damien Miller | 8ba0ead | 2013-12-18 17:46:27 +1100 | [diff] [blame] | 1511 | .It Pa ~/.ssh/id_ed25519.pub |
Damien Miller | afdae61 | 2010-08-31 22:31:14 +1000 | [diff] [blame] | 1512 | .It Pa ~/.ssh/id_rsa.pub |
Damien Miller | fb8ea74 | 2006-01-06 14:48:52 +1100 | [diff] [blame] | 1513 | Contains the public key for authentication. |
| 1514 | These files are not |
| 1515 | sensitive and can (but need not) be readable by anyone. |
Damien Miller | fb8ea74 | 2006-01-06 14:48:52 +1100 | [diff] [blame] | 1516 | .Pp |
Damien Miller | afdae61 | 2010-08-31 22:31:14 +1000 | [diff] [blame] | 1517 | .It Pa ~/.ssh/known_hosts |
Damien Miller | e87eb4c | 2006-01-14 10:08:36 +1100 | [diff] [blame] | 1518 | Contains a list of host keys for all hosts the user has logged into |
| 1519 | that are not already in the systemwide list of known host keys. |
Damien Miller | fb8ea74 | 2006-01-06 14:48:52 +1100 | [diff] [blame] | 1520 | See |
Damien Miller | e87eb4c | 2006-01-14 10:08:36 +1100 | [diff] [blame] | 1521 | .Xr sshd 8 |
| 1522 | for further details of the format of this file. |
Damien Miller | fb8ea74 | 2006-01-06 14:48:52 +1100 | [diff] [blame] | 1523 | .Pp |
Damien Miller | afdae61 | 2010-08-31 22:31:14 +1000 | [diff] [blame] | 1524 | .It Pa ~/.ssh/rc |
Damien Miller | fb8ea74 | 2006-01-06 14:48:52 +1100 | [diff] [blame] | 1525 | Commands in this file are executed by |
| 1526 | .Nm |
Damien Miller | 7e76e1f | 2006-01-14 10:08:57 +1100 | [diff] [blame] | 1527 | when the user logs in, just before the user's shell (or command) is |
Damien Miller | fb8ea74 | 2006-01-06 14:48:52 +1100 | [diff] [blame] | 1528 | started. |
| 1529 | See the |
| 1530 | .Xr sshd 8 |
| 1531 | manual page for more information. |
| 1532 | .Pp |
Damien Miller | afdae61 | 2010-08-31 22:31:14 +1000 | [diff] [blame] | 1533 | .It Pa /etc/hosts.equiv |
Damien Miller | 1bcdb50 | 2006-01-06 14:49:38 +1100 | [diff] [blame] | 1534 | This file is for host-based authentication (see above). |
| 1535 | It should only be writable by root. |
Damien Miller | 7655f5c | 2006-01-06 14:48:18 +1100 | [diff] [blame] | 1536 | .Pp |
Damien Miller | afdae61 | 2010-08-31 22:31:14 +1000 | [diff] [blame] | 1537 | .It Pa /etc/shosts.equiv |
Damien Miller | 1bcdb50 | 2006-01-06 14:49:38 +1100 | [diff] [blame] | 1538 | This file is used in exactly the same way as |
| 1539 | .Pa hosts.equiv , |
| 1540 | but allows host-based authentication without permitting login with |
| 1541 | rlogin/rsh. |
Damien Miller | 7655f5c | 2006-01-06 14:48:18 +1100 | [diff] [blame] | 1542 | .Pp |
Damien Miller | fb8ea74 | 2006-01-06 14:48:52 +1100 | [diff] [blame] | 1543 | .It Pa /etc/ssh/ssh_config |
| 1544 | Systemwide configuration file. |
| 1545 | The file format and configuration options are described in |
| 1546 | .Xr ssh_config 5 . |
| 1547 | .Pp |
Damien Miller | afdae61 | 2010-08-31 22:31:14 +1000 | [diff] [blame] | 1548 | .It Pa /etc/ssh/ssh_host_key |
| 1549 | .It Pa /etc/ssh/ssh_host_dsa_key |
Damien Miller | eb8b60e | 2010-08-31 22:41:14 +1000 | [diff] [blame] | 1550 | .It Pa /etc/ssh/ssh_host_ecdsa_key |
Damien Miller | 8ba0ead | 2013-12-18 17:46:27 +1100 | [diff] [blame] | 1551 | .It Pa /etc/ssh/ssh_host_ed25519_key |
Damien Miller | afdae61 | 2010-08-31 22:31:14 +1000 | [diff] [blame] | 1552 | .It Pa /etc/ssh/ssh_host_rsa_key |
Damien Miller | b9902cf | 2012-06-20 21:52:58 +1000 | [diff] [blame] | 1553 | These files contain the private parts of the host keys |
Damien Miller | 7e76e1f | 2006-01-14 10:08:57 +1100 | [diff] [blame] | 1554 | and are used for host-based authentication. |
Damien Miller | fb8ea74 | 2006-01-06 14:48:52 +1100 | [diff] [blame] | 1555 | .Pp |
Damien Miller | afdae61 | 2010-08-31 22:31:14 +1000 | [diff] [blame] | 1556 | .It Pa /etc/ssh/ssh_known_hosts |
Damien Miller | fb8ea74 | 2006-01-06 14:48:52 +1100 | [diff] [blame] | 1557 | Systemwide list of known host keys. |
| 1558 | This file should be prepared by the |
| 1559 | system administrator to contain the public host keys of all machines in the |
| 1560 | organization. |
Damien Miller | e87eb4c | 2006-01-14 10:08:36 +1100 | [diff] [blame] | 1561 | It should be world-readable. |
| 1562 | See |
Damien Miller | fb8ea74 | 2006-01-06 14:48:52 +1100 | [diff] [blame] | 1563 | .Xr sshd 8 |
Damien Miller | e87eb4c | 2006-01-14 10:08:36 +1100 | [diff] [blame] | 1564 | for further details of the format of this file. |
Damien Miller | fb8ea74 | 2006-01-06 14:48:52 +1100 | [diff] [blame] | 1565 | .Pp |
Damien Miller | afdae61 | 2010-08-31 22:31:14 +1000 | [diff] [blame] | 1566 | .It Pa /etc/ssh/sshrc |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1567 | Commands in this file are executed by |
| 1568 | .Nm |
Damien Miller | 7e76e1f | 2006-01-14 10:08:57 +1100 | [diff] [blame] | 1569 | when the user logs in, just before the user's shell (or command) is started. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1570 | See the |
| 1571 | .Xr sshd 8 |
| 1572 | manual page for more information. |
Damien Miller | 7b28dc5 | 2000-09-05 13:34:53 +1100 | [diff] [blame] | 1573 | .El |
Damien Miller | daa7b22 | 2010-09-10 11:19:33 +1000 | [diff] [blame] | 1574 | .Sh EXIT STATUS |
| 1575 | .Nm |
| 1576 | exits with the exit status of the remote command or with 255 |
| 1577 | if an error occurred. |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1578 | .Sh SEE ALSO |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1579 | .Xr scp 1 , |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 1580 | .Xr sftp 1 , |
Damien Miller | 32aa144 | 1999-10-29 09:15:49 +1000 | [diff] [blame] | 1581 | .Xr ssh-add 1 , |
| 1582 | .Xr ssh-agent 1 , |
| 1583 | .Xr ssh-keygen 1 , |
Damien Miller | 128a0f1 | 2006-01-06 14:50:11 +1100 | [diff] [blame] | 1584 | .Xr ssh-keyscan 1 , |
Darren Tucker | 248dd13 | 2006-01-20 11:30:58 +1100 | [diff] [blame] | 1585 | .Xr tun 4 , |
Ben Lindstrom | bf69e3b | 2002-06-23 00:31:24 +0000 | [diff] [blame] | 1586 | .Xr ssh_config 5 , |
Ben Lindstrom | c001cd3 | 2002-06-23 00:32:11 +0000 | [diff] [blame] | 1587 | .Xr ssh-keysign 8 , |
Ben Lindstrom | 5ab6ae1 | 2001-02-10 22:08:03 +0000 | [diff] [blame] | 1588 | .Xr sshd 8 |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1589 | .Sh STANDARDS |
Ben Lindstrom | 160ec62 | 2001-04-22 17:17:46 +0000 | [diff] [blame] | 1590 | .Rs |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1591 | .%A S. Lehtinen |
| 1592 | .%A C. Lonvick |
| 1593 | .%D January 2006 |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1594 | .%R RFC 4250 |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1595 | .%T The Secure Shell (SSH) Protocol Assigned Numbers |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1596 | .Re |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1597 | .Pp |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1598 | .Rs |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1599 | .%A T. Ylonen |
| 1600 | .%A C. Lonvick |
| 1601 | .%D January 2006 |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1602 | .%R RFC 4251 |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1603 | .%T The Secure Shell (SSH) Protocol Architecture |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1604 | .Re |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1605 | .Pp |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1606 | .Rs |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1607 | .%A T. Ylonen |
| 1608 | .%A C. Lonvick |
| 1609 | .%D January 2006 |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1610 | .%R RFC 4252 |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1611 | .%T The Secure Shell (SSH) Authentication Protocol |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1612 | .Re |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1613 | .Pp |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1614 | .Rs |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1615 | .%A T. Ylonen |
| 1616 | .%A C. Lonvick |
| 1617 | .%D January 2006 |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1618 | .%R RFC 4253 |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1619 | .%T The Secure Shell (SSH) Transport Layer Protocol |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1620 | .Re |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1621 | .Pp |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1622 | .Rs |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1623 | .%A T. Ylonen |
| 1624 | .%A C. Lonvick |
| 1625 | .%D January 2006 |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1626 | .%R RFC 4254 |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1627 | .%T The Secure Shell (SSH) Connection Protocol |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1628 | .Re |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1629 | .Pp |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1630 | .Rs |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1631 | .%A J. Schlyter |
| 1632 | .%A W. Griffin |
| 1633 | .%D January 2006 |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1634 | .%R RFC 4255 |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1635 | .%T Using DNS to Securely Publish Secure Shell (SSH) Key Fingerprints |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1636 | .Re |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1637 | .Pp |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1638 | .Rs |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1639 | .%A F. Cusack |
| 1640 | .%A M. Forssen |
| 1641 | .%D January 2006 |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1642 | .%R RFC 4256 |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1643 | .%T Generic Message Exchange Authentication for the Secure Shell Protocol (SSH) |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1644 | .Re |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1645 | .Pp |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1646 | .Rs |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1647 | .%A J. Galbraith |
| 1648 | .%A P. Remaker |
| 1649 | .%D January 2006 |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1650 | .%R RFC 4335 |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1651 | .%T The Secure Shell (SSH) Session Channel Break Extension |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1652 | .Re |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1653 | .Pp |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1654 | .Rs |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1655 | .%A M. Bellare |
| 1656 | .%A T. Kohno |
| 1657 | .%A C. Namprempre |
| 1658 | .%D January 2006 |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1659 | .%R RFC 4344 |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1660 | .%T The Secure Shell (SSH) Transport Layer Encryption Modes |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1661 | .Re |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1662 | .Pp |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1663 | .Rs |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1664 | .%A B. Harris |
| 1665 | .%D January 2006 |
Damien Miller | 39a93a3 | 2006-03-15 11:34:45 +1100 | [diff] [blame] | 1666 | .%R RFC 4345 |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1667 | .%T Improved Arcfour Modes for the Secure Shell (SSH) Transport Layer Protocol |
Ben Lindstrom | 160ec62 | 2001-04-22 17:17:46 +0000 | [diff] [blame] | 1668 | .Re |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1669 | .Pp |
Damien Miller | 3e96d74 | 2006-03-25 23:39:29 +1100 | [diff] [blame] | 1670 | .Rs |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1671 | .%A M. Friedl |
| 1672 | .%A N. Provos |
| 1673 | .%A W. Simpson |
| 1674 | .%D March 2006 |
Damien Miller | 3e96d74 | 2006-03-25 23:39:29 +1100 | [diff] [blame] | 1675 | .%R RFC 4419 |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1676 | .%T Diffie-Hellman Group Exchange for the Secure Shell (SSH) Transport Layer Protocol |
Damien Miller | 3e96d74 | 2006-03-25 23:39:29 +1100 | [diff] [blame] | 1677 | .Re |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1678 | .Pp |
Damien Miller | c0367fb | 2007-01-05 16:25:46 +1100 | [diff] [blame] | 1679 | .Rs |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1680 | .%A J. Galbraith |
| 1681 | .%A R. Thayer |
| 1682 | .%D November 2006 |
Damien Miller | c0367fb | 2007-01-05 16:25:46 +1100 | [diff] [blame] | 1683 | .%R RFC 4716 |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1684 | .%T The Secure Shell (SSH) Public Key File Format |
Damien Miller | c0367fb | 2007-01-05 16:25:46 +1100 | [diff] [blame] | 1685 | .Re |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1686 | .Pp |
Darren Tucker | f6bffb1 | 2008-06-14 09:04:26 +1000 | [diff] [blame] | 1687 | .Rs |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1688 | .%A D. Stebila |
| 1689 | .%A J. Green |
| 1690 | .%D December 2009 |
Damien Miller | 1ca9469 | 2010-09-24 22:01:22 +1000 | [diff] [blame] | 1691 | .%R RFC 5656 |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1692 | .%T Elliptic Curve Algorithm Integration in the Secure Shell Transport Layer |
Damien Miller | 1ca9469 | 2010-09-24 22:01:22 +1000 | [diff] [blame] | 1693 | .Re |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1694 | .Pp |
Damien Miller | 1ca9469 | 2010-09-24 22:01:22 +1000 | [diff] [blame] | 1695 | .Rs |
Darren Tucker | f6bffb1 | 2008-06-14 09:04:26 +1000 | [diff] [blame] | 1696 | .%A A. Perrig |
| 1697 | .%A D. Song |
| 1698 | .%D 1999 |
Darren Tucker | 628a3fd | 2012-10-05 10:50:15 +1000 | [diff] [blame] | 1699 | .%O International Workshop on Cryptographic Techniques and E-Commerce (CrypTEC '99) |
| 1700 | .%T Hash Visualization: a New Technique to improve Real-World Security |
Darren Tucker | f6bffb1 | 2008-06-14 09:04:26 +1000 | [diff] [blame] | 1701 | .Re |
Damien Miller | f1ce505 | 2003-06-11 22:04:39 +1000 | [diff] [blame] | 1702 | .Sh AUTHORS |
| 1703 | OpenSSH is a derivative of the original and free |
| 1704 | ssh 1.2.12 release by Tatu Ylonen. |
| 1705 | Aaron Campbell, Bob Beck, Markus Friedl, Niels Provos, |
| 1706 | Theo de Raadt and Dug Song |
| 1707 | removed many bugs, re-added newer features and |
| 1708 | created OpenSSH. |
| 1709 | Markus Friedl contributed the support for SSH |
| 1710 | protocol versions 1.5 and 2.0. |