1 .\" $OpenBSD: sftp.1,v 1.79 2009/12/29 16:38:41 stevesk 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: December 29 2009 $
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
206 .It PreferredAuthentications
209 .It PubkeyAuthentication
211 .It RhostsRSAAuthentication
213 .It RSAAuthentication
215 .It ServerAliveInterval
216 .It ServerAliveCountMax
218 .It StrictHostKeyChecking
220 .It UsePrivilegedPort
222 .It UserKnownHostsFile
226 Specifies the port to connect to on the remote host.
228 Preserves modification times, access times, and modes from the
229 original files transferred.
231 Quiet mode: disables the progress meter as well as warning and
232 diagnostic messages from
234 .It Fl R Ar num_requests
235 Specify how many requests may be outstanding at any one time.
236 Increasing this may slightly improve file transfer speed
237 but will increase memory usage.
238 The default is 64 outstanding requests.
240 Recursively copy entire directories when uploading and downloading.
243 does not follow symbolic links encountered in the tree traversal.
247 to use for the encrypted connection.
248 The program must understand
251 .It Fl s Ar subsystem | sftp_server
252 Specifies the SSH2 subsystem or the path for an sftp server
254 A path is useful for using
256 over protocol version 1, or when the remote
258 does not have an sftp subsystem configured.
261 This option is also passed to ssh.
263 .Sh INTERACTIVE COMMANDS
264 Once in interactive mode,
266 understands a set of commands similar to those of
268 Commands are case insensitive.
269 Pathnames that contain spaces must be enclosed in quotes.
270 Any special characters contained within pathnames that are recognized by
272 must be escaped with backslashes
279 Change remote directory to
281 .It Ic chgrp Ar grp Ar path
289 characters and may match multiple files.
291 must be a numeric GID.
292 .It Ic chmod Ar mode Ar path
293 Change permissions of file
300 characters and may match multiple files.
301 .It Ic chown Ar own Ar path
309 characters and may match multiple files.
311 must be a numeric UID.
316 Display usage information for the filesystem holding the current directory
322 flag is specified, the capacity information will be displayed using
323 "human-readable" suffixes.
326 flag requests display of inode information in addition to capacity information.
327 This command is only supported on servers that implement the
328 .Dq statvfs@openssh.com
340 and store it on the local machine.
342 path name is not specified, it is given the same name it has on the
347 characters and may match multiple files.
352 must specify a directory.
358 flag is specified, then full file permissions and access times are
363 flag is specified then directories will be copied recursively.
366 does not follow symbolic links when performing recursive transfers.
370 Change local directory to
372 .It Ic lls Op Ar ls-options Op Ar path
373 Display local directory listing of either
375 or current directory if
379 may contain any flags supported by the local system's
385 characters and may match multiple files.
386 .It Ic lmkdir Ar path
387 Create local directory specified by
389 .It Ic ln Ar oldpath Ar newpath
390 Create a symbolic link from
395 Print local working directory.
400 Display a remote directory listing of either
402 or the current directory if
408 characters and may match multiple files.
410 The following flags are recognized and alter the behaviour of
415 Produce single columnar output.
417 List files beginning with a dot
420 Do not sort the listing.
421 The default sort order is lexicographical.
423 Display additional details including permissions
424 and ownership information.
426 Produce a long listing with user and group information presented
429 Reverse the sort order of the listing.
431 Sort the listing by file size.
433 Sort the listing by last modification time.
435 .It Ic lumask Ar umask
439 Create remote directory specified by
442 Toggle display of progress meter.
450 and store it on the remote machine.
451 If the remote path name is not specified, it is given the same name it has
452 on the local machine.
456 characters and may match multiple files.
461 must specify a directory.
467 flag is specified, then full file permissions and access times are
472 flag is specified then directories will be copied recursively.
475 does not follow symbolic links when performing recursive transfers.
477 Display remote working directory.
481 .It Ic rename Ar oldpath Ar newpath
482 Rename remote file from
487 Delete remote file specified by
490 Remove remote directory specified by
492 .It Ic symlink Ar oldpath Ar newpath
493 Create a symbolic link from
501 .It Ic \&! Ns Ar command
506 Escape to local shell.
524 .%T "SSH File Transfer Protocol"
525 .%N draft-ietf-secsh-filexfer-00.txt
527 .%O work in progress material