Ben Lindstrom | 6a33763 | 2001-09-18 05:47:32 +0000 | [diff] [blame] | 1 | .\" $OpenBSD: sftp.1,v 1.26 2001/09/17 20:38:09 stevesk 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 | .\" |
Ben Lindstrom | 8ffeacf | 2001-04-10 02:43:57 +0000 | [diff] [blame] | 25 | .Dd February 4, 2001 |
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 | 225736c | 2001-02-19 21:51:08 +1100 | [diff] [blame] | 30 | .Nd Secure file transfer program |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 31 | .Sh SYNOPSIS |
| 32 | .Nm sftp |
Ben Lindstrom | 6a33763 | 2001-09-18 05:47:32 +0000 | [diff] [blame] | 33 | .Op Fl 1Cv |
Ben Lindstrom | 562c26b | 2001-03-07 01:26:48 +0000 | [diff] [blame] | 34 | .Op Fl b Ar batchfile |
Ben Lindstrom | 1e24324 | 2001-09-18 05:38:44 +0000 | [diff] [blame] | 35 | .Op Fl F Ar ssh_config |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 36 | .Op Fl o Ar ssh_option |
Ben Lindstrom | 6a33763 | 2001-09-18 05:47:32 +0000 | [diff] [blame] | 37 | .Op Fl s Ar subsystem | sftp_server |
| 38 | .Op Fl S Ar program |
| 39 | .Ar host |
Ben Lindstrom | 63667f6 | 2001-04-13 00:00:14 +0000 | [diff] [blame] | 40 | .Nm sftp |
| 41 | .Op [\fIuser\fR@]\fIhost\fR[:\fIfile\fR [\fIfile\fR]] |
| 42 | .Nm sftp |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 43 | .Op [\fIuser\fR@]\fIhost\fR[:\fIdir\fR[\fI/\fR]] |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 44 | .Sh DESCRIPTION |
| 45 | .Nm |
| 46 | is an interactive file transfer program, similar to |
| 47 | .Xr ftp 1 , |
| 48 | which performs all operations over an encrypted |
| 49 | .Xr ssh 1 |
| 50 | transport. |
| 51 | It may also use many features of ssh, such as public key authentication and |
| 52 | compression. |
| 53 | .Nm |
| 54 | connects and logs into the specified |
Ben Lindstrom | aafff9c | 2001-05-06 03:01:02 +0000 | [diff] [blame] | 55 | .Ar host , |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 56 | then enters an interactive command mode. |
| 57 | .Pp |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 58 | The second usage format will retrieve files automatically if a non-interactive |
Ben Lindstrom | aafff9c | 2001-05-06 03:01:02 +0000 | [diff] [blame] | 59 | authentication method is used; otherwise it will do so after |
| 60 | successful interactive authentication. |
Ben Lindstrom | 63667f6 | 2001-04-13 00:00:14 +0000 | [diff] [blame] | 61 | .Pp |
| 62 | The last usage format allows the sftp client to start in a remote directory. |
| 63 | .Pp |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 64 | The options are as follows: |
| 65 | .Bl -tag -width Ds |
Ben Lindstrom | 6a33763 | 2001-09-18 05:47:32 +0000 | [diff] [blame] | 66 | .It Fl 1 |
| 67 | Specify the use of protocol version 1. |
Ben Lindstrom | 562c26b | 2001-03-07 01:26:48 +0000 | [diff] [blame] | 68 | .It Fl b Ar batchfile |
| 69 | Batch mode reads a series of commands from an input |
Ben Lindstrom | 283cb82 | 2001-03-09 00:09:02 +0000 | [diff] [blame] | 70 | .Ar batchfile |
Ben Lindstrom | 562c26b | 2001-03-07 01:26:48 +0000 | [diff] [blame] | 71 | instead of |
Ben Lindstrom | 283cb82 | 2001-03-09 00:09:02 +0000 | [diff] [blame] | 72 | .Em stdin . |
| 73 | Since it lacks user interaction it should be used in conjunction with |
| 74 | non-interactive authentication. |
| 75 | .Nm |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 76 | will abort if any of the following |
| 77 | commands fail: |
Ben Lindstrom | 283cb82 | 2001-03-09 00:09:02 +0000 | [diff] [blame] | 78 | .Ic get , put , rename , ln , rm , mkdir , chdir , lchdir |
Ben Lindstrom | 562c26b | 2001-03-07 01:26:48 +0000 | [diff] [blame] | 79 | and |
Ben Lindstrom | 283cb82 | 2001-03-09 00:09:02 +0000 | [diff] [blame] | 80 | .Ic lmkdir . |
Ben Lindstrom | c9b6eab | 2001-03-07 01:29:17 +0000 | [diff] [blame] | 81 | .It Fl C |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 82 | Enables compression (via ssh's |
Ben Lindstrom | c9b6eab | 2001-03-07 01:29:17 +0000 | [diff] [blame] | 83 | .Fl C |
Ben Lindstrom | 6a33763 | 2001-09-18 05:47:32 +0000 | [diff] [blame] | 84 | flag). |
Ben Lindstrom | 1e24324 | 2001-09-18 05:38:44 +0000 | [diff] [blame] | 85 | .It Fl F Ar ssh_config |
| 86 | Specifies an alternative |
| 87 | per-user configuration file for |
| 88 | .Nm ssh . |
| 89 | This option is directly passed to |
| 90 | .Xr ssh 1 . |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 91 | .It Fl o Ar ssh_option |
Ben Lindstrom | 14c62eb | 2001-08-15 23:25:46 +0000 | [diff] [blame] | 92 | Can be used to pass options to |
| 93 | .Nm ssh |
| 94 | in the format used in the |
| 95 | .Xr ssh 1 |
| 96 | configuration file. This is useful for specifying options |
| 97 | for which there is no separate |
| 98 | .Nm sftp |
Ben Lindstrom | 6a33763 | 2001-09-18 05:47:32 +0000 | [diff] [blame] | 99 | command-line flag. For example, to specify an alternate |
| 100 | port use: |
| 101 | .Ic sftp -oPort=24 . |
| 102 | .It Fl s Ar subsystem | sftp_server |
| 103 | Specifies the SSH2 subsystem or the path for an sftp server |
| 104 | on the remote host. A path is useful for using sftp over |
| 105 | protocol version 1, or when the remote |
| 106 | .Nm sshd |
| 107 | does not have an sftp subsystem configured. |
| 108 | .It Fl S Ar program |
| 109 | Name of the |
| 110 | .Ar program |
| 111 | to use for the encrypted connection. |
| 112 | The program must understand |
| 113 | .Xr ssh 1 |
| 114 | options. |
Ben Lindstrom | c9b6eab | 2001-03-07 01:29:17 +0000 | [diff] [blame] | 115 | .It Fl v |
| 116 | Raise logging level. This option is also passed to ssh. |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 117 | .El |
| 118 | .Sh INTERACTIVE COMMANDS |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 119 | Once in interactive mode, |
| 120 | .Nm |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 121 | understands a set of commands similar to those of |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 122 | .Xr ftp 1 . |
Ben Lindstrom | 27cb1d0 | 2001-02-10 21:59:35 +0000 | [diff] [blame] | 123 | Commands are case insensitive and pathnames may be enclosed in quotes if they |
| 124 | contain spaces. |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 125 | .Bl -tag -width Ds |
Ben Lindstrom | 59e1249 | 2001-08-15 23:22:56 +0000 | [diff] [blame] | 126 | .It Ic bye |
| 127 | Quit sftp. |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 128 | .It Ic cd Ar path |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 129 | Change remote directory to |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 130 | .Ar path . |
| 131 | .It Ic lcd Ar path |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 132 | Change local directory to |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 133 | .Ar path . |
| 134 | .It Ic chgrp Ar grp Ar path |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 135 | Change group of file |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 136 | .Ar path |
| 137 | to |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 138 | .Ar grp . |
| 139 | .Ar grp |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 140 | must be a numeric GID. |
| 141 | .It Ic chmod Ar mode Ar path |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 142 | Change permissions of file |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 143 | .Ar path |
| 144 | to |
| 145 | .Ar mode . |
| 146 | .It Ic chown Ar own Ar path |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 147 | Change owner of file |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 148 | .Ar path |
| 149 | to |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 150 | .Ar own . |
| 151 | .Ar own |
| 152 | must be a numeric UID. |
Ben Lindstrom | c9b6eab | 2001-03-07 01:29:17 +0000 | [diff] [blame] | 153 | .It Ic exit |
| 154 | Quit sftp. |
Ben Lindstrom | 9d4f2c8 | 2001-02-15 03:22:45 +0000 | [diff] [blame] | 155 | .It Xo Ic get |
| 156 | .Op Ar flags |
| 157 | .Ar remote-path |
| 158 | .Op Ar local-path |
| 159 | .Xc |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 160 | Retrieve the |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 161 | .Ar remote-path |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 162 | and store it on the local machine. |
| 163 | If the local |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 164 | path name is not specified, it is given the same name it has on the |
| 165 | remote machine. If the |
Ben Lindstrom | 9d4f2c8 | 2001-02-15 03:22:45 +0000 | [diff] [blame] | 166 | .Fl P |
| 167 | flag is specified, then the file's full permission and access time are |
| 168 | copied too. |
Ben Lindstrom | c9b6eab | 2001-03-07 01:29:17 +0000 | [diff] [blame] | 169 | .It Ic help |
| 170 | Display help text. |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 171 | .It Ic lls Op Ar ls-options Op Ar path |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 172 | Display local directory listing of either |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 173 | .Ar path |
| 174 | or current directory if |
| 175 | .Ar path |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 176 | is not specified. |
| 177 | .It Ic lmkdir Ar path |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 178 | Create local directory specified by |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 179 | .Ar path . |
Damien Miller | 058316f | 2001-03-08 10:08:49 +1100 | [diff] [blame] | 180 | .It Ic ln Ar oldpath Ar newpath |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 181 | Create a symbolic link from |
Damien Miller | 058316f | 2001-03-08 10:08:49 +1100 | [diff] [blame] | 182 | .Ar oldpath |
| 183 | to |
| 184 | .Ar newpath . |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 185 | .It Ic lpwd |
| 186 | Print local working directory. |
| 187 | .It Ic ls Op Ar path |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 188 | Display remote directory listing of either |
| 189 | .Ar path |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 190 | or current directory if |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 191 | .Ar path |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 192 | is not specified. |
| 193 | .It Ic lumask Ar umask |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 194 | Set local umask to |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 195 | .Ar umask . |
| 196 | .It Ic mkdir Ar path |
| 197 | Create remote directory specified by |
| 198 | .Ar path . |
Ben Lindstrom | 9d4f2c8 | 2001-02-15 03:22:45 +0000 | [diff] [blame] | 199 | .It Xo Ic put |
| 200 | .Op Ar flags |
| 201 | .Ar local-path |
| 202 | .Op Ar local-path |
| 203 | .Xc |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 204 | Upload |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 205 | .Ar local-path |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 206 | and store it on the remote machine. If the remote path name is not |
| 207 | specified, it is given the same name it has on the local machine. If the |
Ben Lindstrom | 9d4f2c8 | 2001-02-15 03:22:45 +0000 | [diff] [blame] | 208 | .Fl P |
| 209 | flag is specified, then the file's full permission and access time are |
| 210 | copied too. |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 211 | .It Ic pwd |
| 212 | Display remote working directory. |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 213 | .It Ic quit |
| 214 | Quit sftp. |
| 215 | .It Ic rename Ar oldpath Ar newpath |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 216 | Rename remote file from |
| 217 | .Ar oldpath |
| 218 | to |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 219 | .Ar newpath . |
| 220 | .It Ic rmdir Ar path |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 221 | Remove remote directory specified by |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 222 | .Ar path . |
| 223 | .It Ic rm Ar path |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 224 | Delete remote file specified by |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 225 | .Ar path . |
Damien Miller | 058316f | 2001-03-08 10:08:49 +1100 | [diff] [blame] | 226 | .It Ic symlink Ar oldpath Ar newpath |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 227 | Create a symbolic link from |
Damien Miller | 058316f | 2001-03-08 10:08:49 +1100 | [diff] [blame] | 228 | .Ar oldpath |
| 229 | to |
| 230 | .Ar newpath . |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 231 | .It Ic ! Ar command |
Ben Lindstrom | 2464322 | 2001-06-25 05:08:11 +0000 | [diff] [blame] | 232 | Execute |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 233 | .Ar command |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 234 | in local shell. |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 235 | .It Ic ! |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 236 | Escape to local shell. |
| 237 | .It Ic ? |
| 238 | Synonym for help. |
| 239 | .El |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 240 | .Sh AUTHORS |
| 241 | Damien Miller <djm@mindrot.org> |
| 242 | .Sh SEE ALSO |
Ben Lindstrom | 160ec62 | 2001-04-22 17:17:46 +0000 | [diff] [blame] | 243 | .Xr scp 1 , |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 244 | .Xr ssh 1 , |
| 245 | .Xr ssh-add 1 , |
| 246 | .Xr ssh-keygen 1 , |
Ben Lindstrom | 160ec62 | 2001-04-22 17:17:46 +0000 | [diff] [blame] | 247 | .Xr sftp-server 8 , |
| 248 | .Xr sshd 8 |
| 249 | .Rs |
Ben Lindstrom | 90fd060 | 2001-06-25 04:45:33 +0000 | [diff] [blame] | 250 | .%A T. Ylonen |
| 251 | .%A S. Lehtinen |
Ben Lindstrom | 160ec62 | 2001-04-22 17:17:46 +0000 | [diff] [blame] | 252 | .%T "SSH File Transfer Protocol" |
| 253 | .%N draft-ietf-secsh-filexfer-00.txt |
| 254 | .%D January 2001 |
| 255 | .%O work in progress material |
| 256 | .Re |