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