blob: 49d88de037b082a573a02102219c24c656232253 [file] [log] [blame]
Damien Miller881adf72010-09-24 22:01:54 +10001.\" $OpenBSD: sftp.1,v 1.84 2010/09/19 21:30:05 jmc Exp $
Damien Miller33804262001-02-04 23:20:18 +11002.\"
Ben Lindstrom92a2e382001-03-05 06:59:27 +00003.\" Copyright (c) 2001 Damien Miller. All rights reserved.
Damien Miller33804262001-02-04 23:20:18 +11004.\"
5.\" Redistribution and use in source and binary forms, with or without
6.\" modification, are permitted provided that the following conditions
7.\" are met:
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.
13.\"
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.
24.\"
Damien Miller881adf72010-09-24 22:01:54 +100025.Dd $Mdocdate: September 19 2010 $
Damien Miller33804262001-02-04 23:20:18 +110026.Dt SFTP 1
27.Os
28.Sh NAME
29.Nm sftp
Damien Miller50677922003-05-23 18:44:04 +100030.Nd secure file transfer program
Damien Miller33804262001-02-04 23:20:18 +110031.Sh SYNOPSIS
Damien Millerd6ead282003-05-14 19:30:38 +100032.Nm sftp
Damien Miller495dca32003-04-01 21:42:14 +100033.Bk -words
Darren Tucker1b0dd172009-10-07 08:37:48 +110034.Op Fl 1246Cpqrv
Damien Miller81b6e782002-02-08 22:06:03 +110035.Op Fl B Ar buffer_size
Darren Tucker1f203942003-10-15 15:50:42 +100036.Op Fl b Ar batchfile
Darren Tucker46bbbe32009-10-07 08:21:48 +110037.Op Fl c Ar cipher
Darren Tucker282b4022009-10-07 08:23:06 +110038.Op Fl D Ar sftp_server_path
Damien Miller81b6e782002-02-08 22:06:03 +110039.Op Fl F Ar ssh_config
Darren Tuckerc07138e2009-10-07 08:23:44 +110040.Op Fl i Ar identity_file
Darren Tucker1f203942003-10-15 15:50:42 +100041.Op Fl o Ar ssh_option
Darren Tucker282b4022009-10-07 08:23:06 +110042.Op Fl P Ar port
Damien Miller16a13332002-02-13 14:03:56 +110043.Op Fl R Ar num_requests
Ben Lindstrom6a337632001-09-18 05:47:32 +000044.Op Fl S Ar program
Darren Tucker1f203942003-10-15 15:50:42 +100045.Op Fl s Ar subsystem | sftp_server
Ben Lindstrom6a337632001-09-18 05:47:32 +000046.Ar host
Damien Miller495dca32003-04-01 21:42:14 +100047.Ek
Damien Millerd6ead282003-05-14 19:30:38 +100048.Nm sftp
Damien Miller7ebfad72008-12-09 14:12:33 +110049.Oo Ar user Ns @ Oc Ns
50.Ar host Ns Op : Ns Ar
Damien Millerd6ead282003-05-14 19:30:38 +100051.Nm sftp
Damien Miller881adf72010-09-24 22:01:54 +100052.Oo
53.Ar user Ns @ Oc Ns
Damien Miller495dca32003-04-01 21:42:14 +100054.Ar host Ns Oo : Ns Ar dir Ns
Damien Miller881adf72010-09-24 22:01:54 +100055.Op Ar /
56.Oc
Damien Millerd6ead282003-05-14 19:30:38 +100057.Nm sftp
Damien Millerfb7508e2003-05-14 13:47:07 +100058.Fl b Ar batchfile
Damien Millerc2b98272003-09-03 12:13:30 +100059.Oo Ar user Ns @ Oc Ns Ar host
Damien Miller33804262001-02-04 23:20:18 +110060.Sh DESCRIPTION
61.Nm
62is an interactive file transfer program, similar to
63.Xr ftp 1 ,
64which performs all operations over an encrypted
65.Xr ssh 1
66transport.
67It may also use many features of ssh, such as public key authentication and
68compression.
69.Nm
70connects and logs into the specified
Ben Lindstromaafff9c2001-05-06 03:01:02 +000071.Ar host ,
Damien Miller33804262001-02-04 23:20:18 +110072then enters an interactive command mode.
73.Pp
Ben Lindstrom24643222001-06-25 05:08:11 +000074The second usage format will retrieve files automatically if a non-interactive
Ben Lindstromaafff9c2001-05-06 03:01:02 +000075authentication method is used; otherwise it will do so after
76successful interactive authentication.
Ben Lindstrom63667f62001-04-13 00:00:14 +000077.Pp
Darren Tucker16e254d2004-12-06 22:46:45 +110078The third usage format allows
79.Nm
80to start in a remote directory.
Ben Lindstrom63667f62001-04-13 00:00:14 +000081.Pp
Damien Miller50677922003-05-23 18:44:04 +100082The final usage format allows for automated sessions using the
Damien Millerfb7508e2003-05-14 13:47:07 +100083.Fl b
Damien Miller50677922003-05-23 18:44:04 +100084option.
Damien Miller134eb812005-12-31 16:22:55 +110085In such cases, it is necessary to configure non-interactive authentication
Damien Miller50677922003-05-23 18:44:04 +100086to obviate the need to enter a password at connection time (see
Damien Millerfb7508e2003-05-14 13:47:07 +100087.Xr sshd 8
Damien Millerd6ead282003-05-14 19:30:38 +100088and
Damien Millerfb7508e2003-05-14 13:47:07 +100089.Xr ssh-keygen 1
Damien Miller50677922003-05-23 18:44:04 +100090for details).
Damien Miller33804262001-02-04 23:20:18 +110091The options are as follows:
92.Bl -tag -width Ds
Darren Tucker1f203942003-10-15 15:50:42 +100093.It Fl 1
94Specify the use of protocol version 1.
Darren Tucker46bbbe32009-10-07 08:21:48 +110095.It Fl 2
96Specify the use of protocol version 2.
97.It Fl 4
98Forces
99.Nm
100to use IPv4 addresses only.
101.It Fl 6
102Forces
103.Nm
104to use IPv6 addresses only.
Darren Tucker1f203942003-10-15 15:50:42 +1000105.It Fl B Ar buffer_size
106Specify the size of the buffer that
107.Nm
108uses when transferring files.
109Larger buffers require fewer round trips at the cost of higher
110memory consumption.
111The default is 32768 bytes.
Ben Lindstrom562c26b2001-03-07 01:26:48 +0000112.It Fl b Ar batchfile
113Batch mode reads a series of commands from an input
Ben Lindstrom283cb822001-03-09 00:09:02 +0000114.Ar batchfile
Ben Lindstrom562c26b2001-03-07 01:26:48 +0000115instead of
Ben Lindstrom283cb822001-03-09 00:09:02 +0000116.Em stdin .
117Since it lacks user interaction it should be used in conjunction with
Damien Miller86a39682004-01-21 11:00:04 +1100118non-interactive authentication.
Damien Miller44f75c12004-01-21 10:58:47 +1100119A
Damien Miller86a39682004-01-21 11:00:04 +1100120.Ar batchfile
121of
122.Sq \-
Damien Miller44f75c12004-01-21 10:58:47 +1100123may be used to indicate standard input.
Ben Lindstrom283cb822001-03-09 00:09:02 +0000124.Nm
Ben Lindstrom24643222001-06-25 05:08:11 +0000125will abort if any of the following
126commands fail:
Ben Lindstrom3612bda2002-03-05 01:26:38 +0000127.Ic get , put , rename , ln ,
Damien Miller495dca32003-04-01 21:42:14 +1000128.Ic rm , mkdir , chdir , ls ,
Damien Miller64058cb2008-05-19 14:54:25 +1000129.Ic lchdir , chmod , chown ,
130.Ic chgrp , lpwd , df ,
Ben Lindstrom562c26b2001-03-07 01:26:48 +0000131and
Ben Lindstrom283cb822001-03-09 00:09:02 +0000132.Ic lmkdir .
Damien Miller495dca32003-04-01 21:42:14 +1000133Termination on error can be suppressed on a command by command basis by
134prefixing the command with a
Damien Miller86a39682004-01-21 11:00:04 +1100135.Sq \-
Damien Miller50677922003-05-23 18:44:04 +1000136character (for example,
137.Ic -rm /tmp/blah* ) .
Darren Tucker1f203942003-10-15 15:50:42 +1000138.It Fl C
139Enables compression (via ssh's
140.Fl C
141flag).
Darren Tuckeradba1ba2009-10-07 08:22:20 +1100142.It Fl c Ar cipher
143Selects the cipher to use for encrypting the data transfers.
144This option is directly passed to
145.Xr ssh 1 .
Darren Tucker282b4022009-10-07 08:23:06 +1100146.It Fl D Ar sftp_server_path
147Connect directly to a local sftp server
148(rather than via
149.Xr ssh 1 ) .
150This option may be useful in debugging the client and server.
Darren Tucker1f203942003-10-15 15:50:42 +1000151.It Fl F Ar ssh_config
152Specifies an alternative
153per-user configuration file for
154.Xr ssh 1 .
155This option is directly passed to
156.Xr ssh 1 .
Darren Tucker46bbbe32009-10-07 08:21:48 +1100157.It Fl i Ar identity_file
158Selects the file from which the identity (private key) for public key
159authentication is read.
160This option is directly passed to
161.Xr ssh 1 .
Damien Miller33804262001-02-04 23:20:18 +1100162.It Fl o Ar ssh_option
Ben Lindstrom14c62eb2001-08-15 23:25:46 +0000163Can be used to pass options to
164.Nm ssh
Ben Lindstrom3072aae2002-06-21 01:02:39 +0000165in the format used in
166.Xr ssh_config 5 .
167This is useful for specifying options
Ben Lindstrom14c62eb2001-08-15 23:25:46 +0000168for which there is no separate
169.Nm sftp
Damien Miller50677922003-05-23 18:44:04 +1000170command-line flag.
171For example, to specify an alternate port use:
Ben Lindstrom6a337632001-09-18 05:47:32 +0000172.Ic sftp -oPort=24 .
Darren Tucker1f203942003-10-15 15:50:42 +1000173For full details of the options listed below, and their possible values, see
174.Xr ssh_config 5 .
175.Pp
176.Bl -tag -width Ds -offset indent -compact
177.It AddressFamily
178.It BatchMode
179.It BindAddress
180.It ChallengeResponseAuthentication
181.It CheckHostIP
182.It Cipher
183.It Ciphers
Darren Tucker1f203942003-10-15 15:50:42 +1000184.It Compression
185.It CompressionLevel
186.It ConnectionAttempts
Darren Tucker3d5cbb72004-05-03 09:13:15 +1000187.It ConnectTimeout
Damien Miller0e220db2004-06-15 10:34:08 +1000188.It ControlMaster
189.It ControlPath
Darren Tucker1f203942003-10-15 15:50:42 +1000190.It GlobalKnownHostsFile
191.It GSSAPIAuthentication
192.It GSSAPIDelegateCredentials
Damien Miller27e9c512005-03-02 12:04:16 +1100193.It HashKnownHosts
Darren Tucker1f203942003-10-15 15:50:42 +1000194.It Host
195.It HostbasedAuthentication
196.It HostKeyAlgorithms
197.It HostKeyAlias
198.It HostName
199.It IdentityFile
Damien Millerbd394c32004-03-08 23:12:36 +1100200.It IdentitiesOnly
Darren Tucker636ca902004-11-05 20:22:00 +1100201.It KbdInteractiveDevices
Darren Tucker1f203942003-10-15 15:50:42 +1000202.It LogLevel
203.It MACs
204.It NoHostAuthenticationForLocalhost
205.It NumberOfPasswordPrompts
206.It PasswordAuthentication
Damien Miller7ea845e2010-02-12 09:21:02 +1100207.It PKCS11Provider
Darren Tucker1f203942003-10-15 15:50:42 +1000208.It Port
209.It PreferredAuthentications
210.It Protocol
211.It ProxyCommand
212.It PubkeyAuthentication
Darren Tucker62388b22006-01-20 11:31:47 +1100213.It RekeyLimit
Darren Tucker1f203942003-10-15 15:50:42 +1000214.It RhostsRSAAuthentication
215.It RSAAuthentication
Darren Tucker7a6c0662004-05-02 22:14:03 +1000216.It SendEnv
Damien Miller509b0102003-12-17 16:33:10 +1100217.It ServerAliveInterval
218.It ServerAliveCountMax
Darren Tucker1f203942003-10-15 15:50:42 +1000219.It StrictHostKeyChecking
Damien Miller12c150e2003-12-17 16:31:10 +1100220.It TCPKeepAlive
Darren Tucker1f203942003-10-15 15:50:42 +1000221.It UsePrivilegedPort
222.It User
223.It UserKnownHostsFile
224.It VerifyHostKeyDNS
Darren Tucker1f203942003-10-15 15:50:42 +1000225.El
Darren Tucker282b4022009-10-07 08:23:06 +1100226.It Fl P Ar port
227Specifies the port to connect to on the remote host.
Darren Tucker1b0dd172009-10-07 08:37:48 +1100228.It Fl p
229Preserves modification times, access times, and modes from the
230original files transferred.
Darren Tucker46bbbe32009-10-07 08:21:48 +1100231.It Fl q
232Quiet mode: disables the progress meter as well as warning and
233diagnostic messages from
234.Xr ssh 1 .
Damien Miller16a13332002-02-13 14:03:56 +1100235.It Fl R Ar num_requests
Damien Miller50677922003-05-23 18:44:04 +1000236Specify how many requests may be outstanding at any one time.
237Increasing this may slightly improve file transfer speed
238but will increase memory usage.
Damien Miller94717b02008-07-16 21:17:23 +1000239The default is 64 outstanding requests.
Darren Tucker1b0dd172009-10-07 08:37:48 +1100240.It Fl r
241Recursively copy entire directories when uploading and downloading.
242Note that
243.Nm
244does not follow symbolic links encountered in the tree traversal.
Ben Lindstrom6a337632001-09-18 05:47:32 +0000245.It Fl S Ar program
246Name of the
247.Ar program
248to use for the encrypted connection.
249The program must understand
250.Xr ssh 1
251options.
Darren Tucker1f203942003-10-15 15:50:42 +1000252.It Fl s Ar subsystem | sftp_server
253Specifies the SSH2 subsystem or the path for an sftp server
254on the remote host.
255A path is useful for using
256.Nm
257over protocol version 1, or when the remote
258.Xr sshd 8
259does not have an sftp subsystem configured.
260.It Fl v
261Raise logging level.
262This option is also passed to ssh.
Damien Miller33804262001-02-04 23:20:18 +1100263.El
264.Sh INTERACTIVE COMMANDS
Damien Millerd7686fd2001-02-10 00:40:03 +1100265Once in interactive mode,
266.Nm
Ben Lindstrom24643222001-06-25 05:08:11 +0000267understands a set of commands similar to those of
Damien Miller33804262001-02-04 23:20:18 +1100268.Xr ftp 1 .
Darren Tucker16e254d2004-12-06 22:46:45 +1100269Commands are case insensitive.
270Pathnames that contain spaces must be enclosed in quotes.
271Any special characters contained within pathnames that are recognized by
272.Xr glob 3
273must be escaped with backslashes
274.Pq Sq \e .
275.Bl -tag -width Ds
Ben Lindstrom59e12492001-08-15 23:22:56 +0000276.It Ic bye
Damien Miller50677922003-05-23 18:44:04 +1000277Quit
278.Nm sftp .
Damien Millerd7686fd2001-02-10 00:40:03 +1100279.It Ic cd Ar path
Ben Lindstrom24643222001-06-25 05:08:11 +0000280Change remote directory to
Damien Millerd7686fd2001-02-10 00:40:03 +1100281.Ar path .
Damien Millerd7686fd2001-02-10 00:40:03 +1100282.It Ic chgrp Ar grp Ar path
Ben Lindstrom24643222001-06-25 05:08:11 +0000283Change group of file
Damien Millerd7686fd2001-02-10 00:40:03 +1100284.Ar path
285to
Damien Miller33804262001-02-04 23:20:18 +1100286.Ar grp .
Darren Tucker16e254d2004-12-06 22:46:45 +1100287.Ar path
288may contain
289.Xr glob 3
290characters and may match multiple files.
Damien Miller33804262001-02-04 23:20:18 +1100291.Ar grp
Damien Millerd7686fd2001-02-10 00:40:03 +1100292must be a numeric GID.
293.It Ic chmod Ar mode Ar path
Ben Lindstrom24643222001-06-25 05:08:11 +0000294Change permissions of file
Damien Millerd7686fd2001-02-10 00:40:03 +1100295.Ar path
296to
297.Ar mode .
Darren Tucker16e254d2004-12-06 22:46:45 +1100298.Ar path
299may contain
300.Xr glob 3
301characters and may match multiple files.
Damien Millerd7686fd2001-02-10 00:40:03 +1100302.It Ic chown Ar own Ar path
Ben Lindstrom24643222001-06-25 05:08:11 +0000303Change owner of file
Damien Millerd7686fd2001-02-10 00:40:03 +1100304.Ar path
305to
Damien Miller33804262001-02-04 23:20:18 +1100306.Ar own .
Darren Tucker16e254d2004-12-06 22:46:45 +1100307.Ar path
308may contain
309.Xr glob 3
310characters and may match multiple files.
Damien Miller33804262001-02-04 23:20:18 +1100311.Ar own
312must be a numeric UID.
Damien Millerd671e5a2008-05-19 14:53:33 +1000313.It Xo Ic df
314.Op Fl hi
315.Op Ar path
316.Xc
317Display usage information for the filesystem holding the current directory
318(or
319.Ar path
320if specified).
321If the
322.Fl h
323flag is specified, the capacity information will be displayed using
324"human-readable" suffixes.
325The
326.Fl i
327flag requests display of inode information in addition to capacity information.
328This command is only supported on servers that implement the
329.Dq statvfs@openssh.com
330extension.
Ben Lindstromc9b6eab2001-03-07 01:29:17 +0000331.It Ic exit
Damien Miller50677922003-05-23 18:44:04 +1000332Quit
333.Nm sftp .
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000334.It Xo Ic get
Darren Tucker1b0dd172009-10-07 08:37:48 +1100335.Op Fl Ppr
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000336.Ar remote-path
337.Op Ar local-path
338.Xc
Damien Miller33804262001-02-04 23:20:18 +1100339Retrieve the
Damien Millerd7686fd2001-02-10 00:40:03 +1100340.Ar remote-path
Damien Miller33804262001-02-04 23:20:18 +1100341and store it on the local machine.
342If the local
Ben Lindstrom24643222001-06-25 05:08:11 +0000343path name is not specified, it is given the same name it has on the
Damien Miller50677922003-05-23 18:44:04 +1000344remote machine.
Darren Tucker16e254d2004-12-06 22:46:45 +1100345.Ar remote-path
346may contain
347.Xr glob 3
348characters and may match multiple files.
349If it does and
350.Ar local-path
351is specified, then
352.Ar local-path
353must specify a directory.
Darren Tucker1b0dd172009-10-07 08:37:48 +1100354.Pp
Darren Tuckerb3b40a82009-10-07 08:39:09 +1100355If either the
Darren Tucker05016b22009-10-07 08:38:23 +1100356.Fl P
Darren Tucker1b0dd172009-10-07 08:37:48 +1100357or
358.Fl p
Darren Tucker16e254d2004-12-06 22:46:45 +1100359flag is specified, then full file permissions and access times are
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000360copied too.
Darren Tucker1b0dd172009-10-07 08:37:48 +1100361.Pp
362If the
363.Fl r
364flag is specified then directories will be copied recursively.
365Note that
366.Nm
367does not follow symbolic links when performing recursive transfers.
Ben Lindstromc9b6eab2001-03-07 01:29:17 +0000368.It Ic help
369Display help text.
Darren Tucker1f203942003-10-15 15:50:42 +1000370.It Ic lcd Ar path
371Change local directory to
372.Ar path .
Damien Millerd7686fd2001-02-10 00:40:03 +1100373.It Ic lls Op Ar ls-options Op Ar path
Ben Lindstrom24643222001-06-25 05:08:11 +0000374Display local directory listing of either
Damien Miller33804262001-02-04 23:20:18 +1100375.Ar path
376or current directory if
377.Ar path
Damien Millerd7686fd2001-02-10 00:40:03 +1100378is not specified.
Darren Tucker16e254d2004-12-06 22:46:45 +1100379.Ar ls-options
380may contain any flags supported by the local system's
381.Xr ls 1
382command.
383.Ar path
384may contain
385.Xr glob 3
386characters and may match multiple files.
Damien Millerd7686fd2001-02-10 00:40:03 +1100387.It Ic lmkdir Ar path
Damien Miller33804262001-02-04 23:20:18 +1100388Create local directory specified by
Damien Millerd7686fd2001-02-10 00:40:03 +1100389.Ar path .
Damien Miller058316f2001-03-08 10:08:49 +1100390.It Ic ln Ar oldpath Ar newpath
Ben Lindstrom24643222001-06-25 05:08:11 +0000391Create a symbolic link from
Damien Miller058316f2001-03-08 10:08:49 +1100392.Ar oldpath
393to
394.Ar newpath .
Damien Millerd7686fd2001-02-10 00:40:03 +1100395.It Ic lpwd
396Print local working directory.
Damien Millere1a49812002-09-12 09:54:25 +1000397.It Xo Ic ls
Darren Tucker75fe6262010-01-15 11:42:51 +1100398.Op Fl 1afhlnrSt
Damien Millere1a49812002-09-12 09:54:25 +1000399.Op Ar path
400.Xc
Darren Tucker16e254d2004-12-06 22:46:45 +1100401Display a remote directory listing of either
Damien Miller33804262001-02-04 23:20:18 +1100402.Ar path
Darren Tucker16e254d2004-12-06 22:46:45 +1100403or the current directory if
Damien Miller33804262001-02-04 23:20:18 +1100404.Ar path
Damien Miller50677922003-05-23 18:44:04 +1000405is not specified.
Darren Tucker16e254d2004-12-06 22:46:45 +1100406.Ar path
407may contain
408.Xr glob 3
409characters and may match multiple files.
Darren Tucker15ca6e82004-06-22 13:08:21 +1000410.Pp
Darren Tucker16e254d2004-12-06 22:46:45 +1100411The following flags are recognized and alter the behaviour of
Darren Tucker15ca6e82004-06-22 13:08:21 +1000412.Ic ls
Darren Tucker16e254d2004-12-06 22:46:45 +1100413accordingly:
414.Bl -tag -width Ds
415.It Fl 1
416Produce single columnar output.
417.It Fl a
418List files beginning with a dot
419.Pq Sq \&. .
420.It Fl f
421Do not sort the listing.
422The default sort order is lexicographical.
Darren Tucker2901e2d2010-01-13 22:44:06 +1100423.It Fl h
424When used with a long format option, use unit suffixes: Byte, Kilobyte,
425Megabyte, Gigabyte, Terabyte, Petabyte, and Exabyte in order to reduce
426the number of digits to four or fewer using powers of 2 for sizes (K=1024,
427M=1048576, etc.).
Darren Tucker75fe6262010-01-15 11:42:51 +1100428.It Fl l
429Display additional details including permissions
430and ownership information.
Darren Tucker16e254d2004-12-06 22:46:45 +1100431.It Fl n
432Produce a long listing with user and group information presented
433numerically.
434.It Fl r
435Reverse the sort order of the listing.
436.It Fl S
437Sort the listing by file size.
438.It Fl t
439Sort the listing by last modification time.
440.El
Damien Millerd7686fd2001-02-10 00:40:03 +1100441.It Ic lumask Ar umask
Ben Lindstrom24643222001-06-25 05:08:11 +0000442Set local umask to
Damien Millerd7686fd2001-02-10 00:40:03 +1100443.Ar umask .
444.It Ic mkdir Ar path
445Create remote directory specified by
446.Ar path .
Damien Miller62d57f62003-01-10 21:43:24 +1100447.It Ic progress
448Toggle display of progress meter.
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000449.It Xo Ic put
Darren Tucker05016b22009-10-07 08:38:23 +1100450.Op Fl Ppr
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000451.Ar local-path
Ben Lindstromd5767812002-12-23 02:23:37 +0000452.Op Ar remote-path
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000453.Xc
Damien Miller33804262001-02-04 23:20:18 +1100454Upload
Damien Millerd7686fd2001-02-10 00:40:03 +1100455.Ar local-path
Damien Miller50677922003-05-23 18:44:04 +1000456and store it on the remote machine.
457If the remote path name is not specified, it is given the same name it has
458on the local machine.
Darren Tucker16e254d2004-12-06 22:46:45 +1100459.Ar local-path
460may contain
461.Xr glob 3
462characters and may match multiple files.
463If it does and
464.Ar remote-path
465is specified, then
466.Ar remote-path
467must specify a directory.
Darren Tucker1b0dd172009-10-07 08:37:48 +1100468.Pp
469If ether the
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000470.Fl P
Darren Tucker1b0dd172009-10-07 08:37:48 +1100471or
472.Fl p
473flag is specified, then full file permissions and access times are
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000474copied too.
Darren Tucker1b0dd172009-10-07 08:37:48 +1100475.Pp
476If the
477.Fl r
478flag is specified then directories will be copied recursively.
479Note that
480.Nm
481does not follow symbolic links when performing recursive transfers.
Damien Millerd7686fd2001-02-10 00:40:03 +1100482.It Ic pwd
483Display remote working directory.
Damien Millerd7686fd2001-02-10 00:40:03 +1100484.It Ic quit
Damien Miller50677922003-05-23 18:44:04 +1000485Quit
486.Nm sftp .
Damien Millerd7686fd2001-02-10 00:40:03 +1100487.It Ic rename Ar oldpath Ar newpath
Damien Miller33804262001-02-04 23:20:18 +1100488Rename remote file from
489.Ar oldpath
490to
Damien Millerd7686fd2001-02-10 00:40:03 +1100491.Ar newpath .
Damien Millerd7686fd2001-02-10 00:40:03 +1100492.It Ic rm Ar path
Damien Miller33804262001-02-04 23:20:18 +1100493Delete remote file specified by
Damien Millerd7686fd2001-02-10 00:40:03 +1100494.Ar path .
Darren Tucker1f203942003-10-15 15:50:42 +1000495.It Ic rmdir Ar path
496Remove remote directory specified by
497.Ar path .
Damien Miller058316f2001-03-08 10:08:49 +1100498.It Ic symlink Ar oldpath Ar newpath
Ben Lindstrom24643222001-06-25 05:08:11 +0000499Create a symbolic link from
Damien Miller058316f2001-03-08 10:08:49 +1100500.Ar oldpath
501to
502.Ar newpath .
Damien Miller63421802003-01-08 14:05:23 +1100503.It Ic version
504Display the
505.Nm
506protocol version.
Damien Miller62fd18a2009-01-28 16:14:09 +1100507.It Ic \&! Ns Ar command
Ben Lindstrom24643222001-06-25 05:08:11 +0000508Execute
Damien Miller33804262001-02-04 23:20:18 +1100509.Ar command
Damien Millerd7686fd2001-02-10 00:40:03 +1100510in local shell.
Damien Millerc2b98272003-09-03 12:13:30 +1000511.It Ic \&!
Damien Millerd7686fd2001-02-10 00:40:03 +1100512Escape to local shell.
Damien Millerc2b98272003-09-03 12:13:30 +1000513.It Ic \&?
Damien Millerd7686fd2001-02-10 00:40:03 +1100514Synonym for help.
515.El
Damien Miller33804262001-02-04 23:20:18 +1100516.Sh SEE ALSO
Darren Tucker1f203942003-10-15 15:50:42 +1000517.Xr ftp 1 ,
Darren Tucker16e254d2004-12-06 22:46:45 +1100518.Xr ls 1 ,
Ben Lindstrom160ec622001-04-22 17:17:46 +0000519.Xr scp 1 ,
Damien Miller33804262001-02-04 23:20:18 +1100520.Xr ssh 1 ,
521.Xr ssh-add 1 ,
522.Xr ssh-keygen 1 ,
Darren Tucker16e254d2004-12-06 22:46:45 +1100523.Xr glob 3 ,
Ben Lindstrom3072aae2002-06-21 01:02:39 +0000524.Xr ssh_config 5 ,
Ben Lindstrom160ec622001-04-22 17:17:46 +0000525.Xr sftp-server 8 ,
526.Xr sshd 8
527.Rs
Ben Lindstrom90fd0602001-06-25 04:45:33 +0000528.%A T. Ylonen
529.%A S. Lehtinen
Ben Lindstrom160ec622001-04-22 17:17:46 +0000530.%T "SSH File Transfer Protocol"
531.%N draft-ietf-secsh-filexfer-00.txt
532.%D January 2001
533.%O work in progress material
534.Re