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