blob: 1c8040f5df1a9e9f367ed3d602e18a4581046e0d [file] [log] [blame]
Ben Lindstrom283cb822001-03-09 00:09:02 +00001.\" $OpenBSD: sftp.1,v 1.13 2001/03/08 20:44:48 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.\"
25.Dd Febuary 4, 2001
26.Dt SFTP 1
27.Os
28.Sh NAME
29.Nm sftp
Damien Miller225736c2001-02-19 21:51:08 +110030.Nd Secure file transfer program
Damien Miller33804262001-02-04 23:20:18 +110031.Sh SYNOPSIS
32.Nm sftp
Damien Millerd7686fd2001-02-10 00:40:03 +110033.Op Fl vC
Ben Lindstrom562c26b2001-03-07 01:26:48 +000034.Op Fl b Ar batchfile
Damien Miller33804262001-02-04 23:20:18 +110035.Op Fl o Ar ssh_option
36.Op Ar hostname | user@hostname
37.Sh DESCRIPTION
38.Nm
39is an interactive file transfer program, similar to
40.Xr ftp 1 ,
41which performs all operations over an encrypted
42.Xr ssh 1
43transport.
44It may also use many features of ssh, such as public key authentication and
45compression.
46.Nm
47connects and logs into the specified
Damien Millerd7686fd2001-02-10 00:40:03 +110048.Ar hostname ,
Damien Miller33804262001-02-04 23:20:18 +110049then enters an interactive command mode.
50.Pp
51The options are as follows:
52.Bl -tag -width Ds
Ben Lindstrom562c26b2001-03-07 01:26:48 +000053.It Fl b Ar batchfile
54Batch mode reads a series of commands from an input
Ben Lindstrom283cb822001-03-09 00:09:02 +000055.Ar batchfile
Ben Lindstrom562c26b2001-03-07 01:26:48 +000056instead of
Ben Lindstrom283cb822001-03-09 00:09:02 +000057.Em stdin .
58Since it lacks user interaction it should be used in conjunction with
59non-interactive authentication.
60.Nm
61will abort if any of the following
Ben Lindstrom562c26b2001-03-07 01:26:48 +000062commands fail:
Ben Lindstrom283cb822001-03-09 00:09:02 +000063.Ic get , put , rename , ln , rm , mkdir , chdir , lchdir
Ben Lindstrom562c26b2001-03-07 01:26:48 +000064and
Ben Lindstrom283cb822001-03-09 00:09:02 +000065.Ic lmkdir .
Ben Lindstromc9b6eab2001-03-07 01:29:17 +000066.It Fl C
67Enables compression (via ssh's
68.Fl C
69flag)
Damien Miller33804262001-02-04 23:20:18 +110070.It Fl o Ar ssh_option
71Specify an option to be directly passed to
72.Xr ssh 1 .
Ben Lindstromc9b6eab2001-03-07 01:29:17 +000073.It Fl v
74Raise logging level. This option is also passed to ssh.
Damien Miller33804262001-02-04 23:20:18 +110075.El
76.Sh INTERACTIVE COMMANDS
Damien Millerd7686fd2001-02-10 00:40:03 +110077Once in interactive mode,
78.Nm
Damien Miller33804262001-02-04 23:20:18 +110079understands a set of commands similar to those of
80.Xr ftp 1 .
Ben Lindstrom27cb1d02001-02-10 21:59:35 +000081Commands are case insensitive and pathnames may be enclosed in quotes if they
82contain spaces.
Damien Miller33804262001-02-04 23:20:18 +110083.Bl -tag -width Ds
Damien Millerd7686fd2001-02-10 00:40:03 +110084.It Ic cd Ar path
Damien Miller33804262001-02-04 23:20:18 +110085Change remote directory to
Damien Millerd7686fd2001-02-10 00:40:03 +110086.Ar path .
87.It Ic lcd Ar path
Damien Miller33804262001-02-04 23:20:18 +110088Change local directory to
Damien Millerd7686fd2001-02-10 00:40:03 +110089.Ar path .
90.It Ic chgrp Ar grp Ar path
Damien Miller33804262001-02-04 23:20:18 +110091Change group of file
Damien Millerd7686fd2001-02-10 00:40:03 +110092.Ar path
93to
Damien Miller33804262001-02-04 23:20:18 +110094.Ar grp .
95.Ar grp
Damien Millerd7686fd2001-02-10 00:40:03 +110096must be a numeric GID.
97.It Ic chmod Ar mode Ar path
Damien Miller33804262001-02-04 23:20:18 +110098Change permissions of file
Damien Millerd7686fd2001-02-10 00:40:03 +110099.Ar path
100to
101.Ar mode .
102.It Ic chown Ar own Ar path
Damien Miller33804262001-02-04 23:20:18 +1100103Change owner of file
Damien Millerd7686fd2001-02-10 00:40:03 +1100104.Ar path
105to
Damien Miller33804262001-02-04 23:20:18 +1100106.Ar own .
107.Ar own
108must be a numeric UID.
Ben Lindstromc9b6eab2001-03-07 01:29:17 +0000109.It Ic exit
110Quit sftp.
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000111.It Xo Ic get
112.Op Ar flags
113.Ar remote-path
114.Op Ar local-path
115.Xc
Damien Miller33804262001-02-04 23:20:18 +1100116Retrieve the
Damien Millerd7686fd2001-02-10 00:40:03 +1100117.Ar remote-path
Damien Miller33804262001-02-04 23:20:18 +1100118and store it on the local machine.
119If the local
Damien Millerd7686fd2001-02-10 00:40:03 +1100120path name is not specified, it is given the same name it has on the
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000121remote machine. If the
122.Fl P
123flag is specified, then the file's full permission and access time are
124copied too.
Ben Lindstromc9b6eab2001-03-07 01:29:17 +0000125.It Ic help
126Display help text.
Damien Millerd7686fd2001-02-10 00:40:03 +1100127.It Ic lls Op Ar ls-options Op Ar path
Damien Miller33804262001-02-04 23:20:18 +1100128Display local directory listing of either
129.Ar path
130or current directory if
131.Ar path
Damien Millerd7686fd2001-02-10 00:40:03 +1100132is not specified.
133.It Ic lmkdir Ar path
Damien Miller33804262001-02-04 23:20:18 +1100134Create local directory specified by
Damien Millerd7686fd2001-02-10 00:40:03 +1100135.Ar path .
Damien Miller058316f2001-03-08 10:08:49 +1100136.It Ic ln Ar oldpath Ar newpath
137Create a symbolic link from
138.Ar oldpath
139to
140.Ar newpath .
Damien Millerd7686fd2001-02-10 00:40:03 +1100141.It Ic lpwd
142Print local working directory.
143.It Ic ls Op Ar path
Damien Miller33804262001-02-04 23:20:18 +1100144Display remote directory listing of either
145.Ar path
Damien Millerd7686fd2001-02-10 00:40:03 +1100146or current directory if
Damien Miller33804262001-02-04 23:20:18 +1100147.Ar path
Damien Millerd7686fd2001-02-10 00:40:03 +1100148is not specified.
149.It Ic lumask Ar umask
150Set local umask to
151.Ar umask .
152.It Ic mkdir Ar path
153Create remote directory specified by
154.Ar path .
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000155.It Xo Ic put
156.Op Ar flags
157.Ar local-path
158.Op Ar local-path
159.Xc
Damien Miller33804262001-02-04 23:20:18 +1100160Upload
Damien Millerd7686fd2001-02-10 00:40:03 +1100161.Ar local-path
Damien Miller058316f2001-03-08 10:08:49 +1100162and store it on the remote machine. If the remote path name is not
163specified, it is given the same name it has on the local machine. If the
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000164.Fl P
165flag is specified, then the file's full permission and access time are
166copied too.
Damien Millerd7686fd2001-02-10 00:40:03 +1100167.It Ic pwd
168Display remote working directory.
Damien Millerd7686fd2001-02-10 00:40:03 +1100169.It Ic quit
170Quit sftp.
171.It Ic rename Ar oldpath Ar newpath
Damien Miller33804262001-02-04 23:20:18 +1100172Rename remote file from
173.Ar oldpath
174to
Damien Millerd7686fd2001-02-10 00:40:03 +1100175.Ar newpath .
176.It Ic rmdir Ar path
Damien Miller33804262001-02-04 23:20:18 +1100177Remove remote directory specified by
Damien Millerd7686fd2001-02-10 00:40:03 +1100178.Ar path .
179.It Ic rm Ar path
Damien Miller33804262001-02-04 23:20:18 +1100180Delete remote file specified by
Damien Millerd7686fd2001-02-10 00:40:03 +1100181.Ar path .
Damien Miller058316f2001-03-08 10:08:49 +1100182.It Ic symlink Ar oldpath Ar newpath
183Create a symbolic link from
184.Ar oldpath
185to
186.Ar newpath .
Damien Miller33804262001-02-04 23:20:18 +1100187.It Ic ! Ar command
188Execute
189.Ar command
Damien Millerd7686fd2001-02-10 00:40:03 +1100190in local shell.
Damien Miller33804262001-02-04 23:20:18 +1100191.It Ic !
Damien Millerd7686fd2001-02-10 00:40:03 +1100192Escape to local shell.
193.It Ic ?
194Synonym for help.
195.El
Damien Miller33804262001-02-04 23:20:18 +1100196.Sh AUTHORS
197Damien Miller <djm@mindrot.org>
198.Sh SEE ALSO
199.Xr ssh 1 ,
Ben Lindstrom283cb822001-03-09 00:09:02 +0000200.Xr sftp-server 8 ,
Damien Miller33804262001-02-04 23:20:18 +1100201.Xr ssh-add 1 ,
202.Xr ssh-keygen 1 ,
Damien Millerd7686fd2001-02-10 00:40:03 +1100203.Xr sshd 8 ,
204.Xr scp 1
205