Darren Tucker | 75fe626 | 2010-01-15 11:42:51 +1100 | [diff] [blame] | 1 | .\" $OpenBSD: sftp.1,v 1.82 2010/01/13 12:48:34 jmc Exp $ |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 2 | .\" |
Ben Lindstrom | 92a2e38 | 2001-03-05 06:59:27 +0000 | [diff] [blame] | 3 | .\" Copyright (c) 2001 Damien Miller. All rights reserved. |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 4 | .\" |
| 5 | .\" Redistribution and use in source and binary forms, with or without |
| 6 | .\" modification, are permitted provided that the following conditions |
| 7 | .\" are met: |
| 8 | .\" 1. Redistributions of source code must retain the above copyright |
| 9 | .\" notice, this list of conditions and the following disclaimer. |
| 10 | .\" 2. Redistributions in binary form must reproduce the above copyright |
| 11 | .\" notice, this list of conditions and the following disclaimer in the |
| 12 | .\" documentation and/or other materials provided with the distribution. |
| 13 | .\" |
| 14 | .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR |
| 15 | .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES |
| 16 | .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
| 17 | .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 18 | .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT |
| 19 | .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
| 20 | .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
| 21 | .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 | .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF |
| 23 | .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | .\" |
Darren Tucker | 2901e2d | 2010-01-13 22:44:06 +1100 | [diff] [blame] | 25 | .Dd $Mdocdate: January 13 2010 $ |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 26 | .Dt SFTP 1 |
| 27 | .Os |
| 28 | .Sh NAME |
| 29 | .Nm sftp |
Damien Miller | 5067792 | 2003-05-23 18:44:04 +1000 | [diff] [blame] | 30 | .Nd secure file transfer program |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 31 | .Sh SYNOPSIS |
Damien Miller | d6ead28 | 2003-05-14 19:30:38 +1000 | [diff] [blame] | 32 | .Nm sftp |
Damien Miller | 495dca3 | 2003-04-01 21:42:14 +1000 | [diff] [blame] | 33 | .Bk -words |
Darren Tucker | 1b0dd17 | 2009-10-07 08:37:48 +1100 | [diff] [blame] | 34 | .Op Fl 1246Cpqrv |
Damien Miller | 81b6e78 | 2002-02-08 22:06:03 +1100 | [diff] [blame] | 35 | .Op Fl B Ar buffer_size |
Darren Tucker | 1f20394 | 2003-10-15 15:50:42 +1000 | [diff] [blame] | 36 | .Op Fl b Ar batchfile |
Darren Tucker | 46bbbe3 | 2009-10-07 08:21:48 +1100 | [diff] [blame] | 37 | .Op Fl c Ar cipher |
Darren Tucker | 282b402 | 2009-10-07 08:23:06 +1100 | [diff] [blame] | 38 | .Op Fl D Ar sftp_server_path |
Damien Miller | 81b6e78 | 2002-02-08 22:06:03 +1100 | [diff] [blame] | 39 | .Op Fl F Ar ssh_config |
Darren Tucker | c07138e | 2009-10-07 08:23:44 +1100 | [diff] [blame] | 40 | .Op Fl i Ar identity_file |
Darren Tucker | 1f20394 | 2003-10-15 15:50:42 +1000 | [diff] [blame] | 41 | .Op Fl o Ar ssh_option |
Darren Tucker | 282b402 | 2009-10-07 08:23:06 +1100 | [diff] [blame] | 42 | .Op Fl P Ar port |
Damien Miller | 16a1333 | 2002-02-13 14:03:56 +1100 | [diff] [blame] | 43 | .Op Fl R Ar num_requests |
Ben Lindstrom | 6a33763 | 2001-09-18 05:47:32 +0000 | [diff] [blame] | 44 | .Op Fl S Ar program |
Darren Tucker | 1f20394 | 2003-10-15 15:50:42 +1000 | [diff] [blame] | 45 | .Op Fl s Ar subsystem | sftp_server |
Ben Lindstrom | 6a33763 | 2001-09-18 05:47:32 +0000 | [diff] [blame] | 46 | .Ar host |
Damien Miller | 495dca3 | 2003-04-01 21:42:14 +1000 | [diff] [blame] | 47 | .Ek |
Damien Miller | d6ead28 | 2003-05-14 19:30:38 +1000 | [diff] [blame] | 48 | .Nm sftp |
Damien Miller | 7ebfad7 | 2008-12-09 14:12:33 +1100 | [diff] [blame] | 49 | .Oo Ar user Ns @ Oc Ns |
| 50 | .Ar host Ns Op : Ns Ar |
Damien Miller | d6ead28 | 2003-05-14 19:30:38 +1000 | [diff] [blame] | 51 | .Nm sftp |
Damien Miller | 7ebfad7 | 2008-12-09 14:12:33 +1100 | [diff] [blame] | 52 | .Oo Ar user Ns @ Oc Ns |
Damien Miller | 495dca3 | 2003-04-01 21:42:14 +1000 | [diff] [blame] | 53 | .Ar host Ns Oo : Ns Ar dir Ns |
Damien Miller | 62fd18a | 2009-01-28 16:14:09 +1100 | [diff] [blame] | 54 | .Op Ar / Oc |
Damien Miller | d6ead28 | 2003-05-14 19:30:38 +1000 | [diff] [blame] | 55 | .Nm sftp |
Damien Miller | fb7508e | 2003-05-14 13:47:07 +1000 | [diff] [blame] | 56 | .Fl b Ar batchfile |
Damien Miller | c2b9827 | 2003-09-03 12:13:30 +1000 | [diff] [blame] | 57 | .Oo Ar user Ns @ Oc Ns Ar host |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 58 | .Sh DESCRIPTION |
| 59 | .Nm |
| 60 | is an interactive file transfer program, similar to |
| 61 | .Xr ftp 1 , |
| 62 | which performs all operations over an encrypted |
| 63 | .Xr ssh 1 |
| 64 | transport. |
| 65 | It may also use many features of ssh, such as public key authentication and |
| 66 | compression. |
| 67 | .Nm |
| 68 | connects and logs into the specified |
Ben Lindstrom | aafff9c | 2001-05-06 03:01:02 +0000 | [diff] [blame] | 69 | .Ar host , |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 70 | then enters an interactive command mode. |
| 71 | .Pp |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 72 | The second usage format will retrieve files automatically if a non-interactive |
Ben Lindstrom | aafff9c | 2001-05-06 03:01:02 +0000 | [diff] [blame] | 73 | authentication method is used; otherwise it will do so after |
| 74 | successful interactive authentication. |
Ben Lindstrom | 63667f6 | 2001-04-13 00:00:14 +0000 | [diff] [blame] | 75 | .Pp |
Darren Tucker | 16e254d | 2004-12-06 22:46:45 +1100 | [diff] [blame] | 76 | The third usage format allows |
| 77 | .Nm |
| 78 | to start in a remote directory. |
Ben Lindstrom | 63667f6 | 2001-04-13 00:00:14 +0000 | [diff] [blame] | 79 | .Pp |
Damien Miller | 5067792 | 2003-05-23 18:44:04 +1000 | [diff] [blame] | 80 | The final usage format allows for automated sessions using the |
Damien Miller | fb7508e | 2003-05-14 13:47:07 +1000 | [diff] [blame] | 81 | .Fl b |
Damien Miller | 5067792 | 2003-05-23 18:44:04 +1000 | [diff] [blame] | 82 | option. |
Damien Miller | 134eb81 | 2005-12-31 16:22:55 +1100 | [diff] [blame] | 83 | In such cases, it is necessary to configure non-interactive authentication |
Damien Miller | 5067792 | 2003-05-23 18:44:04 +1000 | [diff] [blame] | 84 | to obviate the need to enter a password at connection time (see |
Damien Miller | fb7508e | 2003-05-14 13:47:07 +1000 | [diff] [blame] | 85 | .Xr sshd 8 |
Damien Miller | d6ead28 | 2003-05-14 19:30:38 +1000 | [diff] [blame] | 86 | and |
Damien Miller | fb7508e | 2003-05-14 13:47:07 +1000 | [diff] [blame] | 87 | .Xr ssh-keygen 1 |
Damien Miller | 5067792 | 2003-05-23 18:44:04 +1000 | [diff] [blame] | 88 | for details). |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 89 | The options are as follows: |
| 90 | .Bl -tag -width Ds |
Darren Tucker | 1f20394 | 2003-10-15 15:50:42 +1000 | [diff] [blame] | 91 | .It Fl 1 |
| 92 | Specify the use of protocol version 1. |
Darren Tucker | 46bbbe3 | 2009-10-07 08:21:48 +1100 | [diff] [blame] | 93 | .It Fl 2 |
| 94 | Specify the use of protocol version 2. |
| 95 | .It Fl 4 |
| 96 | Forces |
| 97 | .Nm |
| 98 | to use IPv4 addresses only. |
| 99 | .It Fl 6 |
| 100 | Forces |
| 101 | .Nm |
| 102 | to use IPv6 addresses only. |
Darren Tucker | 1f20394 | 2003-10-15 15:50:42 +1000 | [diff] [blame] | 103 | .It Fl B Ar buffer_size |
| 104 | Specify the size of the buffer that |
| 105 | .Nm |
| 106 | uses when transferring files. |
| 107 | Larger buffers require fewer round trips at the cost of higher |
| 108 | memory consumption. |
| 109 | The default is 32768 bytes. |
Ben Lindstrom | 562c26b | 2001-03-07 01:26:48 +0000 | [diff] [blame] | 110 | .It Fl b Ar batchfile |
| 111 | Batch mode reads a series of commands from an input |
Ben Lindstrom | 283cb82 | 2001-03-09 00:09:02 +0000 | [diff] [blame] | 112 | .Ar batchfile |
Ben Lindstrom | 562c26b | 2001-03-07 01:26:48 +0000 | [diff] [blame] | 113 | instead of |
Ben Lindstrom | 283cb82 | 2001-03-09 00:09:02 +0000 | [diff] [blame] | 114 | .Em stdin . |
| 115 | Since it lacks user interaction it should be used in conjunction with |
Damien Miller | 86a3968 | 2004-01-21 11:00:04 +1100 | [diff] [blame] | 116 | non-interactive authentication. |
Damien Miller | 44f75c1 | 2004-01-21 10:58:47 +1100 | [diff] [blame] | 117 | A |
Damien Miller | 86a3968 | 2004-01-21 11:00:04 +1100 | [diff] [blame] | 118 | .Ar batchfile |
| 119 | of |
| 120 | .Sq \- |
Damien Miller | 44f75c1 | 2004-01-21 10:58:47 +1100 | [diff] [blame] | 121 | may be used to indicate standard input. |
Ben Lindstrom | 283cb82 | 2001-03-09 00:09:02 +0000 | [diff] [blame] | 122 | .Nm |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 123 | will abort if any of the following |
| 124 | commands fail: |
Ben Lindstrom | 3612bda | 2002-03-05 01:26:38 +0000 | [diff] [blame] | 125 | .Ic get , put , rename , ln , |
Damien Miller | 495dca3 | 2003-04-01 21:42:14 +1000 | [diff] [blame] | 126 | .Ic rm , mkdir , chdir , ls , |
Damien Miller | 64058cb | 2008-05-19 14:54:25 +1000 | [diff] [blame] | 127 | .Ic lchdir , chmod , chown , |
| 128 | .Ic chgrp , lpwd , df , |
Ben Lindstrom | 562c26b | 2001-03-07 01:26:48 +0000 | [diff] [blame] | 129 | and |
Ben Lindstrom | 283cb82 | 2001-03-09 00:09:02 +0000 | [diff] [blame] | 130 | .Ic lmkdir . |
Damien Miller | 495dca3 | 2003-04-01 21:42:14 +1000 | [diff] [blame] | 131 | Termination on error can be suppressed on a command by command basis by |
| 132 | prefixing the command with a |
Damien Miller | 86a3968 | 2004-01-21 11:00:04 +1100 | [diff] [blame] | 133 | .Sq \- |
Damien Miller | 5067792 | 2003-05-23 18:44:04 +1000 | [diff] [blame] | 134 | character (for example, |
| 135 | .Ic -rm /tmp/blah* ) . |
Darren Tucker | 1f20394 | 2003-10-15 15:50:42 +1000 | [diff] [blame] | 136 | .It Fl C |
| 137 | Enables compression (via ssh's |
| 138 | .Fl C |
| 139 | flag). |
Darren Tucker | adba1ba | 2009-10-07 08:22:20 +1100 | [diff] [blame] | 140 | .It Fl c Ar cipher |
| 141 | Selects the cipher to use for encrypting the data transfers. |
| 142 | This option is directly passed to |
| 143 | .Xr ssh 1 . |
Darren Tucker | 282b402 | 2009-10-07 08:23:06 +1100 | [diff] [blame] | 144 | .It Fl D Ar sftp_server_path |
| 145 | Connect directly to a local sftp server |
| 146 | (rather than via |
| 147 | .Xr ssh 1 ) . |
| 148 | This option may be useful in debugging the client and server. |
Darren Tucker | 1f20394 | 2003-10-15 15:50:42 +1000 | [diff] [blame] | 149 | .It Fl F Ar ssh_config |
| 150 | Specifies an alternative |
| 151 | per-user configuration file for |
| 152 | .Xr ssh 1 . |
| 153 | This option is directly passed to |
| 154 | .Xr ssh 1 . |
Darren Tucker | 46bbbe3 | 2009-10-07 08:21:48 +1100 | [diff] [blame] | 155 | .It Fl i Ar identity_file |
| 156 | Selects the file from which the identity (private key) for public key |
| 157 | authentication is read. |
| 158 | This option is directly passed to |
| 159 | .Xr ssh 1 . |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 160 | .It Fl o Ar ssh_option |
Ben Lindstrom | 14c62eb | 2001-08-15 23:25:46 +0000 | [diff] [blame] | 161 | Can be used to pass options to |
| 162 | .Nm ssh |
Ben Lindstrom | 3072aae | 2002-06-21 01:02:39 +0000 | [diff] [blame] | 163 | in the format used in |
| 164 | .Xr ssh_config 5 . |
| 165 | This is useful for specifying options |
Ben Lindstrom | 14c62eb | 2001-08-15 23:25:46 +0000 | [diff] [blame] | 166 | for which there is no separate |
| 167 | .Nm sftp |
Damien Miller | 5067792 | 2003-05-23 18:44:04 +1000 | [diff] [blame] | 168 | command-line flag. |
| 169 | For example, to specify an alternate port use: |
Ben Lindstrom | 6a33763 | 2001-09-18 05:47:32 +0000 | [diff] [blame] | 170 | .Ic sftp -oPort=24 . |
Darren Tucker | 1f20394 | 2003-10-15 15:50:42 +1000 | [diff] [blame] | 171 | For full details of the options listed below, and their possible values, see |
| 172 | .Xr ssh_config 5 . |
| 173 | .Pp |
| 174 | .Bl -tag -width Ds -offset indent -compact |
| 175 | .It AddressFamily |
| 176 | .It BatchMode |
| 177 | .It BindAddress |
| 178 | .It ChallengeResponseAuthentication |
| 179 | .It CheckHostIP |
| 180 | .It Cipher |
| 181 | .It Ciphers |
Darren Tucker | 1f20394 | 2003-10-15 15:50:42 +1000 | [diff] [blame] | 182 | .It Compression |
| 183 | .It CompressionLevel |
| 184 | .It ConnectionAttempts |
Darren Tucker | 3d5cbb7 | 2004-05-03 09:13:15 +1000 | [diff] [blame] | 185 | .It ConnectTimeout |
Damien Miller | 0e220db | 2004-06-15 10:34:08 +1000 | [diff] [blame] | 186 | .It ControlMaster |
| 187 | .It ControlPath |
Darren Tucker | 1f20394 | 2003-10-15 15:50:42 +1000 | [diff] [blame] | 188 | .It GlobalKnownHostsFile |
| 189 | .It GSSAPIAuthentication |
| 190 | .It GSSAPIDelegateCredentials |
Damien Miller | 27e9c51 | 2005-03-02 12:04:16 +1100 | [diff] [blame] | 191 | .It HashKnownHosts |
Darren Tucker | 1f20394 | 2003-10-15 15:50:42 +1000 | [diff] [blame] | 192 | .It Host |
| 193 | .It HostbasedAuthentication |
| 194 | .It HostKeyAlgorithms |
| 195 | .It HostKeyAlias |
| 196 | .It HostName |
| 197 | .It IdentityFile |
Damien Miller | bd394c3 | 2004-03-08 23:12:36 +1100 | [diff] [blame] | 198 | .It IdentitiesOnly |
Darren Tucker | 636ca90 | 2004-11-05 20:22:00 +1100 | [diff] [blame] | 199 | .It KbdInteractiveDevices |
Darren Tucker | 1f20394 | 2003-10-15 15:50:42 +1000 | [diff] [blame] | 200 | .It LogLevel |
| 201 | .It MACs |
| 202 | .It NoHostAuthenticationForLocalhost |
| 203 | .It NumberOfPasswordPrompts |
| 204 | .It PasswordAuthentication |
| 205 | .It Port |
| 206 | .It PreferredAuthentications |
| 207 | .It Protocol |
| 208 | .It ProxyCommand |
| 209 | .It PubkeyAuthentication |
Darren Tucker | 62388b2 | 2006-01-20 11:31:47 +1100 | [diff] [blame] | 210 | .It RekeyLimit |
Darren Tucker | 1f20394 | 2003-10-15 15:50:42 +1000 | [diff] [blame] | 211 | .It RhostsRSAAuthentication |
| 212 | .It RSAAuthentication |
Darren Tucker | 7a6c066 | 2004-05-02 22:14:03 +1000 | [diff] [blame] | 213 | .It SendEnv |
Damien Miller | 509b010 | 2003-12-17 16:33:10 +1100 | [diff] [blame] | 214 | .It ServerAliveInterval |
| 215 | .It ServerAliveCountMax |
Darren Tucker | 1f20394 | 2003-10-15 15:50:42 +1000 | [diff] [blame] | 216 | .It SmartcardDevice |
| 217 | .It StrictHostKeyChecking |
Damien Miller | 12c150e | 2003-12-17 16:31:10 +1100 | [diff] [blame] | 218 | .It TCPKeepAlive |
Darren Tucker | 1f20394 | 2003-10-15 15:50:42 +1000 | [diff] [blame] | 219 | .It UsePrivilegedPort |
| 220 | .It User |
| 221 | .It UserKnownHostsFile |
| 222 | .It VerifyHostKeyDNS |
Darren Tucker | 1f20394 | 2003-10-15 15:50:42 +1000 | [diff] [blame] | 223 | .El |
Darren Tucker | 282b402 | 2009-10-07 08:23:06 +1100 | [diff] [blame] | 224 | .It Fl P Ar port |
| 225 | Specifies the port to connect to on the remote host. |
Darren Tucker | 1b0dd17 | 2009-10-07 08:37:48 +1100 | [diff] [blame] | 226 | .It Fl p |
| 227 | Preserves modification times, access times, and modes from the |
| 228 | original files transferred. |
Darren Tucker | 46bbbe3 | 2009-10-07 08:21:48 +1100 | [diff] [blame] | 229 | .It Fl q |
| 230 | Quiet mode: disables the progress meter as well as warning and |
| 231 | diagnostic messages from |
| 232 | .Xr ssh 1 . |
Damien Miller | 16a1333 | 2002-02-13 14:03:56 +1100 | [diff] [blame] | 233 | .It Fl R Ar num_requests |
Damien Miller | 5067792 | 2003-05-23 18:44:04 +1000 | [diff] [blame] | 234 | Specify how many requests may be outstanding at any one time. |
| 235 | Increasing this may slightly improve file transfer speed |
| 236 | but will increase memory usage. |
Damien Miller | 94717b0 | 2008-07-16 21:17:23 +1000 | [diff] [blame] | 237 | The default is 64 outstanding requests. |
Darren Tucker | 1b0dd17 | 2009-10-07 08:37:48 +1100 | [diff] [blame] | 238 | .It Fl r |
| 239 | Recursively copy entire directories when uploading and downloading. |
| 240 | Note that |
| 241 | .Nm |
| 242 | does not follow symbolic links encountered in the tree traversal. |
Ben Lindstrom | 6a33763 | 2001-09-18 05:47:32 +0000 | [diff] [blame] | 243 | .It Fl S Ar program |
| 244 | Name of the |
| 245 | .Ar program |
| 246 | to use for the encrypted connection. |
| 247 | The program must understand |
| 248 | .Xr ssh 1 |
| 249 | options. |
Darren Tucker | 1f20394 | 2003-10-15 15:50:42 +1000 | [diff] [blame] | 250 | .It Fl s Ar subsystem | sftp_server |
| 251 | Specifies the SSH2 subsystem or the path for an sftp server |
| 252 | on the remote host. |
| 253 | A path is useful for using |
| 254 | .Nm |
| 255 | over protocol version 1, or when the remote |
| 256 | .Xr sshd 8 |
| 257 | does not have an sftp subsystem configured. |
| 258 | .It Fl v |
| 259 | Raise logging level. |
| 260 | This option is also passed to ssh. |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 261 | .El |
| 262 | .Sh INTERACTIVE COMMANDS |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 263 | Once in interactive mode, |
| 264 | .Nm |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 265 | understands a set of commands similar to those of |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 266 | .Xr ftp 1 . |
Darren Tucker | 16e254d | 2004-12-06 22:46:45 +1100 | [diff] [blame] | 267 | Commands are case insensitive. |
| 268 | Pathnames that contain spaces must be enclosed in quotes. |
| 269 | Any special characters contained within pathnames that are recognized by |
| 270 | .Xr glob 3 |
| 271 | must be escaped with backslashes |
| 272 | .Pq Sq \e . |
| 273 | .Bl -tag -width Ds |
Ben Lindstrom | 59e1249 | 2001-08-15 23:22:56 +0000 | [diff] [blame] | 274 | .It Ic bye |
Damien Miller | 5067792 | 2003-05-23 18:44:04 +1000 | [diff] [blame] | 275 | Quit |
| 276 | .Nm sftp . |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 277 | .It Ic cd Ar path |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 278 | Change remote directory to |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 279 | .Ar path . |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 280 | .It Ic chgrp Ar grp Ar path |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 281 | Change group of file |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 282 | .Ar path |
| 283 | to |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 284 | .Ar grp . |
Darren Tucker | 16e254d | 2004-12-06 22:46:45 +1100 | [diff] [blame] | 285 | .Ar path |
| 286 | may contain |
| 287 | .Xr glob 3 |
| 288 | characters and may match multiple files. |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 289 | .Ar grp |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 290 | must be a numeric GID. |
| 291 | .It Ic chmod Ar mode Ar path |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 292 | Change permissions of file |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 293 | .Ar path |
| 294 | to |
| 295 | .Ar mode . |
Darren Tucker | 16e254d | 2004-12-06 22:46:45 +1100 | [diff] [blame] | 296 | .Ar path |
| 297 | may contain |
| 298 | .Xr glob 3 |
| 299 | characters and may match multiple files. |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 300 | .It Ic chown Ar own Ar path |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 301 | Change owner of file |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 302 | .Ar path |
| 303 | to |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 304 | .Ar own . |
Darren Tucker | 16e254d | 2004-12-06 22:46:45 +1100 | [diff] [blame] | 305 | .Ar path |
| 306 | may contain |
| 307 | .Xr glob 3 |
| 308 | characters and may match multiple files. |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 309 | .Ar own |
| 310 | must be a numeric UID. |
Damien Miller | d671e5a | 2008-05-19 14:53:33 +1000 | [diff] [blame] | 311 | .It Xo Ic df |
| 312 | .Op Fl hi |
| 313 | .Op Ar path |
| 314 | .Xc |
| 315 | Display usage information for the filesystem holding the current directory |
| 316 | (or |
| 317 | .Ar path |
| 318 | if specified). |
| 319 | If the |
| 320 | .Fl h |
| 321 | flag is specified, the capacity information will be displayed using |
| 322 | "human-readable" suffixes. |
| 323 | The |
| 324 | .Fl i |
| 325 | flag requests display of inode information in addition to capacity information. |
| 326 | This command is only supported on servers that implement the |
| 327 | .Dq statvfs@openssh.com |
| 328 | extension. |
Ben Lindstrom | c9b6eab | 2001-03-07 01:29:17 +0000 | [diff] [blame] | 329 | .It Ic exit |
Damien Miller | 5067792 | 2003-05-23 18:44:04 +1000 | [diff] [blame] | 330 | Quit |
| 331 | .Nm sftp . |
Ben Lindstrom | 9d4f2c8 | 2001-02-15 03:22:45 +0000 | [diff] [blame] | 332 | .It Xo Ic get |
Darren Tucker | 1b0dd17 | 2009-10-07 08:37:48 +1100 | [diff] [blame] | 333 | .Op Fl Ppr |
Ben Lindstrom | 9d4f2c8 | 2001-02-15 03:22:45 +0000 | [diff] [blame] | 334 | .Ar remote-path |
| 335 | .Op Ar local-path |
| 336 | .Xc |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 337 | Retrieve the |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 338 | .Ar remote-path |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 339 | and store it on the local machine. |
| 340 | If the local |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 341 | path name is not specified, it is given the same name it has on the |
Damien Miller | 5067792 | 2003-05-23 18:44:04 +1000 | [diff] [blame] | 342 | remote machine. |
Darren Tucker | 16e254d | 2004-12-06 22:46:45 +1100 | [diff] [blame] | 343 | .Ar remote-path |
| 344 | may contain |
| 345 | .Xr glob 3 |
| 346 | characters and may match multiple files. |
| 347 | If it does and |
| 348 | .Ar local-path |
| 349 | is specified, then |
| 350 | .Ar local-path |
| 351 | must specify a directory. |
Darren Tucker | 1b0dd17 | 2009-10-07 08:37:48 +1100 | [diff] [blame] | 352 | .Pp |
Darren Tucker | b3b40a8 | 2009-10-07 08:39:09 +1100 | [diff] [blame] | 353 | If either the |
Darren Tucker | 05016b2 | 2009-10-07 08:38:23 +1100 | [diff] [blame] | 354 | .Fl P |
Darren Tucker | 1b0dd17 | 2009-10-07 08:37:48 +1100 | [diff] [blame] | 355 | or |
| 356 | .Fl p |
Darren Tucker | 16e254d | 2004-12-06 22:46:45 +1100 | [diff] [blame] | 357 | flag is specified, then full file permissions and access times are |
Ben Lindstrom | 9d4f2c8 | 2001-02-15 03:22:45 +0000 | [diff] [blame] | 358 | copied too. |
Darren Tucker | 1b0dd17 | 2009-10-07 08:37:48 +1100 | [diff] [blame] | 359 | .Pp |
| 360 | If the |
| 361 | .Fl r |
| 362 | flag is specified then directories will be copied recursively. |
| 363 | Note that |
| 364 | .Nm |
| 365 | does not follow symbolic links when performing recursive transfers. |
Ben Lindstrom | c9b6eab | 2001-03-07 01:29:17 +0000 | [diff] [blame] | 366 | .It Ic help |
| 367 | Display help text. |
Darren Tucker | 1f20394 | 2003-10-15 15:50:42 +1000 | [diff] [blame] | 368 | .It Ic lcd Ar path |
| 369 | Change local directory to |
| 370 | .Ar path . |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 371 | .It Ic lls Op Ar ls-options Op Ar path |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 372 | Display local directory listing of either |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 373 | .Ar path |
| 374 | or current directory if |
| 375 | .Ar path |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 376 | is not specified. |
Darren Tucker | 16e254d | 2004-12-06 22:46:45 +1100 | [diff] [blame] | 377 | .Ar ls-options |
| 378 | may contain any flags supported by the local system's |
| 379 | .Xr ls 1 |
| 380 | command. |
| 381 | .Ar path |
| 382 | may contain |
| 383 | .Xr glob 3 |
| 384 | characters and may match multiple files. |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 385 | .It Ic lmkdir Ar path |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 386 | Create local directory specified by |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 387 | .Ar path . |
Damien Miller | 058316f | 2001-03-08 10:08:49 +1100 | [diff] [blame] | 388 | .It Ic ln Ar oldpath Ar newpath |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 389 | Create a symbolic link from |
Damien Miller | 058316f | 2001-03-08 10:08:49 +1100 | [diff] [blame] | 390 | .Ar oldpath |
| 391 | to |
| 392 | .Ar newpath . |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 393 | .It Ic lpwd |
| 394 | Print local working directory. |
Damien Miller | e1a4981 | 2002-09-12 09:54:25 +1000 | [diff] [blame] | 395 | .It Xo Ic ls |
Darren Tucker | 75fe626 | 2010-01-15 11:42:51 +1100 | [diff] [blame] | 396 | .Op Fl 1afhlnrSt |
Damien Miller | e1a4981 | 2002-09-12 09:54:25 +1000 | [diff] [blame] | 397 | .Op Ar path |
| 398 | .Xc |
Darren Tucker | 16e254d | 2004-12-06 22:46:45 +1100 | [diff] [blame] | 399 | Display a remote directory listing of either |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 400 | .Ar path |
Darren Tucker | 16e254d | 2004-12-06 22:46:45 +1100 | [diff] [blame] | 401 | or the current directory if |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 402 | .Ar path |
Damien Miller | 5067792 | 2003-05-23 18:44:04 +1000 | [diff] [blame] | 403 | is not specified. |
Darren Tucker | 16e254d | 2004-12-06 22:46:45 +1100 | [diff] [blame] | 404 | .Ar path |
| 405 | may contain |
| 406 | .Xr glob 3 |
| 407 | characters and may match multiple files. |
Darren Tucker | 15ca6e8 | 2004-06-22 13:08:21 +1000 | [diff] [blame] | 408 | .Pp |
Darren Tucker | 16e254d | 2004-12-06 22:46:45 +1100 | [diff] [blame] | 409 | The following flags are recognized and alter the behaviour of |
Darren Tucker | 15ca6e8 | 2004-06-22 13:08:21 +1000 | [diff] [blame] | 410 | .Ic ls |
Darren Tucker | 16e254d | 2004-12-06 22:46:45 +1100 | [diff] [blame] | 411 | accordingly: |
| 412 | .Bl -tag -width Ds |
| 413 | .It Fl 1 |
| 414 | Produce single columnar output. |
| 415 | .It Fl a |
| 416 | List files beginning with a dot |
| 417 | .Pq Sq \&. . |
| 418 | .It Fl f |
| 419 | Do not sort the listing. |
| 420 | The default sort order is lexicographical. |
Darren Tucker | 2901e2d | 2010-01-13 22:44:06 +1100 | [diff] [blame] | 421 | .It Fl h |
| 422 | When used with a long format option, use unit suffixes: Byte, Kilobyte, |
| 423 | Megabyte, Gigabyte, Terabyte, Petabyte, and Exabyte in order to reduce |
| 424 | the number of digits to four or fewer using powers of 2 for sizes (K=1024, |
| 425 | M=1048576, etc.). |
Darren Tucker | 75fe626 | 2010-01-15 11:42:51 +1100 | [diff] [blame] | 426 | .It Fl l |
| 427 | Display additional details including permissions |
| 428 | and ownership information. |
Darren Tucker | 16e254d | 2004-12-06 22:46:45 +1100 | [diff] [blame] | 429 | .It Fl n |
| 430 | Produce a long listing with user and group information presented |
| 431 | numerically. |
| 432 | .It Fl r |
| 433 | Reverse the sort order of the listing. |
| 434 | .It Fl S |
| 435 | Sort the listing by file size. |
| 436 | .It Fl t |
| 437 | Sort the listing by last modification time. |
| 438 | .El |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 439 | .It Ic lumask Ar umask |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 440 | Set local umask to |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 441 | .Ar umask . |
| 442 | .It Ic mkdir Ar path |
| 443 | Create remote directory specified by |
| 444 | .Ar path . |
Damien Miller | 62d57f6 | 2003-01-10 21:43:24 +1100 | [diff] [blame] | 445 | .It Ic progress |
| 446 | Toggle display of progress meter. |
Ben Lindstrom | 9d4f2c8 | 2001-02-15 03:22:45 +0000 | [diff] [blame] | 447 | .It Xo Ic put |
Darren Tucker | 05016b2 | 2009-10-07 08:38:23 +1100 | [diff] [blame] | 448 | .Op Fl Ppr |
Ben Lindstrom | 9d4f2c8 | 2001-02-15 03:22:45 +0000 | [diff] [blame] | 449 | .Ar local-path |
Ben Lindstrom | d576781 | 2002-12-23 02:23:37 +0000 | [diff] [blame] | 450 | .Op Ar remote-path |
Ben Lindstrom | 9d4f2c8 | 2001-02-15 03:22:45 +0000 | [diff] [blame] | 451 | .Xc |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 452 | Upload |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 453 | .Ar local-path |
Damien Miller | 5067792 | 2003-05-23 18:44:04 +1000 | [diff] [blame] | 454 | and store it on the remote machine. |
| 455 | If the remote path name is not specified, it is given the same name it has |
| 456 | on the local machine. |
Darren Tucker | 16e254d | 2004-12-06 22:46:45 +1100 | [diff] [blame] | 457 | .Ar local-path |
| 458 | may contain |
| 459 | .Xr glob 3 |
| 460 | characters and may match multiple files. |
| 461 | If it does and |
| 462 | .Ar remote-path |
| 463 | is specified, then |
| 464 | .Ar remote-path |
| 465 | must specify a directory. |
Darren Tucker | 1b0dd17 | 2009-10-07 08:37:48 +1100 | [diff] [blame] | 466 | .Pp |
| 467 | If ether the |
Ben Lindstrom | 9d4f2c8 | 2001-02-15 03:22:45 +0000 | [diff] [blame] | 468 | .Fl P |
Darren Tucker | 1b0dd17 | 2009-10-07 08:37:48 +1100 | [diff] [blame] | 469 | or |
| 470 | .Fl p |
| 471 | flag is specified, then full file permissions and access times are |
Ben Lindstrom | 9d4f2c8 | 2001-02-15 03:22:45 +0000 | [diff] [blame] | 472 | copied too. |
Darren Tucker | 1b0dd17 | 2009-10-07 08:37:48 +1100 | [diff] [blame] | 473 | .Pp |
| 474 | If the |
| 475 | .Fl r |
| 476 | flag is specified then directories will be copied recursively. |
| 477 | Note that |
| 478 | .Nm |
| 479 | does not follow symbolic links when performing recursive transfers. |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 480 | .It Ic pwd |
| 481 | Display remote working directory. |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 482 | .It Ic quit |
Damien Miller | 5067792 | 2003-05-23 18:44:04 +1000 | [diff] [blame] | 483 | Quit |
| 484 | .Nm sftp . |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 485 | .It Ic rename Ar oldpath Ar newpath |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 486 | Rename remote file from |
| 487 | .Ar oldpath |
| 488 | to |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 489 | .Ar newpath . |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 490 | .It Ic rm Ar path |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 491 | Delete remote file specified by |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 492 | .Ar path . |
Darren Tucker | 1f20394 | 2003-10-15 15:50:42 +1000 | [diff] [blame] | 493 | .It Ic rmdir Ar path |
| 494 | Remove remote directory specified by |
| 495 | .Ar path . |
Damien Miller | 058316f | 2001-03-08 10:08:49 +1100 | [diff] [blame] | 496 | .It Ic symlink Ar oldpath Ar newpath |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 497 | Create a symbolic link from |
Damien Miller | 058316f | 2001-03-08 10:08:49 +1100 | [diff] [blame] | 498 | .Ar oldpath |
| 499 | to |
| 500 | .Ar newpath . |
Damien Miller | 6342180 | 2003-01-08 14:05:23 +1100 | [diff] [blame] | 501 | .It Ic version |
| 502 | Display the |
| 503 | .Nm |
| 504 | protocol version. |
Damien Miller | 62fd18a | 2009-01-28 16:14:09 +1100 | [diff] [blame] | 505 | .It Ic \&! Ns Ar command |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 506 | Execute |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 507 | .Ar command |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 508 | in local shell. |
Damien Miller | c2b9827 | 2003-09-03 12:13:30 +1000 | [diff] [blame] | 509 | .It Ic \&! |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 510 | Escape to local shell. |
Damien Miller | c2b9827 | 2003-09-03 12:13:30 +1000 | [diff] [blame] | 511 | .It Ic \&? |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 512 | Synonym for help. |
| 513 | .El |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 514 | .Sh SEE ALSO |
Darren Tucker | 1f20394 | 2003-10-15 15:50:42 +1000 | [diff] [blame] | 515 | .Xr ftp 1 , |
Darren Tucker | 16e254d | 2004-12-06 22:46:45 +1100 | [diff] [blame] | 516 | .Xr ls 1 , |
Ben Lindstrom | 160ec62 | 2001-04-22 17:17:46 +0000 | [diff] [blame] | 517 | .Xr scp 1 , |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 518 | .Xr ssh 1 , |
| 519 | .Xr ssh-add 1 , |
| 520 | .Xr ssh-keygen 1 , |
Darren Tucker | 16e254d | 2004-12-06 22:46:45 +1100 | [diff] [blame] | 521 | .Xr glob 3 , |
Ben Lindstrom | 3072aae | 2002-06-21 01:02:39 +0000 | [diff] [blame] | 522 | .Xr ssh_config 5 , |
Ben Lindstrom | 160ec62 | 2001-04-22 17:17:46 +0000 | [diff] [blame] | 523 | .Xr sftp-server 8 , |
| 524 | .Xr sshd 8 |
| 525 | .Rs |
Ben Lindstrom | 90fd060 | 2001-06-25 04:45:33 +0000 | [diff] [blame] | 526 | .%A T. Ylonen |
| 527 | .%A S. Lehtinen |
Ben Lindstrom | 160ec62 | 2001-04-22 17:17:46 +0000 | [diff] [blame] | 528 | .%T "SSH File Transfer Protocol" |
| 529 | .%N draft-ietf-secsh-filexfer-00.txt |
| 530 | .%D January 2001 |
| 531 | .%O work in progress material |
| 532 | .Re |