1 .\" $OpenBSD: sftp.1,v 1.76 2009/08/19 04:56:03 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: August 19 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
212 .It RSAAuthentication
214 .It ServerAliveInterval
215 .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 Display additional details including permissions
423 and ownership information.
425 Produce a long listing with user and group information presented
428 Reverse the sort order of the listing.
430 Sort the listing by file size.
432 Sort the listing by last modification time.
434 .It Ic lumask Ar umask
438 Create remote directory specified by
441 Toggle display of progress meter.
449 and store it on the remote machine.
450 If the remote path name is not specified, it is given the same name it has
451 on the local machine.
455 characters and may match multiple files.
460 must specify a directory.
466 flag is specified, then full file permissions and access times are
471 flag is specified then directories will be copied recursively.
474 does not follow symbolic links when performing recursive transfers.
476 Display remote working directory.
480 .It Ic rename Ar oldpath Ar newpath
481 Rename remote file from
486 Delete remote file specified by
489 Remove remote directory specified by
491 .It Ic symlink Ar oldpath Ar newpath
492 Create a symbolic link from
500 .It Ic \&! Ns Ar command
505 Escape to local shell.
523 .%T "SSH File Transfer Protocol"
524 .%N draft-ietf-secsh-filexfer-00.txt
526 .%O work in progress material