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