PuTTY Secure Copy client

Copying between Windows and Unix server might sometimes be tedious using WinScp tool or other software’s. Here is much better and faster way using pscp command.

For this utility to work, PuTTy needs to be pre-installed.

Usage: pscp [options] [user@]host:source target
pscp [options] source [user@]host:target
pscp [options] -ls [user@]host:filespec

Options:
-V print version information and exit
-pgpfp print PGP key fingerprints and exit
-p preserve file attributes
-q quiet, don’t show statistics
-r copy directories recursively
-v show verbose messages
-load sessname Load settings from saved session
-P port connect to specified port
-l user connect with specified username
-pw passw login with specified password
-1 -2 force use of particular SSH protocol version
-4 -6 force use of IPv4 or IPv6
-C enable compression
-i key private key file for authentication
-noagent disable use of Pageant
-agent enable use of Pageant
-batch disable all interactive prompts
-unsafe allow server-side wildcards (DANGEROUS)
-sftp force use of SFTP protocol
-scp force use of SCP protocol

To Copy a file from our local machine to Linux Box:
C:\Program Files\PuTTY>pscp c:/temp/vi.txt user@hostname:/tmp
user@hostname’s password:type password

To Copy a file from Linux Box to our local machine :
C:\Program Files\PuTTY>pscp user@hostname:/tmp/vi.txt c:/temp/
user@hostname’s password:type password
vi.txt | 0 kB | 0.0 kB/s | ETA: 00:00:00 | 100%

To Copy the Directory use -r option :
C:\Program Files\PuTTY>pscp -r user@hostname:/tmp/vijay c:/temp/
user@hostname’s password:type password

You can pass the password using -pw option
C:\Program Files\PuTTY>pscp -pw password -r user@hostname:/tmp/vijay c:/temp/

Credit goes to my friend Vijayakumar T V for sharing this info.

Advertisements