1 .\" $OpenBSD: sftp.1,v 1.91 2011/09/05 05:56:13 djm 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: September 5 2011 $
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.
110 .It Fl B Ar buffer_size
111 Specify the size of the buffer that
113 uses when transferring files.
114 Larger buffers require fewer round trips at the cost of higher
116 The default is 32768 bytes.
117 .It Fl b Ar batchfile
118 Batch mode reads a series of commands from an input
122 Since it lacks user interaction it should be used in conjunction with
123 non-interactive authentication.
128 may be used to indicate standard input.
130 will abort if any of the following
132 .Ic get , put , rename , ln ,
133 .Ic rm , mkdir , chdir , ls ,
134 .Ic lchdir , chmod , chown ,
135 .Ic chgrp , lpwd , df , symlink ,
138 Termination on error can be suppressed on a command by command basis by
139 prefixing the command with a
141 character (for example,
142 .Ic -rm /tmp/blah* ) .
144 Enables compression (via ssh's
148 Selects the cipher to use for encrypting the data transfers.
149 This option is directly passed to
151 .It Fl D Ar sftp_server_path
152 Connect directly to a local sftp server
155 This option may be useful in debugging the client and server.
156 .It Fl F Ar ssh_config
157 Specifies an alternative
158 per-user configuration file for
160 This option is directly passed to
162 .It Fl i Ar identity_file
163 Selects the file from which the identity (private key) for public key
164 authentication is read.
165 This option is directly passed to
168 Limits the used bandwidth, specified in Kbit/s.
169 .It Fl o Ar ssh_option
170 Can be used to pass options to
172 in the format used in
174 This is useful for specifying options
175 for which there is no separate
178 For example, to specify an alternate port use:
180 For full details of the options listed below, and their possible values, see
183 .Bl -tag -width Ds -offset indent -compact
187 .It ChallengeResponseAuthentication
193 .It ConnectionAttempts
198 .It GlobalKnownHostsFile
199 .It GSSAPIAuthentication
200 .It GSSAPIDelegateCredentials
203 .It HostbasedAuthentication
204 .It HostKeyAlgorithms
210 .It KbdInteractiveAuthentication
211 .It KbdInteractiveDevices
215 .It NoHostAuthenticationForLocalhost
216 .It NumberOfPasswordPrompts
217 .It PasswordAuthentication
220 .It PreferredAuthentications
223 .It PubkeyAuthentication
225 .It RhostsRSAAuthentication
226 .It RSAAuthentication
228 .It ServerAliveInterval
229 .It ServerAliveCountMax
230 .It StrictHostKeyChecking
232 .It UsePrivilegedPort
234 .It UserKnownHostsFile
238 Specifies the port to connect to on the remote host.
240 Preserves modification times, access times, and modes from the
241 original files transferred.
243 Quiet mode: disables the progress meter as well as warning and
244 diagnostic messages from
246 .It Fl R Ar num_requests
247 Specify how many requests may be outstanding at any one time.
248 Increasing this may slightly improve file transfer speed
249 but will increase memory usage.
250 The default is 256 outstanding requests providing for 8MB
251 of outstanding data with a 32KB buffer.
253 Recursively copy entire directories when uploading and downloading.
256 does not follow symbolic links encountered in the tree traversal.
260 to use for the encrypted connection.
261 The program must understand
264 .It Fl s Ar subsystem | sftp_server
265 Specifies the SSH2 subsystem or the path for an sftp server
267 A path is useful for using
269 over protocol version 1, or when the remote
271 does not have an sftp subsystem configured.
274 This option is also passed to ssh.
276 .Sh INTERACTIVE COMMANDS
277 Once in interactive mode,
279 understands a set of commands similar to those of
281 Commands are case insensitive.
282 Pathnames that contain spaces must be enclosed in quotes.
283 Any special characters contained within pathnames that are recognized by
285 must be escaped with backslashes
292 Change remote directory to
294 .It Ic chgrp Ar grp Ar path
302 characters and may match multiple files.
304 must be a numeric GID.
305 .It Ic chmod Ar mode Ar path
306 Change permissions of file
313 characters and may match multiple files.
314 .It Ic chown Ar own Ar path
322 characters and may match multiple files.
324 must be a numeric UID.
329 Display usage information for the filesystem holding the current directory
335 flag is specified, the capacity information will be displayed using
336 "human-readable" suffixes.
339 flag requests display of inode information in addition to capacity information.
340 This command is only supported on servers that implement the
341 .Dq statvfs@openssh.com
353 and store it on the local machine.
355 path name is not specified, it is given the same name it has on the
360 characters and may match multiple files.
365 must specify a directory.
371 flag is specified, then full file permissions and access times are
376 flag is specified then directories will be copied recursively.
379 does not follow symbolic links when performing recursive transfers.
383 Change local directory to
385 .It Ic lls Op Ar ls-options Op Ar path
386 Display local directory listing of either
388 or current directory if
392 may contain any flags supported by the local system's
398 characters and may match multiple files.
399 .It Ic lmkdir Ar path
400 Create local directory specified by
413 flag is specified the created link is a symbolic link, otherwise it is
416 Print local working directory.
421 Display a remote directory listing of either
423 or the current directory if
429 characters and may match multiple files.
431 The following flags are recognized and alter the behaviour of
436 Produce single columnar output.
438 List files beginning with a dot
441 Do not sort the listing.
442 The default sort order is lexicographical.
444 When used with a long format option, use unit suffixes: Byte, Kilobyte,
445 Megabyte, Gigabyte, Terabyte, Petabyte, and Exabyte in order to reduce
446 the number of digits to four or fewer using powers of 2 for sizes (K=1024,
449 Display additional details including permissions
450 and ownership information.
452 Produce a long listing with user and group information presented
455 Reverse the sort order of the listing.
457 Sort the listing by file size.
459 Sort the listing by last modification time.
461 .It Ic lumask Ar umask
465 Create remote directory specified by
468 Toggle display of progress meter.
476 and store it on the remote machine.
477 If the remote path name is not specified, it is given the same name it has
478 on the local machine.
482 characters and may match multiple files.
487 must specify a directory.
493 flag is specified, then full file permissions and access times are
498 flag is specified then directories will be copied recursively.
501 does not follow symbolic links when performing recursive transfers.
503 Display remote working directory.
507 .It Ic rename Ar oldpath Ar newpath
508 Rename remote file from
513 Delete remote file specified by
516 Remove remote directory specified by
518 .It Ic symlink Ar oldpath Ar newpath
519 Create a symbolic link from
527 .It Ic \&! Ns Ar command
532 Escape to local shell.
550 .%T "SSH File Transfer Protocol"
551 .%N draft-ietf-secsh-filexfer-00.txt
553 .%O work in progress material