1 .\" $OpenBSD: sftp.1,v 1.99 2014/04/22 14:16:30 jmc Exp $
3 .\" Copyright (c) 2001 Damien Miller. All rights reserved.
5 .\" Redistribution and use in source and binary forms, with or without
6 .\" modification, are permitted provided that the following conditions
8 .\" 1. Redistributions of source code must retain the above copyright
9 .\" notice, this list of conditions and the following disclaimer.
10 .\" 2. Redistributions in binary form must reproduce the above copyright
11 .\" notice, this list of conditions and the following disclaimer in the
12 .\" documentation and/or other materials provided with the distribution.
14 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
15 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
16 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
17 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
18 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
19 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 .Dd $Mdocdate: April 22 2014 $
30 .Nd secure file transfer program
35 .Op Fl B Ar buffer_size
38 .Op Fl D Ar sftp_server_path
39 .Op Fl F Ar ssh_config
40 .Op Fl i Ar identity_file
42 .Op Fl o Ar ssh_option
44 .Op Fl R Ar num_requests
46 .Op Fl s Ar subsystem | sftp_server
50 .Oo Ar user Ns @ Oc Ns
51 .Ar host Ns Op : Ns Ar
55 .Ar host Ns Oo : Ns Ar dir Ns
60 .Oo Ar user Ns @ Oc Ns Ar host
63 is an interactive file transfer program, similar to
65 which performs all operations over an encrypted
68 It may also use many features of ssh, such as public key authentication and
71 connects and logs into the specified
73 then enters an interactive command mode.
75 The second usage format will retrieve files automatically if a non-interactive
76 authentication method is used; otherwise it will do so after
77 successful interactive authentication.
79 The third usage format allows
81 to start in a remote directory.
83 The final usage format allows for automated sessions using the
86 In such cases, it is necessary to configure non-interactive authentication
87 to obviate the need to enter a password at connection time (see
93 Since some usage formats use colon characters to delimit host names from path
94 names, IPv6 addresses must be enclosed in square brackets to avoid ambiguity.
96 The options are as follows:
99 Specify the use of protocol version 1.
101 Specify the use of protocol version 2.
105 to use IPv4 addresses only.
109 to use IPv6 addresses only.
111 Attempt to continue interrupted transfers rather than overwriting
112 existing partial or complete copies of files.
113 If the partial contents differ from those being transferred,
114 then the resultant file is likely to be corrupt.
115 .It Fl B Ar buffer_size
116 Specify the size of the buffer that
118 uses when transferring files.
119 Larger buffers require fewer round trips at the cost of higher
121 The default is 32768 bytes.
122 .It Fl b Ar batchfile
123 Batch mode reads a series of commands from an input
127 Since it lacks user interaction it should be used in conjunction with
128 non-interactive authentication.
133 may be used to indicate standard input.
135 will abort if any of the following
137 .Ic get , put , reget , reput, rename , ln ,
138 .Ic rm , mkdir , chdir , ls ,
139 .Ic lchdir , chmod , chown ,
140 .Ic chgrp , lpwd , df , symlink ,
143 Termination on error can be suppressed on a command by command basis by
144 prefixing the command with a
146 character (for example,
147 .Ic -rm /tmp/blah* ) .
149 Enables compression (via ssh's
153 Selects the cipher to use for encrypting the data transfers.
154 This option is directly passed to
156 .It Fl D Ar sftp_server_path
157 Connect directly to a local sftp server
160 This option may be useful in debugging the client and server.
161 .It Fl F Ar ssh_config
162 Specifies an alternative
163 per-user configuration file for
165 This option is directly passed to
168 Requests that files be flushed to disk immediately after transfer.
169 When uploading files, this feature is only enabled if the server
170 implements the "fsync@openssh.com" extension.
171 .It Fl i Ar identity_file
172 Selects the file from which the identity (private key) for public key
173 authentication is read.
174 This option is directly passed to
177 Limits the used bandwidth, specified in Kbit/s.
178 .It Fl o Ar ssh_option
179 Can be used to pass options to
181 in the format used in
183 This is useful for specifying options
184 for which there is no separate
187 For example, to specify an alternate port use:
189 For full details of the options listed below, and their possible values, see
192 .Bl -tag -width Ds -offset indent -compact
197 .It CanonicalizeFallbackLocal
198 .It CanonicalizeHostname
199 .It CanonicalizeMaxDots
200 .It CanonicalizePermittedCNAMEs
201 .It ChallengeResponseAuthentication
207 .It ConnectionAttempts
212 .It GlobalKnownHostsFile
213 .It GSSAPIAuthentication
214 .It GSSAPIDelegateCredentials
217 .It HostbasedAuthentication
218 .It HostKeyAlgorithms
224 .It KbdInteractiveAuthentication
225 .It KbdInteractiveDevices
229 .It NoHostAuthenticationForLocalhost
230 .It NumberOfPasswordPrompts
231 .It PasswordAuthentication
234 .It PreferredAuthentications
237 .It PubkeyAuthentication
239 .It RhostsRSAAuthentication
240 .It RSAAuthentication
242 .It ServerAliveInterval
243 .It ServerAliveCountMax
244 .It StrictHostKeyChecking
246 .It UsePrivilegedPort
248 .It UserKnownHostsFile
252 Specifies the port to connect to on the remote host.
254 Preserves modification times, access times, and modes from the
255 original files transferred.
257 Quiet mode: disables the progress meter as well as warning and
258 diagnostic messages from
260 .It Fl R Ar num_requests
261 Specify how many requests may be outstanding at any one time.
262 Increasing this may slightly improve file transfer speed
263 but will increase memory usage.
264 The default is 256 outstanding requests providing for 8MB
265 of outstanding data with a 32KB buffer.
267 Recursively copy entire directories when uploading and downloading.
270 does not follow symbolic links encountered in the tree traversal.
274 to use for the encrypted connection.
275 The program must understand
278 .It Fl s Ar subsystem | sftp_server
279 Specifies the SSH2 subsystem or the path for an sftp server
281 A path is useful for using
283 over protocol version 1, or when the remote
285 does not have an sftp subsystem configured.
288 This option is also passed to ssh.
290 .Sh INTERACTIVE COMMANDS
291 Once in interactive mode,
293 understands a set of commands similar to those of
295 Commands are case insensitive.
296 Pathnames that contain spaces must be enclosed in quotes.
297 Any special characters contained within pathnames that are recognized by
299 must be escaped with backslashes
306 Change remote directory to
308 .It Ic chgrp Ar grp Ar path
316 characters and may match multiple files.
318 must be a numeric GID.
319 .It Ic chmod Ar mode Ar path
320 Change permissions of file
327 characters and may match multiple files.
328 .It Ic chown Ar own Ar path
336 characters and may match multiple files.
338 must be a numeric UID.
343 Display usage information for the filesystem holding the current directory
349 flag is specified, the capacity information will be displayed using
350 "human-readable" suffixes.
353 flag requests display of inode information in addition to capacity information.
354 This command is only supported on servers that implement the
355 .Dq statvfs@openssh.com
367 and store it on the local machine.
369 path name is not specified, it is given the same name it has on the
374 characters and may match multiple files.
379 must specify a directory.
383 flag is specified, then attempt to resume partial transfers of existing files.
384 Note that resumption assumes that any partial copy of the local file matches
386 If the remote file contents differ from the partial local copy then the
387 resultant file is likely to be corrupt.
391 flag is specified, then
393 will be called after the file transfer has completed to flush the file
400 flag is specified, then full file permissions and access times are
405 flag is specified then directories will be copied recursively.
408 does not follow symbolic links when performing recursive transfers.
412 Change local directory to
414 .It Ic lls Op Ar ls-options Op Ar path
415 Display local directory listing of either
417 or current directory if
421 may contain any flags supported by the local system's
427 characters and may match multiple files.
428 .It Ic lmkdir Ar path
429 Create local directory specified by
442 flag is specified the created link is a symbolic link, otherwise it is
445 Print local working directory.
450 Display a remote directory listing of either
452 or the current directory if
458 characters and may match multiple files.
460 The following flags are recognized and alter the behaviour of
465 Produce single columnar output.
467 List files beginning with a dot
470 Do not sort the listing.
471 The default sort order is lexicographical.
473 When used with a long format option, use unit suffixes: Byte, Kilobyte,
474 Megabyte, Gigabyte, Terabyte, Petabyte, and Exabyte in order to reduce
475 the number of digits to four or fewer using powers of 2 for sizes (K=1024,
478 Display additional details including permissions
479 and ownership information.
481 Produce a long listing with user and group information presented
484 Reverse the sort order of the listing.
486 Sort the listing by file size.
488 Sort the listing by last modification time.
490 .It Ic lumask Ar umask
494 Create remote directory specified by
497 Toggle display of progress meter.
505 and store it on the remote machine.
506 If the remote path name is not specified, it is given the same name it has
507 on the local machine.
511 characters and may match multiple files.
516 must specify a directory.
520 flag is specified, then attempt to resume partial
521 transfers of existing files.
522 Note that resumption assumes that any partial copy of the remote file
523 matches the local copy.
524 If the local file contents differ from the remote local copy then
525 the resultant file is likely to be corrupt.
529 flag is specified, then a request will be sent to the server to call
531 after the file has been transferred.
532 Note that this is only supported by servers that implement
533 the "fsync@openssh.com" extension.
539 flag is specified, then full file permissions and access times are
544 flag is specified then directories will be copied recursively.
547 does not follow symbolic links when performing recursive transfers.
549 Display remote working directory.
577 .It Ic rename Ar oldpath Ar newpath
578 Rename remote file from
583 Delete remote file specified by
586 Remove remote directory specified by
588 .It Ic symlink Ar oldpath Ar newpath
589 Create a symbolic link from
597 .It Ic \&! Ns Ar command
602 Escape to local shell.
620 .%T "SSH File Transfer Protocol"
621 .%N draft-ietf-secsh-filexfer-00.txt
623 .%O work in progress material