blob: 3b9d5124ebf6f331b146c19c89fbee53cf339202 [file] [log] [blame]
Ben Lindstrom27cb1d02001-02-10 21:59:35 +00001.\" $OpenBSD: sftp.1,v 1.6 2001/02/10 00:45:52 djm Exp $
Damien Miller33804262001-02-04 23:20:18 +11002.\"
3.\" Copyright (c) 2001 Damien Miller. All rights reserved.
4.\"
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
30.Nd Secure file tranfer program
31.Sh SYNOPSIS
32.Nm sftp
Damien Millerd7686fd2001-02-10 00:40:03 +110033.Op Fl vC
Damien Miller33804262001-02-04 23:20:18 +110034.Op Fl o Ar ssh_option
35.Op Ar hostname | user@hostname
36.Sh DESCRIPTION
37.Nm
38is an interactive file transfer program, similar to
39.Xr ftp 1 ,
40which performs all operations over an encrypted
41.Xr ssh 1
42transport.
43It may also use many features of ssh, such as public key authentication and
44compression.
45.Nm
46connects and logs into the specified
Damien Millerd7686fd2001-02-10 00:40:03 +110047.Ar hostname ,
Damien Miller33804262001-02-04 23:20:18 +110048then enters an interactive command mode.
49.Pp
50The options are as follows:
51.Bl -tag -width Ds
Damien Millerd7686fd2001-02-10 00:40:03 +110052.It Fl v
53Raise logging level. This option is also passed to ssh.
Damien Miller33804262001-02-04 23:20:18 +110054.It Fl C
55Enables compression (via ssh's
56.Fl C
57flag)
Damien Miller33804262001-02-04 23:20:18 +110058.It Fl o Ar ssh_option
59Specify an option to be directly passed to
60.Xr ssh 1 .
61.El
62.Sh INTERACTIVE COMMANDS
Damien Millerd7686fd2001-02-10 00:40:03 +110063Once in interactive mode,
64.Nm
Damien Miller33804262001-02-04 23:20:18 +110065understands a set of commands similar to those of
66.Xr ftp 1 .
Ben Lindstrom27cb1d02001-02-10 21:59:35 +000067Commands are case insensitive and pathnames may be enclosed in quotes if they
68contain spaces.
Damien Miller33804262001-02-04 23:20:18 +110069.Bl -tag -width Ds
Damien Millerd7686fd2001-02-10 00:40:03 +110070.It Ic cd Ar path
Damien Miller33804262001-02-04 23:20:18 +110071Change remote directory to
Damien Millerd7686fd2001-02-10 00:40:03 +110072.Ar path .
73.It Ic lcd Ar path
Damien Miller33804262001-02-04 23:20:18 +110074Change local directory to
Damien Millerd7686fd2001-02-10 00:40:03 +110075.Ar path .
76.It Ic chgrp Ar grp Ar path
Damien Miller33804262001-02-04 23:20:18 +110077Change group of file
Damien Millerd7686fd2001-02-10 00:40:03 +110078.Ar path
79to
Damien Miller33804262001-02-04 23:20:18 +110080.Ar grp .
81.Ar grp
Damien Millerd7686fd2001-02-10 00:40:03 +110082must be a numeric GID.
83.It Ic chmod Ar mode Ar path
Damien Miller33804262001-02-04 23:20:18 +110084Change permissions of file
Damien Millerd7686fd2001-02-10 00:40:03 +110085.Ar path
86to
87.Ar mode .
88.It Ic chown Ar own Ar path
Damien Miller33804262001-02-04 23:20:18 +110089Change owner of file
Damien Millerd7686fd2001-02-10 00:40:03 +110090.Ar path
91to
Damien Miller33804262001-02-04 23:20:18 +110092.Ar own .
93.Ar own
94must be a numeric UID.
Damien Millerd7686fd2001-02-10 00:40:03 +110095.It Ic help
96Display help text.
97.It Ic get Ar remote-path Op Ar local-path
Damien Miller33804262001-02-04 23:20:18 +110098Retrieve the
Damien Millerd7686fd2001-02-10 00:40:03 +110099.Ar remote-path
Damien Miller33804262001-02-04 23:20:18 +1100100and store it on the local machine.
101If the local
Damien Millerd7686fd2001-02-10 00:40:03 +1100102path name is not specified, it is given the same name it has on the
Damien Miller33804262001-02-04 23:20:18 +1100103remote machine.
Damien Millerd7686fd2001-02-10 00:40:03 +1100104.It Ic lls Op Ar ls-options Op Ar path
Damien Miller33804262001-02-04 23:20:18 +1100105Display local directory listing of either
106.Ar path
107or current directory if
108.Ar path
Damien Millerd7686fd2001-02-10 00:40:03 +1100109is not specified.
110.It Ic lmkdir Ar path
Damien Miller33804262001-02-04 23:20:18 +1100111Create local directory specified by
Damien Millerd7686fd2001-02-10 00:40:03 +1100112.Ar path .
113.It Ic lpwd
114Print local working directory.
115.It Ic ls Op Ar path
Damien Miller33804262001-02-04 23:20:18 +1100116Display remote directory listing of either
117.Ar path
Damien Millerd7686fd2001-02-10 00:40:03 +1100118or current directory if
Damien Miller33804262001-02-04 23:20:18 +1100119.Ar path
Damien Millerd7686fd2001-02-10 00:40:03 +1100120is not specified.
121.It Ic lumask Ar umask
122Set local umask to
123.Ar umask .
124.It Ic mkdir Ar path
125Create remote directory specified by
126.Ar path .
127.It Ic put Ar local-path Op Ar remote-path
Damien Miller33804262001-02-04 23:20:18 +1100128Upload
Damien Millerd7686fd2001-02-10 00:40:03 +1100129.Ar local-path
130and store it on the remote machine. If the remote path name is not specified,
Damien Miller33804262001-02-04 23:20:18 +1100131it is given the same name it has on the local machine.
Damien Millerd7686fd2001-02-10 00:40:03 +1100132.It Ic pwd
133Display remote working directory.
134.It Ic exit
135Quit sftp.
136.It Ic quit
137Quit sftp.
138.It Ic rename Ar oldpath Ar newpath
Damien Miller33804262001-02-04 23:20:18 +1100139Rename remote file from
140.Ar oldpath
141to
Damien Millerd7686fd2001-02-10 00:40:03 +1100142.Ar newpath .
143.It Ic rmdir Ar path
Damien Miller33804262001-02-04 23:20:18 +1100144Remove remote directory specified by
Damien Millerd7686fd2001-02-10 00:40:03 +1100145.Ar path .
146.It Ic rm Ar path
Damien Miller33804262001-02-04 23:20:18 +1100147Delete remote file specified by
Damien Millerd7686fd2001-02-10 00:40:03 +1100148.Ar path .
Damien Miller33804262001-02-04 23:20:18 +1100149.It Ic ! Ar command
150Execute
151.Ar command
Damien Millerd7686fd2001-02-10 00:40:03 +1100152in local shell.
Damien Miller33804262001-02-04 23:20:18 +1100153.It Ic !
Damien Millerd7686fd2001-02-10 00:40:03 +1100154Escape to local shell.
155.It Ic ?
156Synonym for help.
157.El
Damien Miller33804262001-02-04 23:20:18 +1100158.Sh AUTHORS
159Damien Miller <djm@mindrot.org>
160.Sh SEE ALSO
161.Xr ssh 1 ,
162.Xr ssh-add 1 ,
163.Xr ssh-keygen 1 ,
Damien Millerd7686fd2001-02-10 00:40:03 +1100164.Xr sshd 8 ,
165.Xr scp 1
166