1 .\" $OpenBSD: sftp.1,v 1.88 2010/12/04 00:18:01 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
93 The options are as follows:
96 Specify the use of protocol version 1.
98 Specify the use of protocol version 2.
102 to use IPv4 addresses only.
106 to use IPv6 addresses only.
107 .It Fl B Ar buffer_size
108 Specify the size of the buffer that
110 uses when transferring files.
111 Larger buffers require fewer round trips at the cost of higher
113 The default is 32768 bytes.
114 .It Fl b Ar batchfile
115 Batch mode reads a series of commands from an input
119 Since it lacks user interaction it should be used in conjunction with
120 non-interactive authentication.
125 may be used to indicate standard input.
127 will abort if any of the following
129 .Ic get , put , rename , ln ,
130 .Ic rm , mkdir , chdir , ls ,
131 .Ic lchdir , chmod , chown ,
132 .Ic chgrp , lpwd , df , symlink ,
135 Termination on error can be suppressed on a command by command basis by
136 prefixing the command with a
138 character (for example,
139 .Ic -rm /tmp/blah* ) .
141 Enables compression (via ssh's
145 Selects the cipher to use for encrypting the data transfers.
146 This option is directly passed to
148 .It Fl D Ar sftp_server_path
149 Connect directly to a local sftp server
152 This option may be useful in debugging the client and server.
153 .It Fl F Ar ssh_config
154 Specifies an alternative
155 per-user configuration file for
157 This option is directly passed to
159 .It Fl i Ar identity_file
160 Selects the file from which the identity (private key) for public key
161 authentication is read.
162 This option is directly passed to
165 Limits the used bandwidth, specified in Kbit/s.
166 .It Fl o Ar ssh_option
167 Can be used to pass options to
169 in the format used in
171 This is useful for specifying options
172 for which there is no separate
175 For example, to specify an alternate port use:
177 For full details of the options listed below, and their possible values, see
180 .Bl -tag -width Ds -offset indent -compact
184 .It ChallengeResponseAuthentication
190 .It ConnectionAttempts
194 .It GlobalKnownHostsFile
195 .It GSSAPIAuthentication
196 .It GSSAPIDelegateCredentials
199 .It HostbasedAuthentication
200 .It HostKeyAlgorithms
206 .It KbdInteractiveDevices
210 .It NoHostAuthenticationForLocalhost
211 .It NumberOfPasswordPrompts
212 .It PasswordAuthentication
215 .It PreferredAuthentications
218 .It PubkeyAuthentication
220 .It RhostsRSAAuthentication
221 .It RSAAuthentication
223 .It ServerAliveInterval
224 .It ServerAliveCountMax
225 .It StrictHostKeyChecking
227 .It UsePrivilegedPort
229 .It UserKnownHostsFile
233 Specifies the port to connect to on the remote host.
235 Preserves modification times, access times, and modes from the
236 original files transferred.
238 Quiet mode: disables the progress meter as well as warning and
239 diagnostic messages from
241 .It Fl R Ar num_requests
242 Specify how many requests may be outstanding at any one time.
243 Increasing this may slightly improve file transfer speed
244 but will increase memory usage.
245 The default is 64 outstanding requests.
247 Recursively copy entire directories when uploading and downloading.
250 does not follow symbolic links encountered in the tree traversal.
254 to use for the encrypted connection.
255 The program must understand
258 .It Fl s Ar subsystem | sftp_server
259 Specifies the SSH2 subsystem or the path for an sftp server
261 A path is useful for using
263 over protocol version 1, or when the remote
265 does not have an sftp subsystem configured.
268 This option is also passed to ssh.
270 .Sh INTERACTIVE COMMANDS
271 Once in interactive mode,
273 understands a set of commands similar to those of
275 Commands are case insensitive.
276 Pathnames that contain spaces must be enclosed in quotes.
277 Any special characters contained within pathnames that are recognized by
279 must be escaped with backslashes
286 Change remote directory to
288 .It Ic chgrp Ar grp Ar path
296 characters and may match multiple files.
298 must be a numeric GID.
299 .It Ic chmod Ar mode Ar path
300 Change permissions of file
307 characters and may match multiple files.
308 .It Ic chown Ar own Ar path
316 characters and may match multiple files.
318 must be a numeric UID.
323 Display usage information for the filesystem holding the current directory
329 flag is specified, the capacity information will be displayed using
330 "human-readable" suffixes.
333 flag requests display of inode information in addition to capacity information.
334 This command is only supported on servers that implement the
335 .Dq statvfs@openssh.com
347 and store it on the local machine.
349 path name is not specified, it is given the same name it has on the
354 characters and may match multiple files.
359 must specify a directory.
365 flag is specified, then full file permissions and access times are
370 flag is specified then directories will be copied recursively.
373 does not follow symbolic links when performing recursive transfers.
377 Change local directory to
379 .It Ic lls Op Ar ls-options Op Ar path
380 Display local directory listing of either
382 or current directory if
386 may contain any flags supported by the local system's
392 characters and may match multiple files.
393 .It Ic lmkdir Ar path
394 Create local directory specified by
407 flag is specified the created link is a symbolic link, otherwise it is
410 Print local working directory.
415 Display a remote directory listing of either
417 or the current directory if
423 characters and may match multiple files.
425 The following flags are recognized and alter the behaviour of
430 Produce single columnar output.
432 List files beginning with a dot
435 Do not sort the listing.
436 The default sort order is lexicographical.
438 When used with a long format option, use unit suffixes: Byte, Kilobyte,
439 Megabyte, Gigabyte, Terabyte, Petabyte, and Exabyte in order to reduce
440 the number of digits to four or fewer using powers of 2 for sizes (K=1024,
443 Display additional details including permissions
444 and ownership information.
446 Produce a long listing with user and group information presented
449 Reverse the sort order of the listing.
451 Sort the listing by file size.
453 Sort the listing by last modification time.
455 .It Ic lumask Ar umask
459 Create remote directory specified by
462 Toggle display of progress meter.
470 and store it on the remote machine.
471 If the remote path name is not specified, it is given the same name it has
472 on the local machine.
476 characters and may match multiple files.
481 must specify a directory.
487 flag is specified, then full file permissions and access times are
492 flag is specified then directories will be copied recursively.
495 does not follow symbolic links when performing recursive transfers.
497 Display remote working directory.
501 .It Ic rename Ar oldpath Ar newpath
502 Rename remote file from
507 Delete remote file specified by
510 Remove remote directory specified by
512 .It Ic symlink Ar oldpath Ar newpath
513 Create a symbolic link from
521 .It Ic \&! Ns Ar command
526 Escape to local shell.
544 .%T "SSH File Transfer Protocol"
545 .%N draft-ietf-secsh-filexfer-00.txt
547 .%O work in progress material