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