]>
Commit | Line | Data |
---|---|---|
38539909 | 1 | .\" $OpenBSD: sftp.1,v 1.23 2001/08/14 17:54:29 stevesk Exp $ |
61e96248 | 2 | .\" |
f3c7c613 | 3 | .\" Copyright (c) 2001 Damien Miller. All rights reserved. |
61e96248 | 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 | .\" | |
317611b5 | 25 | .Dd February 4, 2001 |
61e96248 | 26 | .Dt SFTP 1 |
27 | .Os | |
28 | .Sh NAME | |
29 | .Nm sftp | |
e68225b2 | 30 | .Nd Secure file transfer program |
61e96248 | 31 | .Sh SYNOPSIS |
32 | .Nm sftp | |
0426a3b4 | 33 | .Op Fl vC |
a5ec8a3d | 34 | .Op Fl b Ar batchfile |
61e96248 | 35 | .Op Fl o Ar ssh_option |
edeeab1e | 36 | .Op Ar host |
37 | .Nm sftp | |
38 | .Op [\fIuser\fR@]\fIhost\fR[:\fIfile\fR [\fIfile\fR]] | |
39 | .Nm sftp | |
3730bb22 | 40 | .Op [\fIuser\fR@]\fIhost\fR[:\fIdir\fR[\fI/\fR]] |
61e96248 | 41 | .Sh DESCRIPTION |
42 | .Nm | |
43 | is an interactive file transfer program, similar to | |
44 | .Xr ftp 1 , | |
45 | which performs all operations over an encrypted | |
46 | .Xr ssh 1 | |
47 | transport. | |
48 | It may also use many features of ssh, such as public key authentication and | |
49 | compression. | |
50 | .Nm | |
51 | connects and logs into the specified | |
cf7ff074 | 52 | .Ar host , |
61e96248 | 53 | then enters an interactive command mode. |
54 | .Pp | |
3730bb22 | 55 | The second usage format will retrieve files automatically if a non-interactive |
cf7ff074 | 56 | authentication method is used; otherwise it will do so after |
57 | successful interactive authentication. | |
edeeab1e | 58 | .Pp |
59 | The last usage format allows the sftp client to start in a remote directory. | |
60 | .Pp | |
61e96248 | 61 | The options are as follows: |
62 | .Bl -tag -width Ds | |
a5ec8a3d | 63 | .It Fl b Ar batchfile |
64 | Batch mode reads a series of commands from an input | |
acf06a60 | 65 | .Ar batchfile |
a5ec8a3d | 66 | instead of |
acf06a60 | 67 | .Em stdin . |
68 | Since it lacks user interaction it should be used in conjunction with | |
69 | non-interactive authentication. | |
70 | .Nm | |
3730bb22 | 71 | will abort if any of the following |
72 | commands fail: | |
acf06a60 | 73 | .Ic get , put , rename , ln , rm , mkdir , chdir , lchdir |
a5ec8a3d | 74 | and |
acf06a60 | 75 | .Ic lmkdir . |
17910dce | 76 | .It Fl C |
3730bb22 | 77 | Enables compression (via ssh's |
17910dce | 78 | .Fl C |
79 | flag) | |
61e96248 | 80 | .It Fl o Ar ssh_option |
38539909 | 81 | Can be used to pass options to |
82 | .Nm ssh | |
83 | in the format used in the | |
84 | .Xr ssh 1 | |
85 | configuration file. This is useful for specifying options | |
86 | for which there is no separate | |
87 | .Nm sftp | |
88 | command-line flag. For example, to force the use of protocol | |
89 | version 1 you may specify | |
90 | .Ic sftp -oProtocol=1 . | |
17910dce | 91 | .It Fl v |
92 | Raise logging level. This option is also passed to ssh. | |
61e96248 | 93 | .El |
94 | .Sh INTERACTIVE COMMANDS | |
0426a3b4 | 95 | Once in interactive mode, |
96 | .Nm | |
3730bb22 | 97 | understands a set of commands similar to those of |
61e96248 | 98 | .Xr ftp 1 . |
a0e6fead | 99 | Commands are case insensitive and pathnames may be enclosed in quotes if they |
100 | contain spaces. | |
61e96248 | 101 | .Bl -tag -width Ds |
68874d2b | 102 | .It Ic bye |
103 | Quit sftp. | |
0426a3b4 | 104 | .It Ic cd Ar path |
3730bb22 | 105 | Change remote directory to |
0426a3b4 | 106 | .Ar path . |
107 | .It Ic lcd Ar path | |
3730bb22 | 108 | Change local directory to |
0426a3b4 | 109 | .Ar path . |
110 | .It Ic chgrp Ar grp Ar path | |
3730bb22 | 111 | Change group of file |
0426a3b4 | 112 | .Ar path |
113 | to | |
61e96248 | 114 | .Ar grp . |
115 | .Ar grp | |
0426a3b4 | 116 | must be a numeric GID. |
117 | .It Ic chmod Ar mode Ar path | |
3730bb22 | 118 | Change permissions of file |
0426a3b4 | 119 | .Ar path |
120 | to | |
121 | .Ar mode . | |
122 | .It Ic chown Ar own Ar path | |
3730bb22 | 123 | Change owner of file |
0426a3b4 | 124 | .Ar path |
125 | to | |
61e96248 | 126 | .Ar own . |
127 | .Ar own | |
128 | must be a numeric UID. | |
17910dce | 129 | .It Ic exit |
130 | Quit sftp. | |
58c54a79 | 131 | .It Xo Ic get |
132 | .Op Ar flags | |
133 | .Ar remote-path | |
134 | .Op Ar local-path | |
135 | .Xc | |
61e96248 | 136 | Retrieve the |
0426a3b4 | 137 | .Ar remote-path |
61e96248 | 138 | and store it on the local machine. |
139 | If the local | |
3730bb22 | 140 | path name is not specified, it is given the same name it has on the |
141 | remote machine. If the | |
58c54a79 | 142 | .Fl P |
143 | flag is specified, then the file's full permission and access time are | |
144 | copied too. | |
17910dce | 145 | .It Ic help |
146 | Display help text. | |
0426a3b4 | 147 | .It Ic lls Op Ar ls-options Op Ar path |
3730bb22 | 148 | Display local directory listing of either |
61e96248 | 149 | .Ar path |
150 | or current directory if | |
151 | .Ar path | |
0426a3b4 | 152 | is not specified. |
153 | .It Ic lmkdir Ar path | |
61e96248 | 154 | Create local directory specified by |
0426a3b4 | 155 | .Ar path . |
3a7fe5ba | 156 | .It Ic ln Ar oldpath Ar newpath |
3730bb22 | 157 | Create a symbolic link from |
3a7fe5ba | 158 | .Ar oldpath |
159 | to | |
160 | .Ar newpath . | |
0426a3b4 | 161 | .It Ic lpwd |
162 | Print local working directory. | |
163 | .It Ic ls Op Ar path | |
61e96248 | 164 | Display remote directory listing of either |
165 | .Ar path | |
0426a3b4 | 166 | or current directory if |
167 | .Ar path | |
168 | is not specified. | |
169 | .It Ic lumask Ar umask | |
3730bb22 | 170 | Set local umask to |
0426a3b4 | 171 | .Ar umask . |
172 | .It Ic mkdir Ar path | |
61e96248 | 173 | Create remote directory specified by |
0426a3b4 | 174 | .Ar path . |
58c54a79 | 175 | .It Xo Ic put |
176 | .Op Ar flags | |
177 | .Ar local-path | |
178 | .Op Ar local-path | |
179 | .Xc | |
61e96248 | 180 | Upload |
0426a3b4 | 181 | .Ar local-path |
3730bb22 | 182 | and store it on the remote machine. If the remote path name is not |
183 | specified, it is given the same name it has on the local machine. If the | |
58c54a79 | 184 | .Fl P |
185 | flag is specified, then the file's full permission and access time are | |
186 | copied too. | |
0426a3b4 | 187 | .It Ic pwd |
188 | Display remote working directory. | |
0426a3b4 | 189 | .It Ic quit |
190 | Quit sftp. | |
191 | .It Ic rename Ar oldpath Ar newpath | |
61e96248 | 192 | Rename remote file from |
193 | .Ar oldpath | |
194 | to | |
0426a3b4 | 195 | .Ar newpath . |
196 | .It Ic rmdir Ar path | |
61e96248 | 197 | Remove remote directory specified by |
0426a3b4 | 198 | .Ar path . |
199 | .It Ic rm Ar path | |
61e96248 | 200 | Delete remote file specified by |
0426a3b4 | 201 | .Ar path . |
3a7fe5ba | 202 | .It Ic symlink Ar oldpath Ar newpath |
3730bb22 | 203 | Create a symbolic link from |
3a7fe5ba | 204 | .Ar oldpath |
205 | to | |
206 | .Ar newpath . | |
61e96248 | 207 | .It Ic ! Ar command |
3730bb22 | 208 | Execute |
61e96248 | 209 | .Ar command |
0426a3b4 | 210 | in local shell. |
61e96248 | 211 | .It Ic ! |
0426a3b4 | 212 | Escape to local shell. |
213 | .It Ic ? | |
214 | Synonym for help. | |
215 | .El | |
61e96248 | 216 | .Sh AUTHORS |
217 | Damien Miller <djm@mindrot.org> | |
218 | .Sh SEE ALSO | |
2cad6cef | 219 | .Xr scp 1 , |
61e96248 | 220 | .Xr ssh 1 , |
221 | .Xr ssh-add 1 , | |
222 | .Xr ssh-keygen 1 , | |
2cad6cef | 223 | .Xr sftp-server 8 , |
224 | .Xr sshd 8 | |
225 | .Rs | |
7b518233 | 226 | .%A T. Ylonen |
227 | .%A S. Lehtinen | |
2cad6cef | 228 | .%T "SSH File Transfer Protocol" |
229 | .%N draft-ietf-secsh-filexfer-00.txt | |
230 | .%D January 2001 | |
231 | .%O work in progress material | |
232 | .Re |