1 .\" $OpenBSD: sftp.1,v 1.73 2009/08/13 13:39:54 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 13 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 Quiet mode: disables the progress meter as well as warning and
228 diagnostic messages from
230 .It Fl R Ar num_requests
231 Specify how many requests may be outstanding at any one time.
232 Increasing this may slightly improve file transfer speed
233 but will increase memory usage.
234 The default is 64 outstanding requests.
238 to use for the encrypted connection.
239 The program must understand
242 .It Fl s Ar subsystem | sftp_server
243 Specifies the SSH2 subsystem or the path for an sftp server
245 A path is useful for using
247 over protocol version 1, or when the remote
249 does not have an sftp subsystem configured.
252 This option is also passed to ssh.
254 .Sh INTERACTIVE COMMANDS
255 Once in interactive mode,
257 understands a set of commands similar to those of
259 Commands are case insensitive.
260 Pathnames that contain spaces must be enclosed in quotes.
261 Any special characters contained within pathnames that are recognized by
263 must be escaped with backslashes
270 Change remote directory to
272 .It Ic chgrp Ar grp Ar path
280 characters and may match multiple files.
282 must be a numeric GID.
283 .It Ic chmod Ar mode Ar path
284 Change permissions of file
291 characters and may match multiple files.
292 .It Ic chown Ar own Ar path
300 characters and may match multiple files.
302 must be a numeric UID.
307 Display usage information for the filesystem holding the current directory
313 flag is specified, the capacity information will be displayed using
314 "human-readable" suffixes.
317 flag requests display of inode information in addition to capacity information.
318 This command is only supported on servers that implement the
319 .Dq statvfs@openssh.com
331 and store it on the local machine.
333 path name is not specified, it is given the same name it has on the
338 characters and may match multiple files.
343 must specify a directory.
346 flag is specified, then full file permissions and access times are
351 Change local directory to
353 .It Ic lls Op Ar ls-options Op Ar path
354 Display local directory listing of either
356 or current directory if
360 may contain any flags supported by the local system's
366 characters and may match multiple files.
367 .It Ic lmkdir Ar path
368 Create local directory specified by
370 .It Ic ln Ar oldpath Ar newpath
371 Create a symbolic link from
376 Print local working directory.
381 Display a remote directory listing of either
383 or the current directory if
389 characters and may match multiple files.
391 The following flags are recognized and alter the behaviour of
396 Produce single columnar output.
398 List files beginning with a dot
401 Do not sort the listing.
402 The default sort order is lexicographical.
404 Display additional details including permissions
405 and ownership information.
407 Produce a long listing with user and group information presented
410 Reverse the sort order of the listing.
412 Sort the listing by file size.
414 Sort the listing by last modification time.
416 .It Ic lumask Ar umask
420 Create remote directory specified by
423 Toggle display of progress meter.
431 and store it on the remote machine.
432 If the remote path name is not specified, it is given the same name it has
433 on the local machine.
437 characters and may match multiple files.
442 must specify a directory.
445 flag is specified, then the file's full permission and access time are
448 Display remote working directory.
452 .It Ic rename Ar oldpath Ar newpath
453 Rename remote file from
458 Delete remote file specified by
461 Remove remote directory specified by
463 .It Ic symlink Ar oldpath Ar newpath
464 Create a symbolic link from
472 .It Ic \&! Ns Ar command
477 Escape to local shell.
495 .%T "SSH File Transfer Protocol"
496 .%N draft-ietf-secsh-filexfer-00.txt
498 .%O work in progress material