blob: e1c6960f898317e4b77715f70d5935941e33c59a [file] [log] [blame]
Ben Lindstrom562c26b2001-03-07 01:26:48 +00001.\" $OpenBSD: sftp.1,v 1.10 2001/03/06 06:11:44 deraadt 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
Damien Millerd7686fd2001-02-10 00:40:03 +110053.It Fl v
54Raise logging level. This option is also passed to ssh.
Damien Miller33804262001-02-04 23:20:18 +110055.It Fl C
56Enables compression (via ssh's
57.Fl C
58flag)
Ben Lindstrom562c26b2001-03-07 01:26:48 +000059.It Fl b Ar batchfile
60Batch mode reads a series of commands from an input
61.Fn batchfile
62instead of
63.Fn stdin .
64Since it lacks user interaction it should be used in conjuction with a
65non-interactive authentication. Sftp will abort if any of the following
66commands fail:
67.Pa get, put, rename, rm, mkdir, chdir, lchdir
68and
69.Pa lmkdir.
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 .
73.El
74.Sh INTERACTIVE COMMANDS
Damien Millerd7686fd2001-02-10 00:40:03 +110075Once in interactive mode,
76.Nm
Damien Miller33804262001-02-04 23:20:18 +110077understands a set of commands similar to those of
78.Xr ftp 1 .
Ben Lindstrom27cb1d02001-02-10 21:59:35 +000079Commands are case insensitive and pathnames may be enclosed in quotes if they
80contain spaces.
Damien Miller33804262001-02-04 23:20:18 +110081.Bl -tag -width Ds
Damien Millerd7686fd2001-02-10 00:40:03 +110082.It Ic cd Ar path
Damien Miller33804262001-02-04 23:20:18 +110083Change remote directory to
Damien Millerd7686fd2001-02-10 00:40:03 +110084.Ar path .
85.It Ic lcd Ar path
Damien Miller33804262001-02-04 23:20:18 +110086Change local directory to
Damien Millerd7686fd2001-02-10 00:40:03 +110087.Ar path .
88.It Ic chgrp Ar grp Ar path
Damien Miller33804262001-02-04 23:20:18 +110089Change group of file
Damien Millerd7686fd2001-02-10 00:40:03 +110090.Ar path
91to
Damien Miller33804262001-02-04 23:20:18 +110092.Ar grp .
93.Ar grp
Damien Millerd7686fd2001-02-10 00:40:03 +110094must be a numeric GID.
95.It Ic chmod Ar mode Ar path
Damien Miller33804262001-02-04 23:20:18 +110096Change permissions of file
Damien Millerd7686fd2001-02-10 00:40:03 +110097.Ar path
98to
99.Ar mode .
100.It Ic chown Ar own Ar path
Damien Miller33804262001-02-04 23:20:18 +1100101Change owner of file
Damien Millerd7686fd2001-02-10 00:40:03 +1100102.Ar path
103to
Damien Miller33804262001-02-04 23:20:18 +1100104.Ar own .
105.Ar own
106must be a numeric UID.
Damien Millerd7686fd2001-02-10 00:40:03 +1100107.It Ic help
108Display help text.
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000109.It Xo Ic get
110.Op Ar flags
111.Ar remote-path
112.Op Ar local-path
113.Xc
Damien Miller33804262001-02-04 23:20:18 +1100114Retrieve the
Damien Millerd7686fd2001-02-10 00:40:03 +1100115.Ar remote-path
Damien Miller33804262001-02-04 23:20:18 +1100116and store it on the local machine.
117If the local
Damien Millerd7686fd2001-02-10 00:40:03 +1100118path name is not specified, it is given the same name it has on the
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000119remote machine. If the
120.Fl P
121flag is specified, then the file's full permission and access time are
122copied too.
Damien Millerd7686fd2001-02-10 00:40:03 +1100123.It Ic lls Op Ar ls-options Op Ar path
Damien Miller33804262001-02-04 23:20:18 +1100124Display local directory listing of either
125.Ar path
126or current directory if
127.Ar path
Damien Millerd7686fd2001-02-10 00:40:03 +1100128is not specified.
129.It Ic lmkdir Ar path
Damien Miller33804262001-02-04 23:20:18 +1100130Create local directory specified by
Damien Millerd7686fd2001-02-10 00:40:03 +1100131.Ar path .
132.It Ic lpwd
133Print local working directory.
134.It Ic ls Op Ar path
Damien Miller33804262001-02-04 23:20:18 +1100135Display remote directory listing of either
136.Ar path
Damien Millerd7686fd2001-02-10 00:40:03 +1100137or current directory if
Damien Miller33804262001-02-04 23:20:18 +1100138.Ar path
Damien Millerd7686fd2001-02-10 00:40:03 +1100139is not specified.
140.It Ic lumask Ar umask
141Set local umask to
142.Ar umask .
143.It Ic mkdir Ar path
144Create remote directory specified by
145.Ar path .
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000146.It Xo Ic put
147.Op Ar flags
148.Ar local-path
149.Op Ar local-path
150.Xc
Damien Miller33804262001-02-04 23:20:18 +1100151Upload
Damien Millerd7686fd2001-02-10 00:40:03 +1100152.Ar local-path
153and store it on the remote machine. If the remote path name is not specified,
Ben Lindstrom9d4f2c82001-02-15 03:22:45 +0000154it is given the same name it has on the local machine. If the
155.Fl P
156flag is specified, then the file's full permission and access time are
157copied too.
Damien Millerd7686fd2001-02-10 00:40:03 +1100158.It Ic pwd
159Display remote working directory.
160.It Ic exit
161Quit sftp.
162.It Ic quit
163Quit sftp.
164.It Ic rename Ar oldpath Ar newpath
Damien Miller33804262001-02-04 23:20:18 +1100165Rename remote file from
166.Ar oldpath
167to
Damien Millerd7686fd2001-02-10 00:40:03 +1100168.Ar newpath .
169.It Ic rmdir Ar path
Damien Miller33804262001-02-04 23:20:18 +1100170Remove remote directory specified by
Damien Millerd7686fd2001-02-10 00:40:03 +1100171.Ar path .
172.It Ic rm Ar path
Damien Miller33804262001-02-04 23:20:18 +1100173Delete remote file specified by
Damien Millerd7686fd2001-02-10 00:40:03 +1100174.Ar path .
Damien Miller33804262001-02-04 23:20:18 +1100175.It Ic ! Ar command
176Execute
177.Ar command
Damien Millerd7686fd2001-02-10 00:40:03 +1100178in local shell.
Damien Miller33804262001-02-04 23:20:18 +1100179.It Ic !
Damien Millerd7686fd2001-02-10 00:40:03 +1100180Escape to local shell.
181.It Ic ?
182Synonym for help.
183.El
Damien Miller33804262001-02-04 23:20:18 +1100184.Sh AUTHORS
185Damien Miller <djm@mindrot.org>
186.Sh SEE ALSO
187.Xr ssh 1 ,
188.Xr ssh-add 1 ,
189.Xr ssh-keygen 1 ,
Damien Millerd7686fd2001-02-10 00:40:03 +1100190.Xr sshd 8 ,
191.Xr scp 1
192