t e c h i e – t a l k s ::: technology at its best

technology at its best

t e c h i e  –  t a l k s ::: technology at its best header image 2

How to: Copying Files from Windows to Linux via SSH (vice-versa)

November 12th, 2009 · 1 Comment

I’ve got an e-mail lately from a reader which reads,

“Hey dude, I’ve been looking for a solution to copy files from a remote Windows PC to a Linux PC without installing any free programs. My company only has PuTTY on Windows XP and I can’t seem to use scp like how we usually use it on unix consoles. Thanks a mil! — Ramesh”

Wow. I’ve got readers. LOL.

Anyway Ramesh, a big HI from me and thank you for the question (can’t seem to find good articles to blog these days). You can try Google-ing for the answer but seems like not many have the right answer.

Nonetheless,  yours truely have a simple solution. You won’t need PuTTY for this but you’d probably need firewall permissions to allow a similar program (which is just an executable – hence no installation) through to the network. This program is called PSCP. Download the executable (.exe) from the link and launch your command line. Get to the working directory where you have saved your PSCP executable.

To copy a file from Windows to Linux, type in your command line:

pscp <windows directory where the file exists> username@linuxMachineAddress:<path>

For example:

pscp C:\Documents\helloWorld.txt firdooze@165.1.122.76:/home/firdooze/Desktop/.

The command line will ask for your password and just watch your files get transfered.

The other way around will be much easier. You’ll need PuTTY (or any Windows SSH client) for this. Log into your SSH account and let the magic begin. To copy files to your Window machine just type:

scp username@linuxMachineAddress<linux directory path> C:\Documents\filename.extension

For example:

pscp firdooze@192.160.1.233:/home/firdooze/helloWorld.txt C:\Documents\helloWorld.txt

There you go! There are other options for transferring data over SSH but it requires installation at the host machine (which you may not have access to). Using PSCP just simplifies this matter.     :-)

Tags: HOW TO guides · linux

1 response so far ↓

  • 1 Rajat // Sep 17, 2012 at 7:06 pm

    that really helped. Thanks a lot for the post

Leave a Comment