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