summaryrefslogtreecommitdiff
path: root/sftp.0
diff options
context:
space:
mode:
Diffstat (limited to 'sftp.0')
-rw-r--r--sftp.0377
1 files changed, 377 insertions, 0 deletions
diff --git a/sftp.0 b/sftp.0
new file mode 100644
index 000000000..45b8faf55
--- /dev/null
+++ b/sftp.0
@@ -0,0 +1,377 @@
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] 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 -4 Forces sftp to use IPv4 addresses only.
40
41 -6 Forces sftp to use IPv6 addresses only.
42
43 -a Attempt to continue interrupted transfers rather than overwriting
44 existing partial or complete copies of files. If the partial
45 contents differ from those being transferred, then the resultant
46 file is likely to be corrupt.
47
48 -B buffer_size
49 Specify the size of the buffer that sftp uses when transferring
50 files. Larger buffers require fewer round trips at the cost of
51 higher memory consumption. The default is 32768 bytes.
52
53 -b batchfile
54 Batch mode reads a series of commands from an input batchfile
55 instead of stdin. Since it lacks user interaction it should be
56 used in conjunction with non-interactive authentication. A
57 batchfile of M-bM-^@M-^X-M-bM-^@M-^Y may be used to indicate standard input. sftp
58 will abort if any of the following commands fail: get, put,
59 reget, reput, rename, ln, rm, mkdir, chdir, ls, lchdir, chmod,
60 chown, chgrp, lpwd, df, symlink, and lmkdir. Termination on
61 error can be suppressed on a command by command basis by
62 prefixing the command with a M-bM-^@M-^X-M-bM-^@M-^Y character (for example, -rm
63 /tmp/blah*).
64
65 -C Enables compression (via ssh's -C flag).
66
67 -c cipher
68 Selects the cipher to use for encrypting the data transfers.
69 This option is directly passed to ssh(1).
70
71 -D sftp_server_path
72 Connect directly to a local sftp server (rather than via ssh(1)).
73 This option may be useful in debugging the client and server.
74
75 -F ssh_config
76 Specifies an alternative per-user configuration file for ssh(1).
77 This option is directly passed to ssh(1).
78
79 -f Requests that files be flushed to disk immediately after
80 transfer. When uploading files, this feature is only enabled if
81 the server implements the "fsync@openssh.com" extension.
82
83 -i identity_file
84 Selects the file from which the identity (private key) for public
85 key authentication is read. This option is directly passed to
86 ssh(1).
87
88 -l limit
89 Limits the used bandwidth, specified in Kbit/s.
90
91 -o ssh_option
92 Can be used to pass options to ssh in the format used in
93 ssh_config(5). This is useful for specifying options for which
94 there is no separate sftp command-line flag. For example, to
95 specify an alternate port use: sftp -oPort=24. For full details
96 of the options listed below, and their possible values, see
97 ssh_config(5).
98
99 AddressFamily
100 BatchMode
101 BindAddress
102 CanonicalDomains
103 CanonicalizeFallbackLocal
104 CanonicalizeHostname
105 CanonicalizeMaxDots
106 CanonicalizePermittedCNAMEs
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 StrictHostKeyChecking
151 TCPKeepAlive
152 UpdateHostKeys
153 UsePrivilegedPort
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.
198
199 chgrp grp path
200 Change group of file path to grp. path may contain glob(3)
201 characters and may match multiple files. grp must be a numeric
202 GID.
203
204 chmod mode path
205 Change permissions of file path to mode. path may contain
206 glob(3) characters and may match multiple files.
207
208 chown own path
209 Change owner of file path to own. path may contain glob(3)
210 characters and may match multiple files. own must be a numeric
211 UID.
212
213 df [-hi] [path]
214 Display usage information for the filesystem holding the current
215 directory (or path if specified). If the -h flag is specified,
216 the capacity information will be displayed using "human-readable"
217 suffixes. The -i flag requests display of inode information in
218 addition to capacity information. This command is only supported
219 on servers that implement the M-bM-^@M-^\statvfs@openssh.comM-bM-^@M-^] extension.
220
221 exit Quit sftp.
222
223 get [-afPpr] remote-path [local-path]
224 Retrieve the remote-path and store it on the local machine. If
225 the local path name is not specified, it is given the same name
226 it has on the remote machine. remote-path may contain glob(3)
227 characters and may match multiple files. If it does and
228 local-path is specified, then local-path must specify a
229 directory.
230
231 If the -a flag is specified, then attempt to resume partial
232 transfers of existing files. Note that resumption assumes that
233 any partial copy of the local file matches the remote copy. If
234 the remote file contents differ from the partial local copy then
235 the resultant file is likely to be corrupt.
236
237 If the -f flag is specified, then fsync(2) will be called after
238 the file transfer has completed to flush the file to disk.
239
240 If either the -P or -p flag is specified, then full file
241 permissions and access times are copied too.
242
243 If the -r flag is specified then directories will be copied
244 recursively. Note that sftp does not follow symbolic links when
245 performing recursive transfers.
246
247 help Display help text.
248
249 lcd path
250 Change local directory to path.
251
252 lls [ls-options [path]]
253 Display local directory listing of either path or current
254 directory if path is not specified. ls-options may contain any
255 flags supported by the local system's ls(1) command. path may
256 contain glob(3) characters and may match multiple files.
257
258 lmkdir path
259 Create local directory specified by path.
260
261 ln [-s] oldpath newpath
262 Create a link from oldpath to newpath. If the -s flag is
263 specified the created link is a symbolic link, otherwise it is a
264 hard link.
265
266 lpwd Print local working directory.
267
268 ls [-1afhlnrSt] [path]
269 Display a remote directory listing of either path or the current
270 directory if path is not specified. path may contain glob(3)
271 characters and may match multiple files.
272
273 The following flags are recognized and alter the behaviour of ls
274 accordingly:
275
276 -1 Produce single columnar output.
277
278 -a List files beginning with a dot (M-bM-^@M-^X.M-bM-^@M-^Y).
279
280 -f Do not sort the listing. The default sort order is
281 lexicographical.
282
283 -h When used with a long format option, use unit suffixes:
284 Byte, Kilobyte, Megabyte, Gigabyte, Terabyte, Petabyte,
285 and Exabyte in order to reduce the number of digits to
286 four or fewer using powers of 2 for sizes (K=1024,
287 M=1048576, etc.).
288
289 -l Display additional details including permissions and
290 ownership information.
291
292 -n Produce a long listing with user and group information
293 presented numerically.
294
295 -r Reverse the sort order of the listing.
296
297 -S Sort the listing by file size.
298
299 -t Sort the listing by last modification time.
300
301 lumask umask
302 Set local umask to umask.
303
304 mkdir path
305 Create remote directory specified by path.
306
307 progress
308 Toggle display of progress meter.
309
310 put [-afPpr] local-path [remote-path]
311 Upload local-path and store it on the remote machine. If the
312 remote path name is not specified, it is given the same name it
313 has on the local machine. local-path may contain glob(3)
314 characters and may match multiple files. If it does and
315 remote-path is specified, then remote-path must specify a
316 directory.
317
318 If the -a flag is specified, then attempt to resume partial
319 transfers of existing files. Note that resumption assumes that
320 any partial copy of the remote file matches the local copy. If
321 the local file contents differ from the remote local copy then
322 the resultant file is likely to be corrupt.
323
324 If the -f flag is specified, then a request will be sent to the
325 server to call fsync(2) after the file has been transferred.
326 Note that this is only supported by servers that implement the
327 "fsync@openssh.com" extension.
328
329 If either the -P or -p flag is specified, then full file
330 permissions and access times are copied too.
331
332 If the -r flag is specified then directories will be copied
333 recursively. Note that sftp does not follow symbolic links when
334 performing recursive transfers.
335
336 pwd Display remote working directory.
337
338 quit Quit sftp.
339
340 reget [-Ppr] remote-path [local-path]
341 Resume download of remote-path. Equivalent to get with the -a
342 flag set.
343
344 reput [-Ppr] [local-path] remote-path
345 Resume upload of [local-path]. Equivalent to put with the -a
346 flag set.
347
348 rename oldpath newpath
349 Rename remote file from oldpath to newpath.
350
351 rm path
352 Delete remote file specified by path.
353
354 rmdir path
355 Remove remote directory specified by path.
356
357 symlink oldpath newpath
358 Create a symbolic link from oldpath to newpath.
359
360 version
361 Display the sftp protocol version.
362
363 !command
364 Execute command in local shell.
365
366 ! Escape to local shell.
367
368 ? Synonym for help.
369
370SEE ALSO
371 ftp(1), ls(1), scp(1), ssh(1), ssh-add(1), ssh-keygen(1), glob(3),
372 ssh_config(5), sftp-server(8), sshd(8)
373
374 T. Ylonen and S. Lehtinen, SSH File Transfer Protocol, draft-ietf-secsh-
375 filexfer-00.txt, January 2001, work in progress material.
376
377OpenBSD 6.2 May 3, 2017 OpenBSD 6.2