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