1 .\" $OpenBSD: sftp.1,v 1.86 2010/09/23 13:36:46 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: September 23 2010 $
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
92 The options are as follows:
95 Specify the use of protocol version 1.
97 Specify the use of protocol version 2.
101 to use IPv4 addresses only.
105 to use IPv6 addresses only.
106 .It Fl B Ar buffer_size
107 Specify the size of the buffer that
109 uses when transferring files.
110 Larger buffers require fewer round trips at the cost of higher
112 The default is 32768 bytes.
113 .It Fl b Ar batchfile
114 Batch mode reads a series of commands from an input
118 Since it lacks user interaction it should be used in conjunction with
119 non-interactive authentication.
124 may be used to indicate standard input.
126 will abort if any of the following
128 .Ic get , put , rename , ln ,
129 .Ic rm , mkdir , chdir , ls ,
130 .Ic lchdir , chmod , chown ,
131 .Ic chgrp , lpwd , df ,
134 Termination on error can be suppressed on a command by command basis by
135 prefixing the command with a
137 character (for example,
138 .Ic -rm /tmp/blah* ) .
140 Enables compression (via ssh's
144 Selects the cipher to use for encrypting the data transfers.
145 This option is directly passed to
147 .It Fl D Ar sftp_server_path
148 Connect directly to a local sftp server
151 This option may be useful in debugging the client and server.
152 .It Fl F Ar ssh_config
153 Specifies an alternative
154 per-user configuration file for
156 This option is directly passed to
158 .It Fl i Ar identity_file
159 Selects the file from which the identity (private key) for public key
160 authentication is read.
161 This option is directly passed to
164 Limits the used bandwidth, specified in Kbit/s.
165 .It Fl o Ar ssh_option
166 Can be used to pass options to
168 in the format used in
170 This is useful for specifying options
171 for which there is no separate
174 For example, to specify an alternate port use:
176 For full details of the options listed below, and their possible values, see
179 .Bl -tag -width Ds -offset indent -compact
183 .It ChallengeResponseAuthentication
189 .It ConnectionAttempts
193 .It GlobalKnownHostsFile
194 .It GSSAPIAuthentication
195 .It GSSAPIDelegateCredentials
198 .It HostbasedAuthentication
199 .It HostKeyAlgorithms
204 .It KbdInteractiveDevices
208 .It NoHostAuthenticationForLocalhost
209 .It NumberOfPasswordPrompts
210 .It PasswordAuthentication
213 .It PreferredAuthentications
216 .It PubkeyAuthentication
218 .It RhostsRSAAuthentication
219 .It RSAAuthentication
221 .It ServerAliveInterval
222 .It ServerAliveCountMax
223 .It StrictHostKeyChecking
225 .It UsePrivilegedPort
227 .It UserKnownHostsFile
231 Specifies the port to connect to on the remote host.
233 Preserves modification times, access times, and modes from the
234 original files transferred.
236 Quiet mode: disables the progress meter as well as warning and
237 diagnostic messages from
239 .It Fl R Ar num_requests
240 Specify how many requests may be outstanding at any one time.
241 Increasing this may slightly improve file transfer speed
242 but will increase memory usage.
243 The default is 64 outstanding requests.
245 Recursively copy entire directories when uploading and downloading.
248 does not follow symbolic links encountered in the tree traversal.
252 to use for the encrypted connection.
253 The program must understand
256 .It Fl s Ar subsystem | sftp_server
257 Specifies the SSH2 subsystem or the path for an sftp server
259 A path is useful for using
261 over protocol version 1, or when the remote
263 does not have an sftp subsystem configured.
266 This option is also passed to ssh.
268 .Sh INTERACTIVE COMMANDS
269 Once in interactive mode,
271 understands a set of commands similar to those of
273 Commands are case insensitive.
274 Pathnames that contain spaces must be enclosed in quotes.
275 Any special characters contained within pathnames that are recognized by
277 must be escaped with backslashes
284 Change remote directory to
286 .It Ic chgrp Ar grp Ar path
294 characters and may match multiple files.
296 must be a numeric GID.
297 .It Ic chmod Ar mode Ar path
298 Change permissions of file
305 characters and may match multiple files.
306 .It Ic chown Ar own Ar path
314 characters and may match multiple files.
316 must be a numeric UID.
321 Display usage information for the filesystem holding the current directory
327 flag is specified, the capacity information will be displayed using
328 "human-readable" suffixes.
331 flag requests display of inode information in addition to capacity information.
332 This command is only supported on servers that implement the
333 .Dq statvfs@openssh.com
345 and store it on the local machine.
347 path name is not specified, it is given the same name it has on the
352 characters and may match multiple files.
357 must specify a directory.
363 flag is specified, then full file permissions and access times are
368 flag is specified then directories will be copied recursively.
371 does not follow symbolic links when performing recursive transfers.
375 Change local directory to
377 .It Ic lls Op Ar ls-options Op Ar path
378 Display local directory listing of either
380 or current directory if
384 may contain any flags supported by the local system's
390 characters and may match multiple files.
391 .It Ic lmkdir Ar path
392 Create local directory specified by
394 .It Ic ln Ar oldpath Ar newpath
395 Create a symbolic link from
400 Print local working directory.
405 Display a remote directory listing of either
407 or the current directory if
413 characters and may match multiple files.
415 The following flags are recognized and alter the behaviour of
420 Produce single columnar output.
422 List files beginning with a dot
425 Do not sort the listing.
426 The default sort order is lexicographical.
428 When used with a long format option, use unit suffixes: Byte, Kilobyte,
429 Megabyte, Gigabyte, Terabyte, Petabyte, and Exabyte in order to reduce
430 the number of digits to four or fewer using powers of 2 for sizes (K=1024,
433 Display additional details including permissions
434 and ownership information.
436 Produce a long listing with user and group information presented
439 Reverse the sort order of the listing.
441 Sort the listing by file size.
443 Sort the listing by last modification time.
445 .It Ic lumask Ar umask
449 Create remote directory specified by
452 Toggle display of progress meter.
460 and store it on the remote machine.
461 If the remote path name is not specified, it is given the same name it has
462 on the local machine.
466 characters and may match multiple files.
471 must specify a directory.
477 flag is specified, then full file permissions and access times are
482 flag is specified then directories will be copied recursively.
485 does not follow symbolic links when performing recursive transfers.
487 Display remote working directory.
491 .It Ic rename Ar oldpath Ar newpath
492 Rename remote file from
497 Delete remote file specified by
500 Remove remote directory specified by
502 .It Ic symlink Ar oldpath Ar newpath
503 Create a symbolic link from
511 .It Ic \&! Ns Ar command
516 Escape to local shell.
534 .%T "SSH File Transfer Protocol"
535 .%N draft-ietf-secsh-filexfer-00.txt
537 .%O work in progress material