Shrink the keepalive-timeout box so the text beside it can all fit in
[sgt/putty] / doc / pscp.but
CommitLineData
116934a6 1\versionid $Id: pscp.but,v 1.7 2001/01/31 00:28:11 owen Exp $
768ada0c 2
3\#FIXME: Need examples, index entries, links
4
e5b0d077 5\C{pscp} Using PSCP to transfer files securely
6
7\# Explain PSCP: the command line, the modes of use (local->remote
8\# and remote->local, recursive, wildcards).
9
ffd64114 10\i{PSCP}, the PuTTY Secure Copy client, is a tool for transferring files
768ada0c 11securely between computers using an SSH connection.
12
13\H{pscp-starting} Starting PSCP
14
15PSCP is a command line application. This means that you cannot just
16double-click on its icon to run it and instead you have to bring up a
ffd64114 17\i{console window}. With Windows 95, 98, and ME, this is called an
768ada0c 18\q{MS-DOS Prompt} and with Windows NT and 2000 it is called a
19\q{Command Prompt}. It should be available from the Programs section
20of your Start Menu.
21
ffd64114 22To start PSCP it will need either to be on your \i{\c{PATH}} or in your
768ada0c 23current directory. To add the directory containing PSCP to your
24\c{PATH} environment variable, type into the console window:
25
26\c set PATH C:\path\to\putty\directory;%PATH%
27
e35b2951 28This will only work for the lifetime of that particular console
29window. To set your \c{PATH} more permanently on Windows NT, use the
30Environment tab of the System Control Panel. On Windows 95, 98, and
31ME, you will need to edit your \c{AUTOEXEC.BAT} to include a \c{set}
32command like the one above.
768ada0c 33
34\H{pscp-usage} PSCP Usage
35
36Once you've got a console window to type into, you can just type
37\c{pscp} on its own to bring up a usage message. This tells you the
38version of PSCP you're using, and gives you a brief summary of how to
39use PSCP:
40
41\c Z:\owendadmin>pscp
42\c PuTTY Secure Copy client
43\c Release 0.50
44\c Usage: pscp [options] [user@]host:source target
45\c pscp [options] source [source...] [user@]host:target
46\c pscp [options] -ls user@host:filespec
47\c Options:
48\c -p preserve file attributes
49\c -q quiet, don't show statistics
50\c -r copy directories recursively
51\c -v show verbose messages
52\c -P port connect to specified port
53\c -pw passw login with specified password
54
55(PSCP's interface is much like the Unix \c{scp} command, if you're
56familiar with that.)
57
58\S{pscp-usage-basics} The basics
59
60To receive (a) file(s) from a remote server:
61
62\c{pscp [options] [user@]host:source target}
63
64To send (a) file(s) to a remote server:
65
66\c{pscp [options] source [source...] [user@]host:target}
67
ffd64114 68\S2{pscp-usage-basics-user} \c{user}
69
70The login name on the remote server. If this is omitted, and \c{host}
71is a PuTTY saved session, PSCP will use any username specified by that
72saved session. Otherwise, PSCP will attempt to use the local Windows
73username.
74
75\S2{pscp-usage-basics-host} \c{host}
76
77The name of the remote server, or the name of an existing PuTTY saved
78session. In the latter case, the session's settings for hostname, port
79number, cipher type and username will be used.
768ada0c 80
ffd64114 81\S2{pscp-usage-basics-source} \c{source}
768ada0c 82
ffd64114 83One or more source files. \i{Wildcards} are allowed. The syntax of
84wildcards depends on the system to which they apply, so if you are
85copying \e{from} a Windows system \e{to} a UNIX system, you should use
116934a6 86Windows wildcard syntax (e.g. \c{*.*}), but if you are copying \e{from}
ffd64114 87a UNIX system \e{to} a Windows system, you would use the wildcard
88syntax allowed by your UNIX shell (e.g. \c{*}).
768ada0c 89
ffd64114 90\S2{pscp-usage-basics-target} \c{target}
768ada0c 91
ffd64114 92The filename or directory to put the file(s).
768ada0c 93
94\S{pscp-usage-options} Options
95
ffd64114 96These are the command line options that PSCP accepts.
768ada0c 97
98\S2{pscp-usage-options-p}\c{-p} preserve file attributes
99
ffd64114 100By default, files copied with PSCP are \i{timestamp}ed with the date and
768ada0c 101time they were copied. The \c{-p} option preserves the original
102timestamp on copied files.
103
ffd64114 104\S2{pscp-usage-options-q}\c{-q} quiet, don't show \i{statistics}
768ada0c 105
106By default, PSCP displays a meter displaying the progress of the
107current transfer:
108
109\c mibs.tar | 168 kB | 84.0 kB/s | ETA: 00:00:13 | 13%
110
111The fields in this display are (from left to right), filename, size
112(in kilobytes) of file transferred so far, estimate of how fast the
113file is being transferred (in kilobytes per second), estimated time
114that the transfer will be complete, and percentage of the file so far
115transferred. The \c{-q} option to PSCP suppresses the printing of
116these statistics.
117
ffd64114 118\S2{pscp-usage-options-r}\c{-r} copies directories \i{recursive}ly
768ada0c 119
b3fa9b5e 120By default, PSCP will only copy files. Any directories you specify to
121copy will be skipped, as will their contents. The \c{-r} option tells
122PSCP to descend into any directories you specify, and to copy them and
123their contents. This allows you to use PSCP to transfer whole
124directory structures between machines.
125
ffd64114 126\S2{pscp-usage-options-v}\c{-v} show \i{verbose} messages
768ada0c 127
128The \c{-v} option to PSCP makes it print extra information about the
129file transfer. For example:
130
131\c Logging in as "fred".
132\c fred@example.com's password:
133\c Sending command: scp -v -f mibs.tar
134\c Connected to example.com
135\c Sending file modes: C0644 1320960 mibs.tar
136\c mibs.tar | 1290 kB | 67.9 kB/s | ETA: 00:00:00 | 100%
137\c Remote exit status 0
138\c Closing connection
139
140This information may be useful for debugging problems with PSCP.
141
ffd64114 142\S2{pscp-usage-options-P}\c{-P port} connect to specified \i{port}
768ada0c 143
d8507d01 144If the \c{host} you specify is a saved session, PSCP uses any port
b3fa9b5e 145number specified in that saved session. If not, PSCP uses the default
146SSH port, 22. The \c{-P} option allows you specify the port number to
147connect to for PSCP's SSH connection.
768ada0c 148
ffd64114 149\S2{pscp-usage-options-pw}\c{-pw passw} login with specified \i{password}
768ada0c 150
d8507d01 151If a password is required to connect to the \c{host}, PSCP will
152interactively prompt you for it. However, this may not always be
153appropriate. If you are running PSCP as part of some automated job,
b3fa9b5e 154it will not be possible to enter a password by hand. The \c{-pw}
d8507d01 155option to PSCP lets you specify the password to use on the command
156line.
157
158Since specifying passwords in scripts is a bad idea for security
159reasons, you might want instead to consider using public-key
b3fa9b5e 160authentication (see \k{pubkey}). PSCP will attempt to authenticate
ffd64114 161with any key specified in a saved session's configuration or with a
162key stored in Pageant (see \k{pageant}) before asking for a password.
768ada0c 163
ffd64114 164\H{pscp-ixplorer} \i{Secure iXplorer}
768ada0c 165
166Lars Gunnarson has written a graphical interface for PSCP. You can
167get it from his web site, at
168\W{http://www.i-tree.org/}{www.i-tree.org}.