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