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