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