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