Friday, July 11, 2008

Using Putty PSCP and PSFTP on Windows

Using Putty PSCP and PSFTP on Windows
  • Using PSCP on Windows


  • C:\> cd "C:\Program Files\PuTTY"

    C:\Program Files\PuTTY> pscp -h # -h gives a short help listing
    ...short help listing displays here...

    C:\Program Files\PuTTY> pscp -P 2003 -l alleni99 \
    net2003.idallen.ca:.bashrc foo.txt
    ...you may be asked to accept the host key here (say yes)...
    alleni99@net2003.idallen.ca's password:
    ...file transfers ".bashrc" to "foo.txt" in the current directory...

    Remember to use the -P option and use -l to set your own userid.

  • Using PSFTP on Windows


C:\> cd "C:\Program Files\PuTTY"

C:\Program Files\PuTTY> psftp -h # -h gives a short help listing
...short help listing displays here...

C:\Program Files\PuTTY> psftp -P 2003 -l alleni99 net2003.idallen.ca
...you may be asked to accept the host key here (say yes)...
alleni99@net2003.idallen.ca's password:
Remote working directory is /home/alleni99
psftp> help
...short help listing displays here...
psftp> ls
...listing of directory displays here...
psftp> get .bashrc foo.txt
remote:/home/alleni99.bashrc => local:foo.txt
psftp> quit
...file "foo.txt" is now in the current directory...

Remember to use the -P option and use -l to set your own userid when
using the PuTTY version of PSFTP.

Note that the options to the PuTTY Windows version of SFTP (named
PSFTP) are not the same as the options to the Unix/Linux version
of SFTP. In particular, the option "-P" has different meanings!



################################### My examples ##########################################################



************* windows:-**********************
From desktop to TESTNET database server:
pscp -P 2222 -l oracle swingbench230376.zip localhost:swingbench230376.zip

pscp -P 2222 -l oracle jre-6u7-solaris-sparc.sh localhost:jre-6u7-solaris-sparc.sh

pscp -P 2222 -l oracle jre-6u7-solaris-sparcv9.sh localhost:jre-6u7-solaris-sparcv9.sh

From TESTNET database server to desktop:
pscp -P 2222 -l oracle localhost:trap_test.ksh trap_test.ksh


C:\Program Files\Putty>pscp -P 2222 -l oracle swingbench230376.zip localhost:swingbench230376.zip
Using keyboard-interactive authentication.
Password:
swingbench230376.zip | 9005 kB | 1500.9 kB/s | ETA: 00:00:00 | 100%



If tunnel not setup correctly then we will get following message:

C:\Program Files\PuTTY>pscp -P 2222 -l oracle swingbench230376.zip localhost:swingbench230376.zip
Fatal: Network error: Connection refused


No comments: