]>
Commit | Line | Data |
---|---|---|
a96fd7c2 | 1 | .\" $OpenBSD: sftp.1,v 1.27 2002/02/04 21:53:11 djm 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 | |
e3c1c3e6 | 33 | .Op Fl 1Cv |
a5ec8a3d | 34 | .Op Fl b Ar batchfile |
f1278af7 | 35 | .Op Fl F Ar ssh_config |
61e96248 | 36 | .Op Fl o Ar ssh_option |
a96fd7c2 | 37 | .Op Fl P Ar sftp_server path |
e3c1c3e6 | 38 | .Op Fl s Ar subsystem | sftp_server |
39 | .Op Fl S Ar program | |
40 | .Ar host | |
edeeab1e | 41 | .Nm sftp |
42 | .Op [\fIuser\fR@]\fIhost\fR[:\fIfile\fR [\fIfile\fR]] | |
43 | .Nm sftp | |
3730bb22 | 44 | .Op [\fIuser\fR@]\fIhost\fR[:\fIdir\fR[\fI/\fR]] |
61e96248 | 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 | |
cf7ff074 | 56 | .Ar host , |
61e96248 | 57 | then enters an interactive command mode. |
58 | .Pp | |
3730bb22 | 59 | The second usage format will retrieve files automatically if a non-interactive |
cf7ff074 | 60 | authentication method is used; otherwise it will do so after |
61 | successful interactive authentication. | |
edeeab1e | 62 | .Pp |
63 | The last usage format allows the sftp client to start in a remote directory. | |
64 | .Pp | |
61e96248 | 65 | The options are as follows: |
66 | .Bl -tag -width Ds | |
e3c1c3e6 | 67 | .It Fl 1 |
68 | Specify the use of protocol version 1. | |
a96fd7c2 | 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. | |
a5ec8a3d | 75 | .It Fl b Ar batchfile |
76 | Batch mode reads a series of commands from an input | |
acf06a60 | 77 | .Ar batchfile |
a5ec8a3d | 78 | instead of |
acf06a60 | 79 | .Em stdin . |
80 | Since it lacks user interaction it should be used in conjunction with | |
81 | non-interactive authentication. | |
82 | .Nm | |
3730bb22 | 83 | will abort if any of the following |
84 | commands fail: | |
acf06a60 | 85 | .Ic get , put , rename , ln , rm , mkdir , chdir , lchdir |
a5ec8a3d | 86 | and |
acf06a60 | 87 | .Ic lmkdir . |
17910dce | 88 | .It Fl C |
3730bb22 | 89 | Enables compression (via ssh's |
17910dce | 90 | .Fl C |
e3c1c3e6 | 91 | flag). |
f1278af7 | 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 . | |
61e96248 | 98 | .It Fl o Ar ssh_option |
38539909 | 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 | |
e3c1c3e6 | 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. | |
17910dce | 122 | .It Fl v |
123 | Raise logging level. This option is also passed to ssh. | |
61e96248 | 124 | .El |
125 | .Sh INTERACTIVE COMMANDS | |
0426a3b4 | 126 | Once in interactive mode, |
127 | .Nm | |
3730bb22 | 128 | understands a set of commands similar to those of |
61e96248 | 129 | .Xr ftp 1 . |
a0e6fead | 130 | Commands are case insensitive and pathnames may be enclosed in quotes if they |
131 | contain spaces. | |
61e96248 | 132 | .Bl -tag -width Ds |
68874d2b | 133 | .It Ic bye |
134 | Quit sftp. | |
0426a3b4 | 135 | .It Ic cd Ar path |
3730bb22 | 136 | Change remote directory to |
0426a3b4 | 137 | .Ar path . |
138 | .It Ic lcd Ar path | |
3730bb22 | 139 | Change local directory to |
0426a3b4 | 140 | .Ar path . |
141 | .It Ic chgrp Ar grp Ar path | |
3730bb22 | 142 | Change group of file |
0426a3b4 | 143 | .Ar path |
144 | to | |
61e96248 | 145 | .Ar grp . |
146 | .Ar grp | |
0426a3b4 | 147 | must be a numeric GID. |
148 | .It Ic chmod Ar mode Ar path | |
3730bb22 | 149 | Change permissions of file |
0426a3b4 | 150 | .Ar path |
151 | to | |
152 | .Ar mode . | |
153 | .It Ic chown Ar own Ar path | |
3730bb22 | 154 | Change owner of file |
0426a3b4 | 155 | .Ar path |
156 | to | |
61e96248 | 157 | .Ar own . |
158 | .Ar own | |
159 | must be a numeric UID. | |
17910dce | 160 | .It Ic exit |
161 | Quit sftp. | |
58c54a79 | 162 | .It Xo Ic get |
163 | .Op Ar flags | |
164 | .Ar remote-path | |
165 | .Op Ar local-path | |
166 | .Xc | |
61e96248 | 167 | Retrieve the |
0426a3b4 | 168 | .Ar remote-path |
61e96248 | 169 | and store it on the local machine. |
170 | If the local | |
3730bb22 | 171 | path name is not specified, it is given the same name it has on the |
172 | remote machine. If the | |
58c54a79 | 173 | .Fl P |
174 | flag is specified, then the file's full permission and access time are | |
175 | copied too. | |
17910dce | 176 | .It Ic help |
177 | Display help text. | |
0426a3b4 | 178 | .It Ic lls Op Ar ls-options Op Ar path |
3730bb22 | 179 | Display local directory listing of either |
61e96248 | 180 | .Ar path |
181 | or current directory if | |
182 | .Ar path | |
0426a3b4 | 183 | is not specified. |
184 | .It Ic lmkdir Ar path | |
61e96248 | 185 | Create local directory specified by |
0426a3b4 | 186 | .Ar path . |
3a7fe5ba | 187 | .It Ic ln Ar oldpath Ar newpath |
3730bb22 | 188 | Create a symbolic link from |
3a7fe5ba | 189 | .Ar oldpath |
190 | to | |
191 | .Ar newpath . | |
0426a3b4 | 192 | .It Ic lpwd |
193 | Print local working directory. | |
194 | .It Ic ls Op Ar path | |
61e96248 | 195 | Display remote directory listing of either |
196 | .Ar path | |
0426a3b4 | 197 | or current directory if |
198 | .Ar path | |
199 | is not specified. | |
200 | .It Ic lumask Ar umask | |
3730bb22 | 201 | Set local umask to |
0426a3b4 | 202 | .Ar umask . |
203 | .It Ic mkdir Ar path | |
61e96248 | 204 | Create remote directory specified by |
0426a3b4 | 205 | .Ar path . |
58c54a79 | 206 | .It Xo Ic put |
207 | .Op Ar flags | |
208 | .Ar local-path | |
209 | .Op Ar local-path | |
210 | .Xc | |
61e96248 | 211 | Upload |
0426a3b4 | 212 | .Ar local-path |
3730bb22 | 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 | |
58c54a79 | 215 | .Fl P |
216 | flag is specified, then the file's full permission and access time are | |
217 | copied too. | |
0426a3b4 | 218 | .It Ic pwd |
219 | Display remote working directory. | |
0426a3b4 | 220 | .It Ic quit |
221 | Quit sftp. | |
222 | .It Ic rename Ar oldpath Ar newpath | |
61e96248 | 223 | Rename remote file from |
224 | .Ar oldpath | |
225 | to | |
0426a3b4 | 226 | .Ar newpath . |
227 | .It Ic rmdir Ar path | |
61e96248 | 228 | Remove remote directory specified by |
0426a3b4 | 229 | .Ar path . |
230 | .It Ic rm Ar path | |
61e96248 | 231 | Delete remote file specified by |
0426a3b4 | 232 | .Ar path . |
3a7fe5ba | 233 | .It Ic symlink Ar oldpath Ar newpath |
3730bb22 | 234 | Create a symbolic link from |
3a7fe5ba | 235 | .Ar oldpath |
236 | to | |
237 | .Ar newpath . | |
61e96248 | 238 | .It Ic ! Ar command |
3730bb22 | 239 | Execute |
61e96248 | 240 | .Ar command |
0426a3b4 | 241 | in local shell. |
61e96248 | 242 | .It Ic ! |
0426a3b4 | 243 | Escape to local shell. |
244 | .It Ic ? | |
245 | Synonym for help. | |
246 | .El | |
61e96248 | 247 | .Sh AUTHORS |
248 | Damien Miller <djm@mindrot.org> | |
249 | .Sh SEE ALSO | |
2cad6cef | 250 | .Xr scp 1 , |
61e96248 | 251 | .Xr ssh 1 , |
252 | .Xr ssh-add 1 , | |
253 | .Xr ssh-keygen 1 , | |
2cad6cef | 254 | .Xr sftp-server 8 , |
255 | .Xr sshd 8 | |
256 | .Rs | |
7b518233 | 257 | .%A T. Ylonen |
258 | .%A S. Lehtinen | |
2cad6cef | 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 |