diff options
Diffstat (limited to 'sftp.0')
-rw-r--r-- | sftp.0 | 384 |
1 files changed, 384 insertions, 0 deletions
@@ -0,0 +1,384 @@ | |||
1 | SFTP(1) General Commands Manual SFTP(1) | ||
2 | |||
3 | NAME | ||
4 | sftp M-bM-^@M-^S secure file transfer program | ||
5 | |||
6 | SYNOPSIS | ||
7 | sftp [-1246aCfpqrv] [-B buffer_size] [-b batchfile] [-c cipher] | ||
8 | [-D sftp_server_path] [-F ssh_config] [-i identity_file] [-l limit] | ||
9 | [-o ssh_option] [-P port] [-R num_requests] [-S program] | ||
10 | [-s subsystem | sftp_server] host | ||
11 | sftp [user@]host[:file ...] | ||
12 | sftp [user@]host[:dir[/]] | ||
13 | sftp -b batchfile [user@]host | ||
14 | |||
15 | DESCRIPTION | ||
16 | sftp is an interactive file transfer program, similar to ftp(1), which | ||
17 | performs all operations over an encrypted ssh(1) transport. It may also | ||
18 | use many features of ssh, such as public key authentication and | ||
19 | compression. sftp connects and logs into the specified host, then enters | ||
20 | an interactive command mode. | ||
21 | |||
22 | The second usage format will retrieve files automatically if a non- | ||
23 | interactive authentication method is used; otherwise it will do so after | ||
24 | successful interactive authentication. | ||
25 | |||
26 | The third usage format allows sftp to start in a remote directory. | ||
27 | |||
28 | The final usage format allows for automated sessions using the -b option. | ||
29 | In such cases, it is necessary to configure non-interactive | ||
30 | authentication to obviate the need to enter a password at connection time | ||
31 | (see sshd(8) and ssh-keygen(1) for details). | ||
32 | |||
33 | Since some usage formats use colon characters to delimit host names from | ||
34 | path names, IPv6 addresses must be enclosed in square brackets to avoid | ||
35 | ambiguity. | ||
36 | |||
37 | The options are as follows: | ||
38 | |||
39 | -1 Specify the use of protocol version 1. | ||
40 | |||
41 | -2 Specify the use of protocol version 2. | ||
42 | |||
43 | -4 Forces sftp to use IPv4 addresses only. | ||
44 | |||
45 | -6 Forces sftp to use IPv6 addresses only. | ||
46 | |||
47 | -a Attempt to continue interrupted transfers rather than overwriting | ||
48 | existing partial or complete copies of files. If the partial | ||
49 | contents differ from those being transferred, then the resultant | ||
50 | file is likely to be corrupt. | ||
51 | |||
52 | -B buffer_size | ||
53 | Specify the size of the buffer that sftp uses when transferring | ||
54 | files. Larger buffers require fewer round trips at the cost of | ||
55 | higher memory consumption. The default is 32768 bytes. | ||
56 | |||
57 | -b batchfile | ||
58 | Batch mode reads a series of commands from an input batchfile | ||
59 | instead of stdin. Since it lacks user interaction it should be | ||
60 | used in conjunction with non-interactive authentication. A | ||
61 | batchfile of M-bM-^@M-^X-M-bM-^@M-^Y may be used to indicate standard input. sftp | ||
62 | will abort if any of the following commands fail: get, put, | ||
63 | reget, reput, rename, ln, rm, mkdir, chdir, ls, lchdir, chmod, | ||
64 | chown, chgrp, lpwd, df, symlink, and lmkdir. Termination on | ||
65 | error can be suppressed on a command by command basis by | ||
66 | prefixing the command with a M-bM-^@M-^X-M-bM-^@M-^Y character (for example, -rm | ||
67 | /tmp/blah*). | ||
68 | |||
69 | -C Enables compression (via ssh's -C flag). | ||
70 | |||
71 | -c cipher | ||
72 | Selects the cipher to use for encrypting the data transfers. | ||
73 | This option is directly passed to ssh(1). | ||
74 | |||
75 | -D sftp_server_path | ||
76 | Connect directly to a local sftp server (rather than via ssh(1)). | ||
77 | This option may be useful in debugging the client and server. | ||
78 | |||
79 | -F ssh_config | ||
80 | Specifies an alternative per-user configuration file for ssh(1). | ||
81 | This option is directly passed to ssh(1). | ||
82 | |||
83 | -f Requests that files be flushed to disk immediately after | ||
84 | transfer. When uploading files, this feature is only enabled if | ||
85 | the server implements the "fsync@openssh.com" extension. | ||
86 | |||
87 | -i identity_file | ||
88 | Selects the file from which the identity (private key) for public | ||
89 | key authentication is read. This option is directly passed to | ||
90 | ssh(1). | ||
91 | |||
92 | -l limit | ||
93 | Limits the used bandwidth, specified in Kbit/s. | ||
94 | |||
95 | -o ssh_option | ||
96 | Can be used to pass options to ssh in the format used in | ||
97 | ssh_config(5). This is useful for specifying options for which | ||
98 | there is no separate sftp command-line flag. For example, to | ||
99 | specify an alternate port use: sftp -oPort=24. For full details | ||
100 | of the options listed below, and their possible values, see | ||
101 | ssh_config(5). | ||
102 | |||
103 | AddressFamily | ||
104 | BatchMode | ||
105 | BindAddress | ||
106 | CanonicalDomains | ||
107 | CanonicalizeFallbackLocal | ||
108 | CanonicalizeHostname | ||
109 | CanonicalizeMaxDots | ||
110 | CanonicalizePermittedCNAMEs | ||
111 | CertificateFile | ||
112 | ChallengeResponseAuthentication | ||
113 | CheckHostIP | ||
114 | Cipher | ||
115 | Ciphers | ||
116 | Compression | ||
117 | CompressionLevel | ||
118 | ConnectionAttempts | ||
119 | ConnectTimeout | ||
120 | ControlMaster | ||
121 | ControlPath | ||
122 | ControlPersist | ||
123 | GlobalKnownHostsFile | ||
124 | GSSAPIAuthentication | ||
125 | GSSAPIDelegateCredentials | ||
126 | HashKnownHosts | ||
127 | Host | ||
128 | HostbasedAuthentication | ||
129 | HostbasedKeyTypes | ||
130 | HostKeyAlgorithms | ||
131 | HostKeyAlias | ||
132 | HostName | ||
133 | IdentityFile | ||
134 | IdentitiesOnly | ||
135 | IPQoS | ||
136 | KbdInteractiveAuthentication | ||
137 | KbdInteractiveDevices | ||
138 | KexAlgorithms | ||
139 | LogLevel | ||
140 | MACs | ||
141 | NoHostAuthenticationForLocalhost | ||
142 | NumberOfPasswordPrompts | ||
143 | PasswordAuthentication | ||
144 | PKCS11Provider | ||
145 | Port | ||
146 | PreferredAuthentications | ||
147 | Protocol | ||
148 | ProxyCommand | ||
149 | PubkeyAuthentication | ||
150 | RekeyLimit | ||
151 | RhostsRSAAuthentication | ||
152 | RSAAuthentication | ||
153 | SendEnv | ||
154 | ServerAliveInterval | ||
155 | ServerAliveCountMax | ||
156 | StrictHostKeyChecking | ||
157 | TCPKeepAlive | ||
158 | UpdateHostKeys | ||
159 | UsePrivilegedPort | ||
160 | User | ||
161 | UserKnownHostsFile | ||
162 | VerifyHostKeyDNS | ||
163 | |||
164 | -P port | ||
165 | Specifies the port to connect to on the remote host. | ||
166 | |||
167 | -p Preserves modification times, access times, and modes from the | ||
168 | original files transferred. | ||
169 | |||
170 | -q Quiet mode: disables the progress meter as well as warning and | ||
171 | diagnostic messages from ssh(1). | ||
172 | |||
173 | -R num_requests | ||
174 | Specify how many requests may be outstanding at any one time. | ||
175 | Increasing this may slightly improve file transfer speed but will | ||
176 | increase memory usage. The default is 64 outstanding requests. | ||
177 | |||
178 | -r Recursively copy entire directories when uploading and | ||
179 | downloading. Note that sftp does not follow symbolic links | ||
180 | encountered in the tree traversal. | ||
181 | |||
182 | -S program | ||
183 | Name of the program to use for the encrypted connection. The | ||
184 | program must understand ssh(1) options. | ||
185 | |||
186 | -s subsystem | sftp_server | ||
187 | Specifies the SSH2 subsystem or the path for an sftp server on | ||
188 | the remote host. A path is useful for using sftp over protocol | ||
189 | version 1, or when the remote sshd(8) does not have an sftp | ||
190 | subsystem configured. | ||
191 | |||
192 | -v Raise logging level. This option is also passed to ssh. | ||
193 | |||
194 | INTERACTIVE COMMANDS | ||
195 | Once in interactive mode, sftp understands a set of commands similar to | ||
196 | those of ftp(1). Commands are case insensitive. Pathnames that contain | ||
197 | spaces must be enclosed in quotes. Any special characters contained | ||
198 | within pathnames that are recognized by glob(3) must be escaped with | ||
199 | backslashes (M-bM-^@M-^X\M-bM-^@M-^Y). | ||
200 | |||
201 | bye Quit sftp. | ||
202 | |||
203 | cd path | ||
204 | Change remote directory to path. | ||
205 | |||
206 | chgrp grp path | ||
207 | Change group of file path to grp. path may contain glob(3) | ||
208 | characters and may match multiple files. grp must be a numeric | ||
209 | GID. | ||
210 | |||
211 | chmod mode path | ||
212 | Change permissions of file path to mode. path may contain | ||
213 | glob(3) characters and may match multiple files. | ||
214 | |||
215 | chown own path | ||
216 | Change owner of file path to own. path may contain glob(3) | ||
217 | characters and may match multiple files. own must be a numeric | ||
218 | UID. | ||
219 | |||
220 | df [-hi] [path] | ||
221 | Display usage information for the filesystem holding the current | ||
222 | directory (or path if specified). If the -h flag is specified, | ||
223 | the capacity information will be displayed using "human-readable" | ||
224 | suffixes. The -i flag requests display of inode information in | ||
225 | addition to capacity information. This command is only supported | ||
226 | on servers that implement the M-bM-^@M-^\statvfs@openssh.comM-bM-^@M-^] extension. | ||
227 | |||
228 | exit Quit sftp. | ||
229 | |||
230 | get [-afPpr] remote-path [local-path] | ||
231 | Retrieve the remote-path and store it on the local machine. If | ||
232 | the local path name is not specified, it is given the same name | ||
233 | it has on the remote machine. remote-path may contain glob(3) | ||
234 | characters and may match multiple files. If it does and | ||
235 | local-path is specified, then local-path must specify a | ||
236 | directory. | ||
237 | |||
238 | If the -a flag is specified, then attempt to resume partial | ||
239 | transfers of existing files. Note that resumption assumes that | ||
240 | any partial copy of the local file matches the remote copy. If | ||
241 | the remote file contents differ from the partial local copy then | ||
242 | the resultant file is likely to be corrupt. | ||
243 | |||
244 | If the -f flag is specified, then fsync(2) will be called after | ||
245 | the file transfer has completed to flush the file to disk. | ||
246 | |||
247 | If either the -P or -p flag is specified, then full file | ||
248 | permissions and access times are copied too. | ||
249 | |||
250 | If the -r flag is specified then directories will be copied | ||
251 | recursively. Note that sftp does not follow symbolic links when | ||
252 | performing recursive transfers. | ||
253 | |||
254 | help Display help text. | ||
255 | |||
256 | lcd path | ||
257 | Change local directory to path. | ||
258 | |||
259 | lls [ls-options [path]] | ||
260 | Display local directory listing of either path or current | ||
261 | directory if path is not specified. ls-options may contain any | ||
262 | flags supported by the local system's ls(1) command. path may | ||
263 | contain glob(3) characters and may match multiple files. | ||
264 | |||
265 | lmkdir path | ||
266 | Create local directory specified by path. | ||
267 | |||
268 | ln [-s] oldpath newpath | ||
269 | Create a link from oldpath to newpath. If the -s flag is | ||
270 | specified the created link is a symbolic link, otherwise it is a | ||
271 | hard link. | ||
272 | |||
273 | lpwd Print local working directory. | ||
274 | |||
275 | ls [-1afhlnrSt] [path] | ||
276 | Display a remote directory listing of either path or the current | ||
277 | directory if path is not specified. path may contain glob(3) | ||
278 | characters and may match multiple files. | ||
279 | |||
280 | The following flags are recognized and alter the behaviour of ls | ||
281 | accordingly: | ||
282 | |||
283 | -1 Produce single columnar output. | ||
284 | |||
285 | -a List files beginning with a dot (M-bM-^@M-^X.M-bM-^@M-^Y). | ||
286 | |||
287 | -f Do not sort the listing. The default sort order is | ||
288 | lexicographical. | ||
289 | |||
290 | -h When used with a long format option, use unit suffixes: | ||
291 | Byte, Kilobyte, Megabyte, Gigabyte, Terabyte, Petabyte, | ||
292 | and Exabyte in order to reduce the number of digits to | ||
293 | four or fewer using powers of 2 for sizes (K=1024, | ||
294 | M=1048576, etc.). | ||
295 | |||
296 | -l Display additional details including permissions and | ||
297 | ownership information. | ||
298 | |||
299 | -n Produce a long listing with user and group information | ||
300 | presented numerically. | ||
301 | |||
302 | -r Reverse the sort order of the listing. | ||
303 | |||
304 | -S Sort the listing by file size. | ||
305 | |||
306 | -t Sort the listing by last modification time. | ||
307 | |||
308 | lumask umask | ||
309 | Set local umask to umask. | ||
310 | |||
311 | mkdir path | ||
312 | Create remote directory specified by path. | ||
313 | |||
314 | progress | ||
315 | Toggle display of progress meter. | ||
316 | |||
317 | put [-afPpr] local-path [remote-path] | ||
318 | Upload local-path and store it on the remote machine. If the | ||
319 | remote path name is not specified, it is given the same name it | ||
320 | has on the local machine. local-path may contain glob(3) | ||
321 | characters and may match multiple files. If it does and | ||
322 | remote-path is specified, then remote-path must specify a | ||
323 | directory. | ||
324 | |||
325 | If the -a flag is specified, then attempt to resume partial | ||
326 | transfers of existing files. Note that resumption assumes that | ||
327 | any partial copy of the remote file matches the local copy. If | ||
328 | the local file contents differ from the remote local copy then | ||
329 | the resultant file is likely to be corrupt. | ||
330 | |||
331 | If the -f flag is specified, then a request will be sent to the | ||
332 | server to call fsync(2) after the file has been transferred. | ||
333 | Note that this is only supported by servers that implement the | ||
334 | "fsync@openssh.com" extension. | ||
335 | |||
336 | If either the -P or -p flag is specified, then full file | ||
337 | permissions and access times are copied too. | ||
338 | |||
339 | If the -r flag is specified then directories will be copied | ||
340 | recursively. Note that sftp does not follow symbolic links when | ||
341 | performing recursive transfers. | ||
342 | |||
343 | pwd Display remote working directory. | ||
344 | |||
345 | quit Quit sftp. | ||
346 | |||
347 | reget [-Ppr] remote-path [local-path] | ||
348 | Resume download of remote-path. Equivalent to get with the -a | ||
349 | flag set. | ||
350 | |||
351 | reput [-Ppr] [local-path] remote-path | ||
352 | Resume upload of [local-path]. Equivalent to put with the -a | ||
353 | flag set. | ||
354 | |||
355 | rename oldpath newpath | ||
356 | Rename remote file from oldpath to newpath. | ||
357 | |||
358 | rm path | ||
359 | Delete remote file specified by path. | ||
360 | |||
361 | rmdir path | ||
362 | Remove remote directory specified by path. | ||
363 | |||
364 | symlink oldpath newpath | ||
365 | Create a symbolic link from oldpath to newpath. | ||
366 | |||
367 | version | ||
368 | Display the sftp protocol version. | ||
369 | |||
370 | !command | ||
371 | Execute command in local shell. | ||
372 | |||
373 | ! Escape to local shell. | ||
374 | |||
375 | ? Synonym for help. | ||
376 | |||
377 | SEE ALSO | ||
378 | ftp(1), ls(1), scp(1), ssh(1), ssh-add(1), ssh-keygen(1), glob(3), | ||
379 | ssh_config(5), sftp-server(8), sshd(8) | ||
380 | |||
381 | T. Ylonen and S. Lehtinen, SSH File Transfer Protocol, draft-ietf-secsh- | ||
382 | filexfer-00.txt, January 2001, work in progress material. | ||
383 | |||
384 | OpenBSD 5.9 September 25, 2015 OpenBSD 5.9 | ||