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