]> andersk Git - openssh.git/blame_incremental - sftp.1
- markus@cvs.openbsd.org 2002/02/11 16:21:42
[openssh.git] / sftp.1
... / ...
CommitLineData
1.\" $OpenBSD: sftp.1,v 1.29 2002/02/06 14:22:42 markus Exp $
2.\"
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 February 4, 2001
26.Dt SFTP 1
27.Os
28.Sh NAME
29.Nm sftp
30.Nd Secure file transfer program
31.Sh SYNOPSIS
32.Nm sftp
33.Op Fl vC1
34.Op Fl b Ar batchfile
35.Op Fl o Ar ssh_option
36.Op Fl s Ar subsystem | sftp_server
37.Op Fl B Ar buffer_size
38.Op Fl F Ar ssh_config
39.Op Fl P Ar sftp_server path
40.Op Fl S Ar program
41.Ar host
42.Nm sftp
43.Op [\fIuser\fR@]\fIhost\fR[:\fIfile\fR [\fIfile\fR]]
44.Nm sftp
45.Op [\fIuser\fR@]\fIhost\fR[:\fIdir\fR[\fI/\fR]]
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
57.Ar host ,
58then enters an interactive command mode.
59.Pp
60The second usage format will retrieve files automatically if a non-interactive
61authentication method is used; otherwise it will do so after
62successful interactive authentication.
63.Pp
64The last usage format allows the sftp client to start in a remote directory.
65.Pp
66The options are as follows:
67.Bl -tag -width Ds
68.It Fl b Ar batchfile
69Batch mode reads a series of commands from an input
70.Ar batchfile
71instead of
72.Em stdin .
73Since it lacks user interaction it should be used in conjunction with
74non-interactive authentication.
75.Nm
76will abort if any of the following
77commands fail:
78.Ic get , put , rename , ln , rm , mkdir , chdir , lchdir
79and
80.Ic lmkdir .
81.It Fl o Ar ssh_option
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
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.
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.
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.
128.It Fl 1
129Specify the use of protocol version 1.
130.El
131.Sh INTERACTIVE COMMANDS
132Once in interactive mode,
133.Nm
134understands a set of commands similar to those of
135.Xr ftp 1 .
136Commands are case insensitive and pathnames may be enclosed in quotes if they
137contain spaces.
138.Bl -tag -width Ds
139.It Ic bye
140Quit sftp.
141.It Ic cd Ar path
142Change remote directory to
143.Ar path .
144.It Ic lcd Ar path
145Change local directory to
146.Ar path .
147.It Ic chgrp Ar grp Ar path
148Change group of file
149.Ar path
150to
151.Ar grp .
152.Ar grp
153must be a numeric GID.
154.It Ic chmod Ar mode Ar path
155Change permissions of file
156.Ar path
157to
158.Ar mode .
159.It Ic chown Ar own Ar path
160Change owner of file
161.Ar path
162to
163.Ar own .
164.Ar own
165must be a numeric UID.
166.It Ic exit
167Quit sftp.
168.It Xo Ic get
169.Op Ar flags
170.Ar remote-path
171.Op Ar local-path
172.Xc
173Retrieve the
174.Ar remote-path
175and store it on the local machine.
176If the local
177path name is not specified, it is given the same name it has on the
178remote machine. If the
179.Fl P
180flag is specified, then the file's full permission and access time are
181copied too.
182.It Ic help
183Display help text.
184.It Ic lls Op Ar ls-options Op Ar path
185Display local directory listing of either
186.Ar path
187or current directory if
188.Ar path
189is not specified.
190.It Ic lmkdir Ar path
191Create local directory specified by
192.Ar path .
193.It Ic ln Ar oldpath Ar newpath
194Create a symbolic link from
195.Ar oldpath
196to
197.Ar newpath .
198.It Ic lpwd
199Print local working directory.
200.It Ic ls Op Ar path
201Display remote directory listing of either
202.Ar path
203or current directory if
204.Ar path
205is not specified.
206.It Ic lumask Ar umask
207Set local umask to
208.Ar umask .
209.It Ic mkdir Ar path
210Create remote directory specified by
211.Ar path .
212.It Xo Ic put
213.Op Ar flags
214.Ar local-path
215.Op Ar local-path
216.Xc
217Upload
218.Ar local-path
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
221.Fl P
222flag is specified, then the file's full permission and access time are
223copied too.
224.It Ic pwd
225Display remote working directory.
226.It Ic quit
227Quit sftp.
228.It Ic rename Ar oldpath Ar newpath
229Rename remote file from
230.Ar oldpath
231to
232.Ar newpath .
233.It Ic rmdir Ar path
234Remove remote directory specified by
235.Ar path .
236.It Ic rm Ar path
237Delete remote file specified by
238.Ar path .
239.It Ic symlink Ar oldpath Ar newpath
240Create a symbolic link from
241.Ar oldpath
242to
243.Ar newpath .
244.It Ic ! Ar command
245Execute
246.Ar command
247in local shell.
248.It Ic !
249Escape to local shell.
250.It Ic ?
251Synonym for help.
252.El
253.Sh AUTHORS
254Damien Miller <djm@mindrot.org>
255.Sh SEE ALSO
256.Xr scp 1 ,
257.Xr ssh 1 ,
258.Xr ssh-add 1 ,
259.Xr ssh-keygen 1 ,
260.Xr sftp-server 8 ,
261.Xr sshd 8
262.Rs
263.%A T. Ylonen
264.%A S. Lehtinen
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 0.038197 seconds and 5 git commands to generate.