summaryrefslogtreecommitdiff
path: root/sftp.0
diff options
context:
space:
mode:
Diffstat (limited to 'sftp.0')
-rw-r--r--sftp.0381
1 files changed, 381 insertions, 0 deletions
diff --git a/sftp.0 b/sftp.0
new file mode 100644
index 000000000..e37043455
--- /dev/null
+++ b/sftp.0
@@ -0,0 +1,381 @@
1SFTP(1) General Commands Manual SFTP(1)
2
3NAME
4 sftp - secure file transfer program
5
6SYNOPSIS
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
15DESCRIPTION
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 `-' 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 `-' 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 ChallengeResponseAuthentication
112 CheckHostIP
113 Cipher
114 Ciphers
115 Compression
116 CompressionLevel
117 ConnectionAttempts
118 ConnectTimeout
119 ControlMaster
120 ControlPath
121 ControlPersist
122 GlobalKnownHostsFile
123 GSSAPIAuthentication
124 GSSAPIDelegateCredentials
125 HashKnownHosts
126 Host
127 HostbasedAuthentication
128 HostKeyAlgorithms
129 HostKeyAlias
130 HostName
131 IdentityFile
132 IdentitiesOnly
133 IPQoS
134 KbdInteractiveAuthentication
135 KbdInteractiveDevices
136 KexAlgorithms
137 LogLevel
138 MACs
139 NoHostAuthenticationForLocalhost
140 NumberOfPasswordPrompts
141 PasswordAuthentication
142 PKCS11Provider
143 Port
144 PreferredAuthentications
145 Protocol
146 ProxyCommand
147 PubkeyAuthentication
148 RekeyLimit
149 RhostsRSAAuthentication
150 RSAAuthentication
151 SendEnv
152 ServerAliveInterval
153 ServerAliveCountMax
154 StrictHostKeyChecking
155 TCPKeepAlive
156 UsePrivilegedPort
157 User
158 UserKnownHostsFile
159 VerifyHostKeyDNS
160
161 -P port
162 Specifies the port to connect to on the remote host.
163
164 -p Preserves modification times, access times, and modes from the
165 original files transferred.
166
167 -q Quiet mode: disables the progress meter as well as warning and
168 diagnostic messages from ssh(1).
169
170 -R num_requests
171 Specify how many requests may be outstanding at any one time.
172 Increasing this may slightly improve file transfer speed but will
173 increase memory usage. The default is 64 outstanding requests.
174
175 -r Recursively copy entire directories when uploading and
176 downloading. Note that sftp does not follow symbolic links
177 encountered in the tree traversal.
178
179 -S program
180 Name of the program to use for the encrypted connection. The
181 program must understand ssh(1) options.
182
183 -s subsystem | sftp_server
184 Specifies the SSH2 subsystem or the path for an sftp server on
185 the remote host. A path is useful for using sftp over protocol
186 version 1, or when the remote sshd(8) does not have an sftp
187 subsystem configured.
188
189 -v Raise logging level. This option is also passed to ssh.
190
191INTERACTIVE COMMANDS
192 Once in interactive mode, sftp understands a set of commands similar to
193 those of ftp(1). Commands are case insensitive. Pathnames that contain
194 spaces must be enclosed in quotes. Any special characters contained
195 within pathnames that are recognized by glob(3) must be escaped with
196 backslashes (`\').
197
198 bye Quit sftp.
199
200 cd path
201 Change remote directory to path.
202
203 chgrp grp path
204 Change group of file path to grp. path may contain glob(3)
205 characters and may match multiple files. grp must be a numeric
206 GID.
207
208 chmod mode path
209 Change permissions of file path to mode. path may contain
210 glob(3) characters and may match multiple files.
211
212 chown own path
213 Change owner of file path to own. path may contain glob(3)
214 characters and may match multiple files. own must be a numeric
215 UID.
216
217 df [-hi] [path]
218 Display usage information for the filesystem holding the current
219 directory (or path if specified). If the -h flag is specified,
220 the capacity information will be displayed using "human-readable"
221 suffixes. The -i flag requests display of inode information in
222 addition to capacity information. This command is only supported
223 on servers that implement the ``statvfs@openssh.com'' extension.
224
225 exit Quit sftp.
226
227 get [-afPpr] remote-path [local-path]
228 Retrieve the remote-path and store it on the local machine. If
229 the local path name is not specified, it is given the same name
230 it has on the remote machine. remote-path may contain glob(3)
231 characters and may match multiple files. If it does and
232 local-path is specified, then local-path must specify a
233 directory.
234
235 If the -a flag is specified, then attempt to resume partial
236 transfers of existing files. Note that resumption assumes that
237 any partial copy of the local file matches the remote copy. If
238 the remote file contents differ from the partial local copy then
239 the resultant file is likely to be corrupt.
240
241 If the -f flag is specified, then fsync(2) will be called after
242 the file transfer has completed to flush the file to disk.
243
244 If either the -P or -p flag is specified, then full file
245 permissions and access times are copied too.
246
247 If the -r flag is specified then directories will be copied
248 recursively. Note that sftp does not follow symbolic links when
249 performing recursive transfers.
250
251 help Display help text.
252
253 lcd path
254 Change local directory to path.
255
256 lls [ls-options [path]]
257 Display local directory listing of either path or current
258 directory if path is not specified. ls-options may contain any
259 flags supported by the local system's ls(1) command. path may
260 contain glob(3) characters and may match multiple files.
261
262 lmkdir path
263 Create local directory specified by path.
264
265 ln [-s] oldpath newpath
266 Create a link from oldpath to newpath. If the -s flag is
267 specified the created link is a symbolic link, otherwise it is a
268 hard link.
269
270 lpwd Print local working directory.
271
272 ls [-1afhlnrSt] [path]
273 Display a remote directory listing of either path or the current
274 directory if path is not specified. path may contain glob(3)
275 characters and may match multiple files.
276
277 The following flags are recognized and alter the behaviour of ls
278 accordingly:
279
280 -1 Produce single columnar output.
281
282 -a List files beginning with a dot (`.').
283
284 -f Do not sort the listing. The default sort order is
285 lexicographical.
286
287 -h When used with a long format option, use unit suffixes:
288 Byte, Kilobyte, Megabyte, Gigabyte, Terabyte, Petabyte,
289 and Exabyte in order to reduce the number of digits to
290 four or fewer using powers of 2 for sizes (K=1024,
291 M=1048576, etc.).
292
293 -l Display additional details including permissions and
294 ownership information.
295
296 -n Produce a long listing with user and group information
297 presented numerically.
298
299 -r Reverse the sort order of the listing.
300
301 -S Sort the listing by file size.
302
303 -t Sort the listing by last modification time.
304
305 lumask umask
306 Set local umask to umask.
307
308 mkdir path
309 Create remote directory specified by path.
310
311 progress
312 Toggle display of progress meter.
313
314 put [-afPpr] local-path [remote-path]
315 Upload local-path and store it on the remote machine. If the
316 remote path name is not specified, it is given the same name it
317 has on the local machine. local-path may contain glob(3)
318 characters and may match multiple files. If it does and
319 remote-path is specified, then remote-path must specify a
320 directory.
321
322 If the -a flag is specified, then attempt to resume partial
323 transfers of existing files. Note that resumption assumes that
324 any partial copy of the remote file matches the local copy. If
325 the local file contents differ from the remote local copy then
326 the resultant file is likely to be corrupt.
327
328 If the -f flag is specified, then a request will be sent to the
329 server to call fsync(2) after the file has been transferred.
330 Note that this is only supported by servers that implement the
331 "fsync@openssh.com" extension.
332
333 If either the -P or -p flag is specified, then full file
334 permissions and access times are copied too.
335
336 If the -r flag is specified then directories will be copied
337 recursively. Note that sftp does not follow symbolic links when
338 performing recursive transfers.
339
340 pwd Display remote working directory.
341
342 quit Quit sftp.
343
344 reget [-Ppr] remote-path [local-path]
345 Resume download of remote-path. Equivalent to get with the -a
346 flag set.
347
348 reput [-Ppr] [local-path] remote-path
349 Resume upload of [local-path]. Equivalent to put with the -a
350 flag set.
351
352 rename oldpath newpath
353 Rename remote file from oldpath to newpath.
354
355 rm path
356 Delete remote file specified by path.
357
358 rmdir path
359 Remove remote directory specified by path.
360
361 symlink oldpath newpath
362 Create a symbolic link from oldpath to newpath.
363
364 version
365 Display the sftp protocol version.
366
367 !command
368 Execute command in local shell.
369
370 ! Escape to local shell.
371
372 ? Synonym for help.
373
374SEE ALSO
375 ftp(1), ls(1), scp(1), ssh(1), ssh-add(1), ssh-keygen(1), glob(3),
376 ssh_config(5), sftp-server(8), sshd(8)
377
378 T. Ylonen and S. Lehtinen, SSH File Transfer Protocol, draft-ietf-secsh-
379 filexfer-00.txt, January 2001, work in progress material.
380
381OpenBSD 5.6 April 22, 2014 OpenBSD 5.6