1 .\" $OpenBSD: sftp.1,v 1.71 2009/08/12 06:31:42 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.
30 .Nd secure file transfer program
35 .Op Fl B Ar buffer_size
38 .Op Fl F Ar ssh_config
39 .Op Fl i Ar identity_path
40 .Op Fl o Ar ssh_option
41 .Op Fl P Ar sftp_server_path
42 .Op Fl R Ar num_requests
44 .Op Fl s Ar subsystem | sftp_server
48 .Oo Ar user Ns @ Oc Ns
49 .Ar host Ns Op : Ns Ar
51 .Oo Ar user Ns @ Oc Ns
52 .Ar host Ns Oo : Ns Ar dir Ns
56 .Oo Ar user Ns @ Oc Ns Ar host
59 is an interactive file transfer program, similar to
61 which performs all operations over an encrypted
64 It may also use many features of ssh, such as public key authentication and
67 connects and logs into the specified
69 then enters an interactive command mode.
71 The second usage format will retrieve files automatically if a non-interactive
72 authentication method is used; otherwise it will do so after
73 successful interactive authentication.
75 The third usage format allows
77 to start in a remote directory.
79 The final usage format allows for automated sessions using the
82 In such cases, it is necessary to configure non-interactive authentication
83 to obviate the need to enter a password at connection time (see
88 The options are as follows:
91 Specify the use of protocol version 1.
93 Specify the use of protocol version 2.
97 to use IPv4 addresses only.
101 to use IPv6 addresses only.
102 .It Fl B Ar buffer_size
103 Specify the size of the buffer that
105 uses when transferring files.
106 Larger buffers require fewer round trips at the cost of higher
108 The default is 32768 bytes.
109 .It Fl b Ar batchfile
110 Batch mode reads a series of commands from an input
114 Since it lacks user interaction it should be used in conjunction with
115 non-interactive authentication.
120 may be used to indicate standard input.
122 will abort if any of the following
124 .Ic get , put , rename , ln ,
125 .Ic rm , mkdir , chdir , ls ,
126 .Ic lchdir , chmod , chown ,
127 .Ic chgrp , lpwd , df ,
130 Termination on error can be suppressed on a command by command basis by
131 prefixing the command with a
133 character (for example,
134 .Ic -rm /tmp/blah* ) .
136 Enables compression (via ssh's
140 Selects the cipher to use for encrypting the data transfers.
141 This option is directly passed to
143 .It Fl F Ar ssh_config
144 Specifies an alternative
145 per-user configuration file for
147 This option is directly passed to
149 .It Fl i Ar identity_file
150 Selects the file from which the identity (private key) for public key
151 authentication is read.
152 This option is directly passed to
154 .It Fl o Ar ssh_option
155 Can be used to pass options to
157 in the format used in
159 This is useful for specifying options
160 for which there is no separate
163 For example, to specify an alternate port use:
165 For full details of the options listed below, and their possible values, see
168 .Bl -tag -width Ds -offset indent -compact
172 .It ChallengeResponseAuthentication
178 .It ConnectionAttempts
182 .It GlobalKnownHostsFile
183 .It GSSAPIAuthentication
184 .It GSSAPIDelegateCredentials
187 .It HostbasedAuthentication
188 .It HostKeyAlgorithms
193 .It KbdInteractiveDevices
196 .It NoHostAuthenticationForLocalhost
197 .It NumberOfPasswordPrompts
198 .It PasswordAuthentication
200 .It PreferredAuthentications
203 .It PubkeyAuthentication
205 .It RhostsRSAAuthentication
206 .It RSAAuthentication
208 .It ServerAliveInterval
209 .It ServerAliveCountMax
211 .It StrictHostKeyChecking
213 .It UsePrivilegedPort
215 .It UserKnownHostsFile
218 .It Fl P Ar sftp_server_path
219 Connect directly to a local sftp server
222 This option may be useful in debugging the client and server.
224 Quiet mode: disables the progress meter as well as warning and
225 diagnostic messages from
227 .It Fl R Ar num_requests
228 Specify how many requests may be outstanding at any one time.
229 Increasing this may slightly improve file transfer speed
230 but will increase memory usage.
231 The default is 64 outstanding requests.
235 to use for the encrypted connection.
236 The program must understand
239 .It Fl s Ar subsystem | sftp_server
240 Specifies the SSH2 subsystem or the path for an sftp server
242 A path is useful for using
244 over protocol version 1, or when the remote
246 does not have an sftp subsystem configured.
249 This option is also passed to ssh.
251 .Sh INTERACTIVE COMMANDS
252 Once in interactive mode,
254 understands a set of commands similar to those of
256 Commands are case insensitive.
257 Pathnames that contain spaces must be enclosed in quotes.
258 Any special characters contained within pathnames that are recognized by
260 must be escaped with backslashes
267 Change remote directory to
269 .It Ic chgrp Ar grp Ar path
277 characters and may match multiple files.
279 must be a numeric GID.
280 .It Ic chmod Ar mode Ar path
281 Change permissions of file
288 characters and may match multiple files.
289 .It Ic chown Ar own Ar path
297 characters and may match multiple files.
299 must be a numeric UID.
304 Display usage information for the filesystem holding the current directory
310 flag is specified, the capacity information will be displayed using
311 "human-readable" suffixes.
314 flag requests display of inode information in addition to capacity information.
315 This command is only supported on servers that implement the
316 .Dq statvfs@openssh.com
328 and store it on the local machine.
330 path name is not specified, it is given the same name it has on the
335 characters and may match multiple files.
340 must specify a directory.
343 flag is specified, then full file permissions and access times are
348 Change local directory to
350 .It Ic lls Op Ar ls-options Op Ar path
351 Display local directory listing of either
353 or current directory if
357 may contain any flags supported by the local system's
363 characters and may match multiple files.
364 .It Ic lmkdir Ar path
365 Create local directory specified by
367 .It Ic ln Ar oldpath Ar newpath
368 Create a symbolic link from
373 Print local working directory.
378 Display a remote directory listing of either
380 or the current directory if
386 characters and may match multiple files.
388 The following flags are recognized and alter the behaviour of
393 Produce single columnar output.
395 List files beginning with a dot
398 Do not sort the listing.
399 The default sort order is lexicographical.
401 Display additional details including permissions
402 and ownership information.
404 Produce a long listing with user and group information presented
407 Reverse the sort order of the listing.
409 Sort the listing by file size.
411 Sort the listing by last modification time.
413 .It Ic lumask Ar umask
417 Create remote directory specified by
420 Toggle display of progress meter.
428 and store it on the remote machine.
429 If the remote path name is not specified, it is given the same name it has
430 on the local machine.
434 characters and may match multiple files.
439 must specify a directory.
442 flag is specified, then the file's full permission and access time are
445 Display remote working directory.
449 .It Ic rename Ar oldpath Ar newpath
450 Rename remote file from
455 Delete remote file specified by
458 Remove remote directory specified by
460 .It Ic symlink Ar oldpath Ar newpath
461 Create a symbolic link from
469 .It Ic \&! Ns Ar command
474 Escape to local shell.
492 .%T "SSH File Transfer Protocol"
493 .%N draft-ietf-secsh-filexfer-00.txt
495 .%O work in progress material