]> andersk Git - openssh.git/blame - sftp.1
- djm@cvs.openbsd.org 2002/02/04 21:53:12
[openssh.git] / sftp.1
CommitLineData
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
47is an interactive file transfer program, similar to
48.Xr ftp 1 ,
49which performs all operations over an encrypted
50.Xr ssh 1
51transport.
52It may also use many features of ssh, such as public key authentication and
53compression.
54.Nm
55connects and logs into the specified
cf7ff074 56.Ar host ,
61e96248 57then enters an interactive command mode.
58.Pp
3730bb22 59The second usage format will retrieve files automatically if a non-interactive
cf7ff074 60authentication method is used; otherwise it will do so after
61successful interactive authentication.
edeeab1e 62.Pp
63The last usage format allows the sftp client to start in a remote directory.
64.Pp
61e96248 65The options are as follows:
66.Bl -tag -width Ds
e3c1c3e6 67.It Fl 1
68Specify the use of protocol version 1.
a96fd7c2 69.It Fl P Ar sftp_server path
70Connect directly to a local
71.Nm sftp-server
72(rather than via
73.Nm ssh )
74This option may be useful in debugging the client and server.
a5ec8a3d 75.It Fl b Ar batchfile
76Batch mode reads a series of commands from an input
acf06a60 77.Ar batchfile
a5ec8a3d 78instead of
acf06a60 79.Em stdin .
80Since it lacks user interaction it should be used in conjunction with
81non-interactive authentication.
82.Nm
3730bb22 83will abort if any of the following
84commands fail:
acf06a60 85.Ic get , put , rename , ln , rm , mkdir , chdir , lchdir
a5ec8a3d 86and
acf06a60 87.Ic lmkdir .
17910dce 88.It Fl C
3730bb22 89Enables compression (via ssh's
17910dce 90.Fl C
e3c1c3e6 91flag).
f1278af7 92.It Fl F Ar ssh_config
93Specifies an alternative
94per-user configuration file for
95.Nm ssh .
96This option is directly passed to
97.Xr ssh 1 .
61e96248 98.It Fl o Ar ssh_option
38539909 99Can be used to pass options to
100.Nm ssh
101in the format used in the
102.Xr ssh 1
103configuration file. This is useful for specifying options
104for which there is no separate
105.Nm sftp
e3c1c3e6 106command-line flag. For example, to specify an alternate
107port use:
108.Ic sftp -oPort=24 .
109.It Fl s Ar subsystem | sftp_server
110Specifies the SSH2 subsystem or the path for an sftp server
111on the remote host. A path is useful for using sftp over
112protocol version 1, or when the remote
113.Nm sshd
114does not have an sftp subsystem configured.
115.It Fl S Ar program
116Name of the
117.Ar program
118to use for the encrypted connection.
119The program must understand
120.Xr ssh 1
121options.
17910dce 122.It Fl v
123Raise logging level. This option is also passed to ssh.
61e96248 124.El
125.Sh INTERACTIVE COMMANDS
0426a3b4 126Once in interactive mode,
127.Nm
3730bb22 128understands a set of commands similar to those of
61e96248 129.Xr ftp 1 .
a0e6fead 130Commands are case insensitive and pathnames may be enclosed in quotes if they
131contain spaces.
61e96248 132.Bl -tag -width Ds
68874d2b 133.It Ic bye
134Quit sftp.
0426a3b4 135.It Ic cd Ar path
3730bb22 136Change remote directory to
0426a3b4 137.Ar path .
138.It Ic lcd Ar path
3730bb22 139Change local directory to
0426a3b4 140.Ar path .
141.It Ic chgrp Ar grp Ar path
3730bb22 142Change group of file
0426a3b4 143.Ar path
144to
61e96248 145.Ar grp .
146.Ar grp
0426a3b4 147must be a numeric GID.
148.It Ic chmod Ar mode Ar path
3730bb22 149Change permissions of file
0426a3b4 150.Ar path
151to
152.Ar mode .
153.It Ic chown Ar own Ar path
3730bb22 154Change owner of file
0426a3b4 155.Ar path
156to
61e96248 157.Ar own .
158.Ar own
159must be a numeric UID.
17910dce 160.It Ic exit
161Quit sftp.
58c54a79 162.It Xo Ic get
163.Op Ar flags
164.Ar remote-path
165.Op Ar local-path
166.Xc
61e96248 167Retrieve the
0426a3b4 168.Ar remote-path
61e96248 169and store it on the local machine.
170If the local
3730bb22 171path name is not specified, it is given the same name it has on the
172remote machine. If the
58c54a79 173.Fl P
174flag is specified, then the file's full permission and access time are
175copied too.
17910dce 176.It Ic help
177Display help text.
0426a3b4 178.It Ic lls Op Ar ls-options Op Ar path
3730bb22 179Display local directory listing of either
61e96248 180.Ar path
181or current directory if
182.Ar path
0426a3b4 183is not specified.
184.It Ic lmkdir Ar path
61e96248 185Create local directory specified by
0426a3b4 186.Ar path .
3a7fe5ba 187.It Ic ln Ar oldpath Ar newpath
3730bb22 188Create a symbolic link from
3a7fe5ba 189.Ar oldpath
190to
191.Ar newpath .
0426a3b4 192.It Ic lpwd
193Print local working directory.
194.It Ic ls Op Ar path
61e96248 195Display remote directory listing of either
196.Ar path
0426a3b4 197or current directory if
198.Ar path
199is not specified.
200.It Ic lumask Ar umask
3730bb22 201Set local umask to
0426a3b4 202.Ar umask .
203.It Ic mkdir Ar path
61e96248 204Create 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 211Upload
0426a3b4 212.Ar local-path
3730bb22 213and store it on the remote machine. If the remote path name is not
214specified, it is given the same name it has on the local machine. If the
58c54a79 215.Fl P
216flag is specified, then the file's full permission and access time are
217copied too.
0426a3b4 218.It Ic pwd
219Display remote working directory.
0426a3b4 220.It Ic quit
221Quit sftp.
222.It Ic rename Ar oldpath Ar newpath
61e96248 223Rename remote file from
224.Ar oldpath
225to
0426a3b4 226.Ar newpath .
227.It Ic rmdir Ar path
61e96248 228Remove remote directory specified by
0426a3b4 229.Ar path .
230.It Ic rm Ar path
61e96248 231Delete remote file specified by
0426a3b4 232.Ar path .
3a7fe5ba 233.It Ic symlink Ar oldpath Ar newpath
3730bb22 234Create a symbolic link from
3a7fe5ba 235.Ar oldpath
236to
237.Ar newpath .
61e96248 238.It Ic ! Ar command
3730bb22 239Execute
61e96248 240.Ar command
0426a3b4 241in local shell.
61e96248 242.It Ic !
0426a3b4 243Escape to local shell.
244.It Ic ?
245Synonym for help.
246.El
61e96248 247.Sh AUTHORS
248Damien 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
This page took 0.203414 seconds and 5 git commands to generate.