]> andersk Git - openssh.git/blame - sftp.1
- markus@cvs.openbsd.org 2001/08/30 22:22:32
[openssh.git] / sftp.1
CommitLineData
38539909 1.\" $OpenBSD: sftp.1,v 1.23 2001/08/14 17:54:29 stevesk Exp $
61e96248 2.\"
f3c7c613 3.\" Copyright (c) 2001 Damien Miller. All rights reserved.
61e96248 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.\"
317611b5 25.Dd February 4, 2001
61e96248 26.Dt SFTP 1
27.Os
28.Sh NAME
29.Nm sftp
e68225b2 30.Nd Secure file transfer program
61e96248 31.Sh SYNOPSIS
32.Nm sftp
0426a3b4 33.Op Fl vC
a5ec8a3d 34.Op Fl b Ar batchfile
61e96248 35.Op Fl o Ar ssh_option
edeeab1e 36.Op Ar host
37.Nm sftp
38.Op [\fIuser\fR@]\fIhost\fR[:\fIfile\fR [\fIfile\fR]]
39.Nm sftp
3730bb22 40.Op [\fIuser\fR@]\fIhost\fR[:\fIdir\fR[\fI/\fR]]
61e96248 41.Sh DESCRIPTION
42.Nm
43is an interactive file transfer program, similar to
44.Xr ftp 1 ,
45which performs all operations over an encrypted
46.Xr ssh 1
47transport.
48It may also use many features of ssh, such as public key authentication and
49compression.
50.Nm
51connects and logs into the specified
cf7ff074 52.Ar host ,
61e96248 53then enters an interactive command mode.
54.Pp
3730bb22 55The second usage format will retrieve files automatically if a non-interactive
cf7ff074 56authentication method is used; otherwise it will do so after
57successful interactive authentication.
edeeab1e 58.Pp
59The last usage format allows the sftp client to start in a remote directory.
60.Pp
61e96248 61The options are as follows:
62.Bl -tag -width Ds
a5ec8a3d 63.It Fl b Ar batchfile
64Batch mode reads a series of commands from an input
acf06a60 65.Ar batchfile
a5ec8a3d 66instead of
acf06a60 67.Em stdin .
68Since it lacks user interaction it should be used in conjunction with
69non-interactive authentication.
70.Nm
3730bb22 71will abort if any of the following
72commands fail:
acf06a60 73.Ic get , put , rename , ln , rm , mkdir , chdir , lchdir
a5ec8a3d 74and
acf06a60 75.Ic lmkdir .
17910dce 76.It Fl C
3730bb22 77Enables compression (via ssh's
17910dce 78.Fl C
79flag)
61e96248 80.It Fl o Ar ssh_option
38539909 81Can be used to pass options to
82.Nm ssh
83in the format used in the
84.Xr ssh 1
85configuration file. This is useful for specifying options
86for which there is no separate
87.Nm sftp
88command-line flag. For example, to force the use of protocol
89version 1 you may specify
90.Ic sftp -oProtocol=1 .
17910dce 91.It Fl v
92Raise logging level. This option is also passed to ssh.
61e96248 93.El
94.Sh INTERACTIVE COMMANDS
0426a3b4 95Once in interactive mode,
96.Nm
3730bb22 97understands a set of commands similar to those of
61e96248 98.Xr ftp 1 .
a0e6fead 99Commands are case insensitive and pathnames may be enclosed in quotes if they
100contain spaces.
61e96248 101.Bl -tag -width Ds
68874d2b 102.It Ic bye
103Quit sftp.
0426a3b4 104.It Ic cd Ar path
3730bb22 105Change remote directory to
0426a3b4 106.Ar path .
107.It Ic lcd Ar path
3730bb22 108Change local directory to
0426a3b4 109.Ar path .
110.It Ic chgrp Ar grp Ar path
3730bb22 111Change group of file
0426a3b4 112.Ar path
113to
61e96248 114.Ar grp .
115.Ar grp
0426a3b4 116must be a numeric GID.
117.It Ic chmod Ar mode Ar path
3730bb22 118Change permissions of file
0426a3b4 119.Ar path
120to
121.Ar mode .
122.It Ic chown Ar own Ar path
3730bb22 123Change owner of file
0426a3b4 124.Ar path
125to
61e96248 126.Ar own .
127.Ar own
128must be a numeric UID.
17910dce 129.It Ic exit
130Quit sftp.
58c54a79 131.It Xo Ic get
132.Op Ar flags
133.Ar remote-path
134.Op Ar local-path
135.Xc
61e96248 136Retrieve the
0426a3b4 137.Ar remote-path
61e96248 138and store it on the local machine.
139If the local
3730bb22 140path name is not specified, it is given the same name it has on the
141remote machine. If the
58c54a79 142.Fl P
143flag is specified, then the file's full permission and access time are
144copied too.
17910dce 145.It Ic help
146Display help text.
0426a3b4 147.It Ic lls Op Ar ls-options Op Ar path
3730bb22 148Display local directory listing of either
61e96248 149.Ar path
150or current directory if
151.Ar path
0426a3b4 152is not specified.
153.It Ic lmkdir Ar path
61e96248 154Create local directory specified by
0426a3b4 155.Ar path .
3a7fe5ba 156.It Ic ln Ar oldpath Ar newpath
3730bb22 157Create a symbolic link from
3a7fe5ba 158.Ar oldpath
159to
160.Ar newpath .
0426a3b4 161.It Ic lpwd
162Print local working directory.
163.It Ic ls Op Ar path
61e96248 164Display remote directory listing of either
165.Ar path
0426a3b4 166or current directory if
167.Ar path
168is not specified.
169.It Ic lumask Ar umask
3730bb22 170Set local umask to
0426a3b4 171.Ar umask .
172.It Ic mkdir Ar path
61e96248 173Create remote directory specified by
0426a3b4 174.Ar path .
58c54a79 175.It Xo Ic put
176.Op Ar flags
177.Ar local-path
178.Op Ar local-path
179.Xc
61e96248 180Upload
0426a3b4 181.Ar local-path
3730bb22 182and store it on the remote machine. If the remote path name is not
183specified, it is given the same name it has on the local machine. If the
58c54a79 184.Fl P
185flag is specified, then the file's full permission and access time are
186copied too.
0426a3b4 187.It Ic pwd
188Display remote working directory.
0426a3b4 189.It Ic quit
190Quit sftp.
191.It Ic rename Ar oldpath Ar newpath
61e96248 192Rename remote file from
193.Ar oldpath
194to
0426a3b4 195.Ar newpath .
196.It Ic rmdir Ar path
61e96248 197Remove remote directory specified by
0426a3b4 198.Ar path .
199.It Ic rm Ar path
61e96248 200Delete remote file specified by
0426a3b4 201.Ar path .
3a7fe5ba 202.It Ic symlink Ar oldpath Ar newpath
3730bb22 203Create a symbolic link from
3a7fe5ba 204.Ar oldpath
205to
206.Ar newpath .
61e96248 207.It Ic ! Ar command
3730bb22 208Execute
61e96248 209.Ar command
0426a3b4 210in local shell.
61e96248 211.It Ic !
0426a3b4 212Escape to local shell.
213.It Ic ?
214Synonym for help.
215.El
61e96248 216.Sh AUTHORS
217Damien Miller <djm@mindrot.org>
218.Sh SEE ALSO
2cad6cef 219.Xr scp 1 ,
61e96248 220.Xr ssh 1 ,
221.Xr ssh-add 1 ,
222.Xr ssh-keygen 1 ,
2cad6cef 223.Xr sftp-server 8 ,
224.Xr sshd 8
225.Rs
7b518233 226.%A T. Ylonen
227.%A S. Lehtinen
2cad6cef 228.%T "SSH File Transfer Protocol"
229.%N draft-ietf-secsh-filexfer-00.txt
230.%D January 2001
231.%O work in progress material
232.Re
This page took 0.118913 seconds and 5 git commands to generate.