Ben Lindstrom | 283cb82 | 2001-03-09 00:09:02 +0000 | [diff] [blame] | 1 | .\" $OpenBSD: sftp.1,v 1.13 2001/03/08 20:44:48 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 | .\" |
| 25 | .Dd Febuary 4, 2001 |
| 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 |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 33 | .Op Fl vC |
Ben Lindstrom | 562c26b | 2001-03-07 01:26:48 +0000 | [diff] [blame] | 34 | .Op Fl b Ar batchfile |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 35 | .Op Fl o Ar ssh_option |
| 36 | .Op Ar hostname | user@hostname |
| 37 | .Sh DESCRIPTION |
| 38 | .Nm |
| 39 | is an interactive file transfer program, similar to |
| 40 | .Xr ftp 1 , |
| 41 | which performs all operations over an encrypted |
| 42 | .Xr ssh 1 |
| 43 | transport. |
| 44 | It may also use many features of ssh, such as public key authentication and |
| 45 | compression. |
| 46 | .Nm |
| 47 | connects and logs into the specified |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 48 | .Ar hostname , |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 49 | then enters an interactive command mode. |
| 50 | .Pp |
| 51 | The options are as follows: |
| 52 | .Bl -tag -width Ds |
Ben Lindstrom | 562c26b | 2001-03-07 01:26:48 +0000 | [diff] [blame] | 53 | .It Fl b Ar batchfile |
| 54 | Batch mode reads a series of commands from an input |
Ben Lindstrom | 283cb82 | 2001-03-09 00:09:02 +0000 | [diff] [blame] | 55 | .Ar batchfile |
Ben Lindstrom | 562c26b | 2001-03-07 01:26:48 +0000 | [diff] [blame] | 56 | instead of |
Ben Lindstrom | 283cb82 | 2001-03-09 00:09:02 +0000 | [diff] [blame] | 57 | .Em stdin . |
| 58 | Since it lacks user interaction it should be used in conjunction with |
| 59 | non-interactive authentication. |
| 60 | .Nm |
| 61 | will abort if any of the following |
Ben Lindstrom | 562c26b | 2001-03-07 01:26:48 +0000 | [diff] [blame] | 62 | commands fail: |
Ben Lindstrom | 283cb82 | 2001-03-09 00:09:02 +0000 | [diff] [blame] | 63 | .Ic get , put , rename , ln , rm , mkdir , chdir , lchdir |
Ben Lindstrom | 562c26b | 2001-03-07 01:26:48 +0000 | [diff] [blame] | 64 | and |
Ben Lindstrom | 283cb82 | 2001-03-09 00:09:02 +0000 | [diff] [blame] | 65 | .Ic lmkdir . |
Ben Lindstrom | c9b6eab | 2001-03-07 01:29:17 +0000 | [diff] [blame] | 66 | .It Fl C |
| 67 | Enables compression (via ssh's |
| 68 | .Fl C |
| 69 | flag) |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 70 | .It Fl o Ar ssh_option |
| 71 | Specify an option to be directly passed to |
| 72 | .Xr ssh 1 . |
Ben Lindstrom | c9b6eab | 2001-03-07 01:29:17 +0000 | [diff] [blame] | 73 | .It Fl v |
| 74 | Raise logging level. This option is also passed to ssh. |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 75 | .El |
| 76 | .Sh INTERACTIVE COMMANDS |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 77 | Once in interactive mode, |
| 78 | .Nm |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 79 | understands a set of commands similar to those of |
| 80 | .Xr ftp 1 . |
Ben Lindstrom | 27cb1d0 | 2001-02-10 21:59:35 +0000 | [diff] [blame] | 81 | Commands are case insensitive and pathnames may be enclosed in quotes if they |
| 82 | contain spaces. |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 83 | .Bl -tag -width Ds |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 84 | .It Ic cd Ar path |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 85 | Change remote directory to |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 86 | .Ar path . |
| 87 | .It Ic lcd Ar path |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 88 | Change local directory to |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 89 | .Ar path . |
| 90 | .It Ic chgrp Ar grp Ar path |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 91 | Change group of file |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 92 | .Ar path |
| 93 | to |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 94 | .Ar grp . |
| 95 | .Ar grp |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 96 | must be a numeric GID. |
| 97 | .It Ic chmod Ar mode Ar path |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 98 | Change permissions of file |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 99 | .Ar path |
| 100 | to |
| 101 | .Ar mode . |
| 102 | .It Ic chown Ar own Ar path |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 103 | Change owner of file |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 104 | .Ar path |
| 105 | to |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 106 | .Ar own . |
| 107 | .Ar own |
| 108 | must be a numeric UID. |
Ben Lindstrom | c9b6eab | 2001-03-07 01:29:17 +0000 | [diff] [blame] | 109 | .It Ic exit |
| 110 | Quit sftp. |
Ben Lindstrom | 9d4f2c8 | 2001-02-15 03:22:45 +0000 | [diff] [blame] | 111 | .It Xo Ic get |
| 112 | .Op Ar flags |
| 113 | .Ar remote-path |
| 114 | .Op Ar local-path |
| 115 | .Xc |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 116 | Retrieve the |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 117 | .Ar remote-path |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 118 | and store it on the local machine. |
| 119 | If the local |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 120 | path name is not specified, it is given the same name it has on the |
Ben Lindstrom | 9d4f2c8 | 2001-02-15 03:22:45 +0000 | [diff] [blame] | 121 | remote machine. If the |
| 122 | .Fl P |
| 123 | flag is specified, then the file's full permission and access time are |
| 124 | copied too. |
Ben Lindstrom | c9b6eab | 2001-03-07 01:29:17 +0000 | [diff] [blame] | 125 | .It Ic help |
| 126 | Display help text. |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 127 | .It Ic lls Op Ar ls-options Op Ar path |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 128 | Display local directory listing of either |
| 129 | .Ar path |
| 130 | or current directory if |
| 131 | .Ar path |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 132 | is not specified. |
| 133 | .It Ic lmkdir Ar path |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 134 | Create local directory specified by |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 135 | .Ar path . |
Damien Miller | 058316f | 2001-03-08 10:08:49 +1100 | [diff] [blame] | 136 | .It Ic ln Ar oldpath Ar newpath |
| 137 | Create a symbolic link from |
| 138 | .Ar oldpath |
| 139 | to |
| 140 | .Ar newpath . |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 141 | .It Ic lpwd |
| 142 | Print local working directory. |
| 143 | .It Ic ls Op Ar path |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 144 | Display remote directory listing of either |
| 145 | .Ar path |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 146 | or current directory if |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 147 | .Ar path |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 148 | is not specified. |
| 149 | .It Ic lumask Ar umask |
| 150 | Set local umask to |
| 151 | .Ar umask . |
| 152 | .It Ic mkdir Ar path |
| 153 | Create remote directory specified by |
| 154 | .Ar path . |
Ben Lindstrom | 9d4f2c8 | 2001-02-15 03:22:45 +0000 | [diff] [blame] | 155 | .It Xo Ic put |
| 156 | .Op Ar flags |
| 157 | .Ar local-path |
| 158 | .Op Ar local-path |
| 159 | .Xc |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 160 | Upload |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 161 | .Ar local-path |
Damien Miller | 058316f | 2001-03-08 10:08:49 +1100 | [diff] [blame] | 162 | and store it on the remote machine. If the remote path name is not |
| 163 | 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] | 164 | .Fl P |
| 165 | flag is specified, then the file's full permission and access time are |
| 166 | copied too. |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 167 | .It Ic pwd |
| 168 | Display remote working directory. |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 169 | .It Ic quit |
| 170 | Quit sftp. |
| 171 | .It Ic rename Ar oldpath Ar newpath |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 172 | Rename remote file from |
| 173 | .Ar oldpath |
| 174 | to |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 175 | .Ar newpath . |
| 176 | .It Ic rmdir Ar path |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 177 | Remove remote directory specified by |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 178 | .Ar path . |
| 179 | .It Ic rm Ar path |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 180 | Delete remote file specified by |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 181 | .Ar path . |
Damien Miller | 058316f | 2001-03-08 10:08:49 +1100 | [diff] [blame] | 182 | .It Ic symlink Ar oldpath Ar newpath |
| 183 | Create a symbolic link from |
| 184 | .Ar oldpath |
| 185 | to |
| 186 | .Ar newpath . |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 187 | .It Ic ! Ar command |
| 188 | Execute |
| 189 | .Ar command |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 190 | in local shell. |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 191 | .It Ic ! |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 192 | Escape to local shell. |
| 193 | .It Ic ? |
| 194 | Synonym for help. |
| 195 | .El |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 196 | .Sh AUTHORS |
| 197 | Damien Miller <djm@mindrot.org> |
| 198 | .Sh SEE ALSO |
| 199 | .Xr ssh 1 , |
Ben Lindstrom | 283cb82 | 2001-03-09 00:09:02 +0000 | [diff] [blame] | 200 | .Xr sftp-server 8 , |
Damien Miller | 3380426 | 2001-02-04 23:20:18 +1100 | [diff] [blame] | 201 | .Xr ssh-add 1 , |
| 202 | .Xr ssh-keygen 1 , |
Damien Miller | d7686fd | 2001-02-10 00:40:03 +1100 | [diff] [blame] | 203 | .Xr sshd 8 , |
| 204 | .Xr scp 1 |
| 205 | |