1 .\" $OpenBSD: sftp.1,v 1.92 2013/07/25 00:56:51 djm Exp $
4 .\" Copyright (c) 2001 Damien Miller. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
15 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17 .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18 .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19 .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24 .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 .Nd secure file transfer program
36 .Op Fl B Ar buffer_size
39 .Op Fl D Ar sftp_server_path
40 .Op Fl F Ar ssh_config
41 .Op Fl i Ar identity_file
43 .Op Fl o Ar ssh_option
45 .Op Fl R Ar num_requests
47 .Op Fl s Ar subsystem | sftp_server
51 .Oo Ar user Ns @ Oc Ns
52 .Ar host Ns Op : Ns Ar
56 .Ar host Ns Oo : Ns Ar dir Ns
61 .Oo Ar user Ns @ Oc Ns Ar host
64 is an interactive file transfer program, similar to
66 which performs all operations over an encrypted
69 It may also use many features of ssh, such as public key authentication and
72 connects and logs into the specified
74 then enters an interactive command mode.
76 The second usage format will retrieve files automatically if a non-interactive
77 authentication method is used; otherwise it will do so after
78 successful interactive authentication.
80 The third usage format allows
82 to start in a remote directory.
84 The final usage format allows for automated sessions using the
87 In such cases, it is necessary to configure non-interactive authentication
88 to obviate the need to enter a password at connection time (see
94 Since some usage formats use colon characters to delimit host names from path
95 names, IPv6 addresses must be enclosed in square brackets to avoid ambiguity.
97 The options are as follows:
100 Specify the use of protocol version 1.
102 Specify the use of protocol version 2.
106 to use IPv4 addresses only.
110 to use IPv6 addresses only.
111 .It Fl B Ar buffer_size
112 Specify the size of the buffer that
114 uses when transferring files.
115 Larger buffers require fewer round trips at the cost of higher
117 The default is 32768 bytes.
118 .It Fl b Ar batchfile
119 Batch mode reads a series of commands from an input
123 Since it lacks user interaction it should be used in conjunction with
124 non-interactive authentication.
129 may be used to indicate standard input.
131 will abort if any of the following
133 .Ic get , put , reget , rename , ln ,
134 .Ic rm , mkdir , chdir , ls ,
135 .Ic lchdir , chmod , chown ,
136 .Ic chgrp , lpwd , df , symlink ,
139 Termination on error can be suppressed on a command by command basis by
140 prefixing the command with a
142 character (for example,
143 .Ic -rm /tmp/blah* ) .
145 Enables compression (via ssh's
149 Selects the cipher to use for encrypting the data transfers.
150 This option is directly passed to
152 .It Fl D Ar sftp_server_path
153 Connect directly to a local sftp server
156 This option may be useful in debugging the client and server.
157 .It Fl F Ar ssh_config
158 Specifies an alternative
159 per-user configuration file for
161 This option is directly passed to
163 .It Fl i Ar identity_file
164 Selects the file from which the identity (private key) for public key
165 authentication is read.
166 This option is directly passed to
169 Limits the used bandwidth, specified in Kbit/s.
170 .It Fl o Ar ssh_option
171 Can be used to pass options to
173 in the format used in
175 This is useful for specifying options
176 for which there is no separate
179 For example, to specify an alternate port use:
181 For full details of the options listed below, and their possible values, see
184 .Bl -tag -width Ds -offset indent -compact
188 .It ChallengeResponseAuthentication
194 .It ConnectionAttempts
199 .It GlobalKnownHostsFile
200 .It GSSAPIAuthentication
201 .It GSSAPIDelegateCredentials
204 .It HostbasedAuthentication
205 .It HostKeyAlgorithms
211 .It KbdInteractiveAuthentication
212 .It KbdInteractiveDevices
216 .It NoHostAuthenticationForLocalhost
217 .It NumberOfPasswordPrompts
218 .It PasswordAuthentication
221 .It PreferredAuthentications
224 .It PubkeyAuthentication
226 .It RhostsRSAAuthentication
227 .It RSAAuthentication
229 .It ServerAliveInterval
230 .It ServerAliveCountMax
231 .It StrictHostKeyChecking
233 .It UsePrivilegedPort
235 .It UserKnownHostsFile
239 Specifies the port to connect to on the remote host.
241 Preserves modification times, access times, and modes from the
242 original files transferred.
244 Quiet mode: disables the progress meter as well as warning and
245 diagnostic messages from
247 .It Fl R Ar num_requests
248 Specify how many requests may be outstanding at any one time.
249 Increasing this may slightly improve file transfer speed
250 but will increase memory usage.
251 The default is 256 outstanding requests providing for 8MB
252 of outstanding data with a 32KB buffer.
254 Recursively copy entire directories when uploading and downloading.
257 does not follow symbolic links encountered in the tree traversal.
261 to use for the encrypted connection.
262 The program must understand
265 .It Fl s Ar subsystem | sftp_server
266 Specifies the SSH2 subsystem or the path for an sftp server
268 A path is useful for using
270 over protocol version 1, or when the remote
272 does not have an sftp subsystem configured.
275 This option is also passed to ssh.
277 .Sh INTERACTIVE COMMANDS
278 Once in interactive mode,
280 understands a set of commands similar to those of
282 Commands are case insensitive.
283 Pathnames that contain spaces must be enclosed in quotes.
284 Any special characters contained within pathnames that are recognized by
286 must be escaped with backslashes
293 Change remote directory to
295 .It Ic chgrp Ar grp Ar path
303 characters and may match multiple files.
305 must be a numeric GID.
306 .It Ic chmod Ar mode Ar path
307 Change permissions of file
314 characters and may match multiple files.
315 .It Ic chown Ar own Ar path
323 characters and may match multiple files.
325 must be a numeric UID.
330 Display usage information for the filesystem holding the current directory
336 flag is specified, the capacity information will be displayed using
337 "human-readable" suffixes.
340 flag requests display of inode information in addition to capacity information.
341 This command is only supported on servers that implement the
342 .Dq statvfs@openssh.com
354 and store it on the local machine.
356 path name is not specified, it is given the same name it has on the
361 characters and may match multiple files.
366 must specify a directory.
370 flag is specified, then attempt to resume partial transfers of existing files.
371 Note that resumption assumes that any partial copy of the local file matches
373 If the remote file differs from the partial local copy then the resultant file
374 is likely to be corrupt.
380 flag is specified, then full file permissions and access times are
385 flag is specified then directories will be copied recursively.
388 does not follow symbolic links when performing recursive transfers.
392 Change local directory to
394 .It Ic lls Op Ar ls-options Op Ar path
395 Display local directory listing of either
397 or current directory if
401 may contain any flags supported by the local system's
407 characters and may match multiple files.
408 .It Ic lmkdir Ar path
409 Create local directory specified by
422 flag is specified the created link is a symbolic link, otherwise it is
425 Print local working directory.
430 Display a remote directory listing of either
432 or the current directory if
438 characters and may match multiple files.
440 The following flags are recognized and alter the behaviour of
445 Produce single columnar output.
447 List files beginning with a dot
450 Do not sort the listing.
451 The default sort order is lexicographical.
453 When used with a long format option, use unit suffixes: Byte, Kilobyte,
454 Megabyte, Gigabyte, Terabyte, Petabyte, and Exabyte in order to reduce
455 the number of digits to four or fewer using powers of 2 for sizes (K=1024,
458 Display additional details including permissions
459 and ownership information.
461 Produce a long listing with user and group information presented
464 Reverse the sort order of the listing.
466 Sort the listing by file size.
468 Sort the listing by last modification time.
470 .It Ic lumask Ar umask
474 Create remote directory specified by
477 Toggle display of progress meter.
485 and store it on the remote machine.
486 If the remote path name is not specified, it is given the same name it has
487 on the local machine.
491 characters and may match multiple files.
496 must specify a directory.
502 flag is specified, then full file permissions and access times are
507 flag is specified then directories will be copied recursively.
510 does not follow symbolic links when performing recursive transfers.
512 Display remote working directory.
528 .It Ic rename Ar oldpath Ar newpath
529 Rename remote file from
534 Delete remote file specified by
537 Remove remote directory specified by
539 .It Ic symlink Ar oldpath Ar newpath
540 Create a symbolic link from
548 .It Ic \&! Ns Ar command
553 Escape to local shell.
571 .%T "SSH File Transfer Protocol"
572 .%N draft-ietf-secsh-filexfer-00.txt
574 .%O work in progress material