blob: 81d87680dcb52f071774784272d321b7bf066da9 [file] [log] [blame]
Darren Tucker535b5e12010-01-08 18:56:48 +11001.\" $OpenBSD: sftp.1,v 1.79 2009/12/29 16:38:41 stevesk 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.\"
Darren Tucker535b5e12010-01-08 18:56:48 +110025.Dd $Mdocdate: December 29 2009 $
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 Miller7ebfad72008-12-09 14:12:33 +110052.Oo Ar user Ns @ Oc Ns
Damien Miller495dca32003-04-01 21:42:14 +100053.Ar host Ns Oo : Ns Ar dir Ns
Damien Miller62fd18a2009-01-28 16:14:09 +110054.Op Ar / Oc
Damien Millerd6ead282003-05-14 19:30:38 +100055.Nm sftp
Damien Millerfb7508e2003-05-14 13:47:07 +100056.Fl b Ar batchfile
Damien Millerc2b98272003-09-03 12:13:30 +100057.Oo Ar user Ns @ Oc Ns Ar host
Damien Miller33804262001-02-04 23:20:18 +110058.Sh DESCRIPTION
59.Nm
60is an interactive file transfer program, similar to
61.Xr ftp 1 ,
62which performs all operations over an encrypted
63.Xr ssh 1
64transport.
65It may also use many features of ssh, such as public key authentication and
66compression.
67.Nm
68connects and logs into the specified
Ben Lindstromaafff9c2001-05-06 03:01:02 +000069.Ar host ,
Damien Miller33804262001-02-04 23:20:18 +110070then enters an interactive command mode.
71.Pp
Ben Lindstrom24643222001-06-25 05:08:11 +000072The second usage format will retrieve files automatically if a non-interactive
Ben Lindstromaafff9c2001-05-06 03:01:02 +000073authentication method is used; otherwise it will do so after
74successful interactive authentication.
Ben Lindstrom63667f62001-04-13 00:00:14 +000075.Pp
Darren Tucker16e254d2004-12-06 22:46:45 +110076The third usage format allows
77.Nm
78to start in a remote directory.
Ben Lindstrom63667f62001-04-13 00:00:14 +000079.Pp
Damien Miller50677922003-05-23 18:44:04 +100080The final usage format allows for automated sessions using the
Damien Millerfb7508e2003-05-14 13:47:07 +100081.Fl b
Damien Miller50677922003-05-23 18:44:04 +100082option.
Damien Miller134eb812005-12-31 16:22:55 +110083In such cases, it is necessary to configure non-interactive authentication
Damien Miller50677922003-05-23 18:44:04 +100084to obviate the need to enter a password at connection time (see
Damien Millerfb7508e2003-05-14 13:47:07 +100085.Xr sshd 8
Damien Millerd6ead282003-05-14 19:30:38 +100086and
Damien Millerfb7508e2003-05-14 13:47:07 +100087.Xr ssh-keygen 1
Damien Miller50677922003-05-23 18:44:04 +100088for details).
Damien Miller33804262001-02-04 23:20:18 +110089The options are as follows:
90.Bl -tag -width Ds
Darren Tucker1f203942003-10-15 15:50:42 +100091.It Fl 1
92Specify the use of protocol version 1.
Darren Tucker46bbbe32009-10-07 08:21:48 +110093.It Fl 2
94Specify the use of protocol version 2.
95.It Fl 4
96Forces
97.Nm
98to use IPv4 addresses only.
99.It Fl 6
100Forces
101.Nm
102to use IPv6 addresses only.
Darren Tucker1f203942003-10-15 15:50:42 +1000103.It Fl B Ar buffer_size
104Specify the size of the buffer that
105.Nm
106uses when transferring files.
107Larger buffers require fewer round trips at the cost of higher
108memory consumption.
109The default is 32768 bytes.
Ben Lindstrom562c26b2001-03-07 01:26:48 +0000110.It Fl b Ar batchfile
111Batch mode reads a series of commands from an input
Ben Lindstrom283cb822001-03-09 00:09:02 +0000112.Ar batchfile
Ben Lindstrom562c26b2001-03-07 01:26:48 +0000113instead of
Ben Lindstrom283cb822001-03-09 00:09:02 +0000114.Em stdin .
115Since it lacks user interaction it should be used in conjunction with
Damien Miller86a39682004-01-21 11:00:04 +1100116non-interactive authentication.
Damien Miller44f75c12004-01-21 10:58:47 +1100117A
Damien Miller86a39682004-01-21 11:00:04 +1100118.Ar batchfile
119of
120.Sq \-
Damien Miller44f75c12004-01-21 10:58:47 +1100121may be used to indicate standard input.
Ben Lindstrom283cb822001-03-09 00:09:02 +0000122.Nm
Ben Lindstrom24643222001-06-25 05:08:11 +0000123will abort if any of the following
124commands fail:
Ben Lindstrom3612bda2002-03-05 01:26:38 +0000125.Ic get , put , rename , ln ,
Damien Miller495dca32003-04-01 21:42:14 +1000126.Ic rm , mkdir , chdir , ls ,
Damien Miller64058cb2008-05-19 14:54:25 +1000127.Ic lchdir , chmod , chown ,
128.Ic chgrp , lpwd , df ,
Ben Lindstrom562c26b2001-03-07 01:26:48 +0000129and
Ben Lindstrom283cb822001-03-09 00:09:02 +0000130.Ic lmkdir .
Damien Miller495dca32003-04-01 21:42:14 +1000131Termination on error can be suppressed on a command by command basis by
132prefixing the command with a
Damien Miller86a39682004-01-21 11:00:04 +1100133.Sq \-
Damien Miller50677922003-05-23 18:44:04 +1000134character (for example,
135.Ic -rm /tmp/blah* ) .
Darren Tucker1f203942003-10-15 15:50:42 +1000136.It Fl C
137Enables compression (via ssh's
138.Fl C
139flag).
Darren Tuckeradba1ba2009-10-07 08:22:20 +1100140.It Fl c Ar cipher
141Selects the cipher to use for encrypting the data transfers.
142This option is directly passed to
143.Xr ssh 1 .
Darren Tucker282b4022009-10-07 08:23:06 +1100144.It Fl D Ar sftp_server_path
145Connect directly to a local sftp server
146(rather than via
147.Xr ssh 1 ) .
148This option may be useful in debugging the client and server.
Darren Tucker1f203942003-10-15 15:50:42 +1000149.It Fl F Ar ssh_config
150Specifies an alternative
151per-user configuration file for
152.Xr ssh 1 .
153This option is directly passed to
154.Xr ssh 1 .
Darren Tucker46bbbe32009-10-07 08:21:48 +1100155.It Fl i Ar identity_file
156Selects the file from which the identity (private key) for public key
157authentication is read.
158This option is directly passed to
159.Xr ssh 1 .
Damien Miller33804262001-02-04 23:20:18 +1100160.It Fl o Ar ssh_option
Ben Lindstrom14c62eb2001-08-15 23:25:46 +0000161Can be used to pass options to
162.Nm ssh
Ben Lindstrom3072aae2002-06-21 01:02:39 +0000163in the format used in
164.Xr ssh_config 5 .
165This is useful for specifying options
Ben Lindstrom14c62eb2001-08-15 23:25:46 +0000166for which there is no separate
167.Nm sftp
Damien Miller50677922003-05-23 18:44:04 +1000168command-line flag.
169For example, to specify an alternate port use:
Ben Lindstrom6a337632001-09-18 05:47:32 +0000170.Ic sftp -oPort=24 .
Darren Tucker1f203942003-10-15 15:50:42 +1000171For full details of the options listed below, and their possible values, see
172.Xr ssh_config 5 .
173.Pp
174.Bl -tag -width Ds -offset indent -compact
175.It AddressFamily
176.It BatchMode
177.It BindAddress
178.It ChallengeResponseAuthentication
179.It CheckHostIP
180.It Cipher
181.It Ciphers
Darren Tucker1f203942003-10-15 15:50:42 +1000182.It Compression
183.It CompressionLevel
184.It ConnectionAttempts
Darren Tucker3d5cbb72004-05-03 09:13:15 +1000185.It ConnectTimeout
Damien Miller0e220db2004-06-15 10:34:08 +1000186.It ControlMaster
187.It ControlPath
Darren Tucker1f203942003-10-15 15:50:42 +1000188.It GlobalKnownHostsFile
189.It GSSAPIAuthentication
190.It GSSAPIDelegateCredentials
Damien Miller27e9c512005-03-02 12:04:16 +1100191.It HashKnownHosts
Darren Tucker1f203942003-10-15 15:50:42 +1000192.It Host
193.It HostbasedAuthentication
194.It HostKeyAlgorithms
195.It HostKeyAlias
196.It HostName
197.It IdentityFile
Damien Millerbd394c32004-03-08 23:12:36 +1100198.It IdentitiesOnly
Darren Tucker636ca902004-11-05 20:22:00 +1100199.It KbdInteractiveDevices
Darren Tucker1f203942003-10-15 15:50:42 +1000200.It LogLevel
201.It MACs
202.It NoHostAuthenticationForLocalhost
203.It NumberOfPasswordPrompts
204.It PasswordAuthentication
205.It Port
206.It PreferredAuthentications
207.It Protocol
208.It ProxyCommand
209.It PubkeyAuthentication
Darren Tucker62388b22006-01-20 11:31:47 +1100210.It RekeyLimit
Darren Tucker1f203942003-10-15 15:50:42 +1000211.It RhostsRSAAuthentication
Darren Tucker535b5e12010-01-08 18:56:48 +1100212.It RoutingDomain
Darren Tucker1f203942003-10-15 15:50:42 +1000213.It RSAAuthentication
Darren Tucker7a6c0662004-05-02 22:14:03 +1000214.It SendEnv
Damien Miller509b0102003-12-17 16:33:10 +1100215.It ServerAliveInterval
216.It ServerAliveCountMax
Darren Tucker1f203942003-10-15 15:50:42 +1000217.It SmartcardDevice
218.It StrictHostKeyChecking
Damien Miller12c150e2003-12-17 16:31:10 +1100219.It TCPKeepAlive
Darren Tucker1f203942003-10-15 15:50:42 +1000220.It UsePrivilegedPort
221.It User
222.It UserKnownHostsFile
223.It VerifyHostKeyDNS
Darren Tucker1f203942003-10-15 15:50:42 +1000224.El
Darren Tucker282b4022009-10-07 08:23:06 +1100225.It Fl P Ar port
226Specifies the port to connect to on the remote host.
Darren Tucker1b0dd172009-10-07 08:37:48 +1100227.It Fl p
228Preserves modification times, access times, and modes from the
229original files transferred.
Darren Tucker46bbbe32009-10-07 08:21:48 +1100230.It Fl q
231Quiet mode: disables the progress meter as well as warning and
232diagnostic messages from
233.Xr ssh 1 .
Damien Miller16a13332002-02-13 14:03:56 +1100234.It Fl R Ar num_requests
Damien Miller50677922003-05-23 18:44:04 +1000235Specify how many requests may be outstanding at any one time.
236Increasing this may slightly improve file transfer speed
237but will increase memory usage.
Damien Miller94717b02008-07-16 21:17:23 +1000238The default is 64 outstanding requests.
Darren Tucker1b0dd172009-10-07 08:37:48 +1100239.It Fl r
240Recursively copy entire directories when uploading and downloading.
241Note that
242.Nm
243does not follow symbolic links encountered in the tree traversal.
Ben Lindstrom6a337632001-09-18 05:47:32 +0000244.It Fl S Ar program
245Name of the
246.Ar program
247to use for the encrypted connection.
248The program must understand
249.Xr ssh 1
250options.
Darren Tucker1f203942003-10-15 15:50:42 +1000251.It Fl s Ar subsystem | sftp_server
252Specifies the SSH2 subsystem or the path for an sftp server
253on the remote host.
254A path is useful for using
255.Nm
256over protocol version 1, or when the remote
257.Xr sshd 8
258does not have an sftp subsystem configured.
259.It Fl v
260Raise logging level.
261This option is also passed to ssh.
Damien Miller33804262001-02-04 23:20:18 +1100262.El
263.Sh INTERACTIVE COMMANDS
Damien Millerd7686fd2001-02-10 00:40:03 +1100264Once in interactive mode,
265.Nm
Ben Lindstrom24643222001-06-25 05:08:11 +0000266understands a set of commands similar to those of
Damien Miller33804262001-02-04 23:20:18 +1100267.Xr ftp 1 .
Darren Tucker16e254d2004-12-06 22:46:45 +1100268Commands are case insensitive.
269Pathnames that contain spaces must be enclosed in quotes.
270Any special characters contained within pathnames that are recognized by
271.Xr glob 3
272must be escaped with backslashes
273.Pq Sq \e .
274.Bl -tag -width Ds
Ben Lindstrom59e12492001-08-15 23:22:56 +0000275.It Ic bye
Damien Miller50677922003-05-23 18:44:04 +1000276Quit
277.Nm sftp .
Damien Millerd7686fd2001-02-10 00:40:03 +1100278.It Ic cd Ar path
Ben Lindstrom24643222001-06-25 05:08:11 +0000279Change remote directory to
Damien Millerd7686fd2001-02-10 00:40:03 +1100280.Ar path .
Damien Millerd7686fd2001-02-10 00:40:03 +1100281.It Ic chgrp Ar grp Ar path
Ben Lindstrom24643222001-06-25 05:08:11 +0000282Change group of file
Damien Millerd7686fd2001-02-10 00:40:03 +1100283.Ar path
284to
Damien Miller33804262001-02-04 23:20:18 +1100285.Ar grp .
Darren Tucker16e254d2004-12-06 22:46:45 +1100286.Ar path
287may contain
288.Xr glob 3
289characters and may match multiple files.
Damien Miller33804262001-02-04 23:20:18 +1100290.Ar grp
Damien Millerd7686fd2001-02-10 00:40:03 +1100291must be a numeric GID.
292.It Ic chmod Ar mode Ar path
Ben Lindstrom24643222001-06-25 05:08:11 +0000293Change permissions of file
Damien Millerd7686fd2001-02-10 00:40:03 +1100294.Ar path
295to
296.Ar mode .
Darren Tucker16e254d2004-12-06 22:46:45 +1100297.Ar path
298may contain
299.Xr glob 3
300characters and may match multiple files.
Damien Millerd7686fd2001-02-10 00:40:03 +1100301.It Ic chown Ar own Ar path
Ben Lindstrom24643222001-06-25 05:08:11 +0000302Change owner of file
Damien Millerd7686fd2001-02-10 00:40:03 +1100303.Ar path
304to
Damien Miller33804262001-02-04 23:20:18 +1100305.Ar own .
Darren Tucker16e254d2004-12-06 22:46:45 +1100306.Ar path
307may contain
308.Xr glob 3
309characters and may match multiple files.
Damien Miller33804262001-02-04 23:20:18 +1100310.Ar own
311must be a numeric UID.
Damien Millerd671e5a2008-05-19 14:53:33 +1000312.It Xo Ic df
313.Op Fl hi
314.Op Ar path
315.Xc
316Display usage information for the filesystem holding the current directory
317(or
318.Ar path
319if specified).
320If the
321.Fl h
322flag is specified, the capacity information will be displayed using
323"human-readable" suffixes.
324The
325.Fl i
326flag requests display of inode information in addition to capacity information.
327This command is only supported on servers that implement the
328.Dq statvfs@openssh.com
329extension.
Ben Lindstromc9b6eab2001-03-07 01:29:17 +0000330.It Ic exit
Damien Miller50677922003-05-23 18:44:04 +1000331Quit
332.Nm sftp .
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000333.It Xo Ic get
Darren Tucker1b0dd172009-10-07 08:37:48 +1100334.Op Fl Ppr
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000335.Ar remote-path
336.Op Ar local-path
337.Xc
Damien Miller33804262001-02-04 23:20:18 +1100338Retrieve the
Damien Millerd7686fd2001-02-10 00:40:03 +1100339.Ar remote-path
Damien Miller33804262001-02-04 23:20:18 +1100340and store it on the local machine.
341If the local
Ben Lindstrom24643222001-06-25 05:08:11 +0000342path name is not specified, it is given the same name it has on the
Damien Miller50677922003-05-23 18:44:04 +1000343remote machine.
Darren Tucker16e254d2004-12-06 22:46:45 +1100344.Ar remote-path
345may contain
346.Xr glob 3
347characters and may match multiple files.
348If it does and
349.Ar local-path
350is specified, then
351.Ar local-path
352must specify a directory.
Darren Tucker1b0dd172009-10-07 08:37:48 +1100353.Pp
Darren Tuckerb3b40a82009-10-07 08:39:09 +1100354If either the
Darren Tucker05016b22009-10-07 08:38:23 +1100355.Fl P
Darren Tucker1b0dd172009-10-07 08:37:48 +1100356or
357.Fl p
Darren Tucker16e254d2004-12-06 22:46:45 +1100358flag is specified, then full file permissions and access times are
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000359copied too.
Darren Tucker1b0dd172009-10-07 08:37:48 +1100360.Pp
361If the
362.Fl r
363flag is specified then directories will be copied recursively.
364Note that
365.Nm
366does not follow symbolic links when performing recursive transfers.
Ben Lindstromc9b6eab2001-03-07 01:29:17 +0000367.It Ic help
368Display help text.
Darren Tucker1f203942003-10-15 15:50:42 +1000369.It Ic lcd Ar path
370Change local directory to
371.Ar path .
Damien Millerd7686fd2001-02-10 00:40:03 +1100372.It Ic lls Op Ar ls-options Op Ar path
Ben Lindstrom24643222001-06-25 05:08:11 +0000373Display local directory listing of either
Damien Miller33804262001-02-04 23:20:18 +1100374.Ar path
375or current directory if
376.Ar path
Damien Millerd7686fd2001-02-10 00:40:03 +1100377is not specified.
Darren Tucker16e254d2004-12-06 22:46:45 +1100378.Ar ls-options
379may contain any flags supported by the local system's
380.Xr ls 1
381command.
382.Ar path
383may contain
384.Xr glob 3
385characters and may match multiple files.
Damien Millerd7686fd2001-02-10 00:40:03 +1100386.It Ic lmkdir Ar path
Damien Miller33804262001-02-04 23:20:18 +1100387Create local directory specified by
Damien Millerd7686fd2001-02-10 00:40:03 +1100388.Ar path .
Damien Miller058316f2001-03-08 10:08:49 +1100389.It Ic ln Ar oldpath Ar newpath
Ben Lindstrom24643222001-06-25 05:08:11 +0000390Create a symbolic link from
Damien Miller058316f2001-03-08 10:08:49 +1100391.Ar oldpath
392to
393.Ar newpath .
Damien Millerd7686fd2001-02-10 00:40:03 +1100394.It Ic lpwd
395Print local working directory.
Damien Millere1a49812002-09-12 09:54:25 +1000396.It Xo Ic ls
Darren Tucker16e254d2004-12-06 22:46:45 +1100397.Op Fl 1aflnrSt
Damien Millere1a49812002-09-12 09:54:25 +1000398.Op Ar path
399.Xc
Darren Tucker16e254d2004-12-06 22:46:45 +1100400Display a remote directory listing of either
Damien Miller33804262001-02-04 23:20:18 +1100401.Ar path
Darren Tucker16e254d2004-12-06 22:46:45 +1100402or the current directory if
Damien Miller33804262001-02-04 23:20:18 +1100403.Ar path
Damien Miller50677922003-05-23 18:44:04 +1000404is not specified.
Darren Tucker16e254d2004-12-06 22:46:45 +1100405.Ar path
406may contain
407.Xr glob 3
408characters and may match multiple files.
Darren Tucker15ca6e82004-06-22 13:08:21 +1000409.Pp
Darren Tucker16e254d2004-12-06 22:46:45 +1100410The following flags are recognized and alter the behaviour of
Darren Tucker15ca6e82004-06-22 13:08:21 +1000411.Ic ls
Darren Tucker16e254d2004-12-06 22:46:45 +1100412accordingly:
413.Bl -tag -width Ds
414.It Fl 1
415Produce single columnar output.
416.It Fl a
417List files beginning with a dot
418.Pq Sq \&. .
419.It Fl f
420Do not sort the listing.
421The default sort order is lexicographical.
422.It Fl l
423Display additional details including permissions
424and ownership information.
425.It Fl n
426Produce a long listing with user and group information presented
427numerically.
428.It Fl r
429Reverse the sort order of the listing.
430.It Fl S
431Sort the listing by file size.
432.It Fl t
433Sort the listing by last modification time.
434.El
Damien Millerd7686fd2001-02-10 00:40:03 +1100435.It Ic lumask Ar umask
Ben Lindstrom24643222001-06-25 05:08:11 +0000436Set local umask to
Damien Millerd7686fd2001-02-10 00:40:03 +1100437.Ar umask .
438.It Ic mkdir Ar path
439Create remote directory specified by
440.Ar path .
Damien Miller62d57f62003-01-10 21:43:24 +1100441.It Ic progress
442Toggle display of progress meter.
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000443.It Xo Ic put
Darren Tucker05016b22009-10-07 08:38:23 +1100444.Op Fl Ppr
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000445.Ar local-path
Ben Lindstromd5767812002-12-23 02:23:37 +0000446.Op Ar remote-path
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000447.Xc
Damien Miller33804262001-02-04 23:20:18 +1100448Upload
Damien Millerd7686fd2001-02-10 00:40:03 +1100449.Ar local-path
Damien Miller50677922003-05-23 18:44:04 +1000450and store it on the remote machine.
451If the remote path name is not specified, it is given the same name it has
452on the local machine.
Darren Tucker16e254d2004-12-06 22:46:45 +1100453.Ar local-path
454may contain
455.Xr glob 3
456characters and may match multiple files.
457If it does and
458.Ar remote-path
459is specified, then
460.Ar remote-path
461must specify a directory.
Darren Tucker1b0dd172009-10-07 08:37:48 +1100462.Pp
463If ether the
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000464.Fl P
Darren Tucker1b0dd172009-10-07 08:37:48 +1100465or
466.Fl p
467flag is specified, then full file permissions and access times are
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000468copied too.
Darren Tucker1b0dd172009-10-07 08:37:48 +1100469.Pp
470If the
471.Fl r
472flag is specified then directories will be copied recursively.
473Note that
474.Nm
475does not follow symbolic links when performing recursive transfers.
Damien Millerd7686fd2001-02-10 00:40:03 +1100476.It Ic pwd
477Display remote working directory.
Damien Millerd7686fd2001-02-10 00:40:03 +1100478.It Ic quit
Damien Miller50677922003-05-23 18:44:04 +1000479Quit
480.Nm sftp .
Damien Millerd7686fd2001-02-10 00:40:03 +1100481.It Ic rename Ar oldpath Ar newpath
Damien Miller33804262001-02-04 23:20:18 +1100482Rename remote file from
483.Ar oldpath
484to
Damien Millerd7686fd2001-02-10 00:40:03 +1100485.Ar newpath .
Damien Millerd7686fd2001-02-10 00:40:03 +1100486.It Ic rm Ar path
Damien Miller33804262001-02-04 23:20:18 +1100487Delete remote file specified by
Damien Millerd7686fd2001-02-10 00:40:03 +1100488.Ar path .
Darren Tucker1f203942003-10-15 15:50:42 +1000489.It Ic rmdir Ar path
490Remove remote directory specified by
491.Ar path .
Damien Miller058316f2001-03-08 10:08:49 +1100492.It Ic symlink Ar oldpath Ar newpath
Ben Lindstrom24643222001-06-25 05:08:11 +0000493Create a symbolic link from
Damien Miller058316f2001-03-08 10:08:49 +1100494.Ar oldpath
495to
496.Ar newpath .
Damien Miller63421802003-01-08 14:05:23 +1100497.It Ic version
498Display the
499.Nm
500protocol version.
Damien Miller62fd18a2009-01-28 16:14:09 +1100501.It Ic \&! Ns Ar command
Ben Lindstrom24643222001-06-25 05:08:11 +0000502Execute
Damien Miller33804262001-02-04 23:20:18 +1100503.Ar command
Damien Millerd7686fd2001-02-10 00:40:03 +1100504in local shell.
Damien Millerc2b98272003-09-03 12:13:30 +1000505.It Ic \&!
Damien Millerd7686fd2001-02-10 00:40:03 +1100506Escape to local shell.
Damien Millerc2b98272003-09-03 12:13:30 +1000507.It Ic \&?
Damien Millerd7686fd2001-02-10 00:40:03 +1100508Synonym for help.
509.El
Damien Miller33804262001-02-04 23:20:18 +1100510.Sh SEE ALSO
Darren Tucker1f203942003-10-15 15:50:42 +1000511.Xr ftp 1 ,
Darren Tucker16e254d2004-12-06 22:46:45 +1100512.Xr ls 1 ,
Ben Lindstrom160ec622001-04-22 17:17:46 +0000513.Xr scp 1 ,
Damien Miller33804262001-02-04 23:20:18 +1100514.Xr ssh 1 ,
515.Xr ssh-add 1 ,
516.Xr ssh-keygen 1 ,
Darren Tucker16e254d2004-12-06 22:46:45 +1100517.Xr glob 3 ,
Ben Lindstrom3072aae2002-06-21 01:02:39 +0000518.Xr ssh_config 5 ,
Ben Lindstrom160ec622001-04-22 17:17:46 +0000519.Xr sftp-server 8 ,
520.Xr sshd 8
521.Rs
Ben Lindstrom90fd0602001-06-25 04:45:33 +0000522.%A T. Ylonen
523.%A S. Lehtinen
Ben Lindstrom160ec622001-04-22 17:17:46 +0000524.%T "SSH File Transfer Protocol"
525.%N draft-ietf-secsh-filexfer-00.txt
526.%D January 2001
527.%O work in progress material
528.Re