1 .\" $OpenBSD: sftp.1,v 1.83 2010/02/08 10:50:20 markus 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: February 8 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
41 .Op Fl o Ar ssh_option
43 .Op Fl R Ar num_requests
45 .Op Fl s Ar subsystem | sftp_server
49 .Oo Ar user Ns @ Oc Ns
50 .Ar host Ns Op : Ns Ar
52 .Oo Ar user Ns @ Oc Ns
53 .Ar host Ns Oo : Ns Ar dir Ns
57 .Oo Ar user Ns @ Oc Ns Ar host
60 is an interactive file transfer program, similar to
62 which performs all operations over an encrypted
65 It may also use many features of ssh, such as public key authentication and
68 connects and logs into the specified
70 then enters an interactive command mode.
72 The second usage format will retrieve files automatically if a non-interactive
73 authentication method is used; otherwise it will do so after
74 successful interactive authentication.
76 The third usage format allows
78 to start in a remote directory.
80 The final usage format allows for automated sessions using the
83 In such cases, it is necessary to configure non-interactive authentication
84 to obviate the need to enter a password at connection time (see
89 The options are as follows:
92 Specify the use of protocol version 1.
94 Specify the use of protocol version 2.
98 to use IPv4 addresses only.
102 to use IPv6 addresses only.
103 .It Fl B Ar buffer_size
104 Specify the size of the buffer that
106 uses when transferring files.
107 Larger buffers require fewer round trips at the cost of higher
109 The default is 32768 bytes.
110 .It Fl b Ar batchfile
111 Batch mode reads a series of commands from an input
115 Since it lacks user interaction it should be used in conjunction with
116 non-interactive authentication.
121 may be used to indicate standard input.
123 will abort if any of the following
125 .Ic get , put , rename , ln ,
126 .Ic rm , mkdir , chdir , ls ,
127 .Ic lchdir , chmod , chown ,
128 .Ic chgrp , lpwd , df ,
131 Termination on error can be suppressed on a command by command basis by
132 prefixing the command with a
134 character (for example,
135 .Ic -rm /tmp/blah* ) .
137 Enables compression (via ssh's
141 Selects the cipher to use for encrypting the data transfers.
142 This option is directly passed to
144 .It Fl D Ar sftp_server_path
145 Connect directly to a local sftp server
148 This option may be useful in debugging the client and server.
149 .It Fl F Ar ssh_config
150 Specifies an alternative
151 per-user configuration file for
153 This option is directly passed to
155 .It Fl i Ar identity_file
156 Selects the file from which the identity (private key) for public key
157 authentication is read.
158 This option is directly passed to
160 .It Fl o Ar ssh_option
161 Can be used to pass options to
163 in the format used in
165 This is useful for specifying options
166 for which there is no separate
169 For example, to specify an alternate port use:
171 For full details of the options listed below, and their possible values, see
174 .Bl -tag -width Ds -offset indent -compact
178 .It ChallengeResponseAuthentication
184 .It ConnectionAttempts
188 .It GlobalKnownHostsFile
189 .It GSSAPIAuthentication
190 .It GSSAPIDelegateCredentials
193 .It HostbasedAuthentication
194 .It HostKeyAlgorithms
199 .It KbdInteractiveDevices
202 .It NoHostAuthenticationForLocalhost
203 .It NumberOfPasswordPrompts
204 .It PasswordAuthentication
207 .It PreferredAuthentications
210 .It PubkeyAuthentication
212 .It RhostsRSAAuthentication
213 .It RSAAuthentication
215 .It ServerAliveInterval
216 .It ServerAliveCountMax
217 .It StrictHostKeyChecking
219 .It UsePrivilegedPort
221 .It UserKnownHostsFile
225 Specifies the port to connect to on the remote host.
227 Preserves modification times, access times, and modes from the
228 original files transferred.
230 Quiet mode: disables the progress meter as well as warning and
231 diagnostic messages from
233 .It Fl R Ar num_requests
234 Specify how many requests may be outstanding at any one time.
235 Increasing this may slightly improve file transfer speed
236 but will increase memory usage.
237 The default is 64 outstanding requests.
239 Recursively copy entire directories when uploading and downloading.
242 does not follow symbolic links encountered in the tree traversal.
246 to use for the encrypted connection.
247 The program must understand
250 .It Fl s Ar subsystem | sftp_server
251 Specifies the SSH2 subsystem or the path for an sftp server
253 A path is useful for using
255 over protocol version 1, or when the remote
257 does not have an sftp subsystem configured.
260 This option is also passed to ssh.
262 .Sh INTERACTIVE COMMANDS
263 Once in interactive mode,
265 understands a set of commands similar to those of
267 Commands are case insensitive.
268 Pathnames that contain spaces must be enclosed in quotes.
269 Any special characters contained within pathnames that are recognized by
271 must be escaped with backslashes
278 Change remote directory to
280 .It Ic chgrp Ar grp Ar path
288 characters and may match multiple files.
290 must be a numeric GID.
291 .It Ic chmod Ar mode Ar path
292 Change permissions of file
299 characters and may match multiple files.
300 .It Ic chown Ar own Ar path
308 characters and may match multiple files.
310 must be a numeric UID.
315 Display usage information for the filesystem holding the current directory
321 flag is specified, the capacity information will be displayed using
322 "human-readable" suffixes.
325 flag requests display of inode information in addition to capacity information.
326 This command is only supported on servers that implement the
327 .Dq statvfs@openssh.com
339 and store it on the local machine.
341 path name is not specified, it is given the same name it has on the
346 characters and may match multiple files.
351 must specify a directory.
357 flag is specified, then full file permissions and access times are
362 flag is specified then directories will be copied recursively.
365 does not follow symbolic links when performing recursive transfers.
369 Change local directory to
371 .It Ic lls Op Ar ls-options Op Ar path
372 Display local directory listing of either
374 or current directory if
378 may contain any flags supported by the local system's
384 characters and may match multiple files.
385 .It Ic lmkdir Ar path
386 Create local directory specified by
388 .It Ic ln Ar oldpath Ar newpath
389 Create a symbolic link from
394 Print local working directory.
399 Display a remote directory listing of either
401 or the current directory if
407 characters and may match multiple files.
409 The following flags are recognized and alter the behaviour of
414 Produce single columnar output.
416 List files beginning with a dot
419 Do not sort the listing.
420 The default sort order is lexicographical.
422 When used with a long format option, use unit suffixes: Byte, Kilobyte,
423 Megabyte, Gigabyte, Terabyte, Petabyte, and Exabyte in order to reduce
424 the number of digits to four or fewer using powers of 2 for sizes (K=1024,
427 Display additional details including permissions
428 and ownership information.
430 Produce a long listing with user and group information presented
433 Reverse the sort order of the listing.
435 Sort the listing by file size.
437 Sort the listing by last modification time.
439 .It Ic lumask Ar umask
443 Create remote directory specified by
446 Toggle display of progress meter.
454 and store it on the remote machine.
455 If the remote path name is not specified, it is given the same name it has
456 on the local machine.
460 characters and may match multiple files.
465 must specify a directory.
471 flag is specified, then full file permissions and access times are
476 flag is specified then directories will be copied recursively.
479 does not follow symbolic links when performing recursive transfers.
481 Display remote working directory.
485 .It Ic rename Ar oldpath Ar newpath
486 Rename remote file from
491 Delete remote file specified by
494 Remove remote directory specified by
496 .It Ic symlink Ar oldpath Ar newpath
497 Create a symbolic link from
505 .It Ic \&! Ns Ar command
510 Escape to local shell.
528 .%T "SSH File Transfer Protocol"
529 .%N draft-ietf-secsh-filexfer-00.txt
531 .%O work in progress material