Firstly, PSCP can use PuTTY saved sessions in place of hostnames (see
section 5.2.1.2
). So you would do this:
•Run PuTTY, and create a PuTTY saved session (see
section 4.1.2
) which specifies your private key file (see
section 4.21.8
).
You will probably also want to specify a username to log in as (see
section 4.14.1
).
•In PSCP, you can now use the name of the session instead of a hostname: type pscp sessionname:file localfile, where sessionname is replaced by the name of your saved session.
Secondly, you can supply the name of a private key file on the command line, with the -i option. See
section 3.8.3.18
for more
information.
Thirdly, PSCP will attempt to authenticate using Pageant if Pageant is running (see
chapter 9
). So you would do this:
•Ensure Pageant is running, and has your private key stored in it.
•Specify a user and host name to PSCP as normal. PSCP will automatically detect Pageant and try to use the keys within it.
For more general information on public-key authentication, see
chapter 8
.
Chapter 6: Using PSFTP to transfer files securely
PSFTP, the PuTTY SFTP client, is a tool for transferring files securely between computers using an SSH connection.
PSFTP differs from PSCP in the following ways:
•PSCP should work on virtually every SSH server. PSFTP uses the new SFTP protocol, which is a feature of SSH-2 only. (PSCP will also use this protocol if it can, but there is an SSH-1 equivalent it can fall back to if it cannot.)
•PSFTP allows you to run an interactive file transfer session, much like the Windows ftp program. You can list the contents of directories, browse around the file system, issue multiple get and put commands, and eventually log out. By contrast, PSCP is designed to do a single file transfer operation and immediately terminate.
•
6.1 Starting PSFTP
o
6.1.1 -b: specify a file containing batch commands
o
6.1.2 -bc: display batch commands as they are run
o
6.1.3 -be: continue batch processing on errors
o
6.1.4 -batch: avoid interactive prompts
•
6.2 Running PSFTP
o
6.2.1 General quoting rules for PSFTP commands
o
6.2.2 Wildcards in PSFTP
o
6.2.3 The open command: start a session
o
6.2.4 The quit command: end your session
o
6.2.5 The close command: close your connection
o
6.2.6 The help command: get quick online help
o
6.2.7 The cd and pwd commands: changing the remote working directory
o
6.2.8 The lcd and lpwd commands: changing the local working directory
o
6.2.9 The get command: fetch a file from the server
o
6.2.10 The put command: send a file to the server
o
6.2.11 The mget and mput commands: fetch or send multiple files
o
6.2.12 The reget and reput commands: resuming file transfers
o
6.2.13 The dir command: list remote files
o
6.2.14 The chmod command: change permissions on remote files
o
6.2.15 The del command: delete remote files
o
6.2.16 The mkdir command: create remote directories
o
6.2.17 The rmdir command: remove remote directories
o
6.2.18 The mv command: move and rename remote files
o
6.2.19 The ! command: run a local Windows command
•
6.3 Using public key authentication with PSFTP
6.1 Starting PSFTP