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