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