How can I copy files in Putty to local computer?

5

1

Suppose I ssh to a server in Windows machine and I want to scp file myLocalComp:someDir, is there something automatically built-in or do I need to set up a SSHD for this in Windows?

user114739

Posted 2012-02-03T02:06:03.003

Reputation:

Answers

9

If you type scp on the remote server, you will need indeed an sshd server on the windows side for scp to be able to make an SSH connection from the remote server (where scp is) to your computer and then transfer the file.

Alternatively, if you have SSH access to this remote server, you could use a tool like WinSCP which will give you the possibility to retrieve a file from this server over SSH in a way very similar to FTP and without the need to install an SSH server on your side.

Edit: I forgot to mention pscp which is a command-line tool made by the same authors as Putty and available on the official Putty download page. I personally prefer to use WinSCP but pscp will do the work too.

Zertrin

Posted 2012-02-03T02:06:03.003

Reputation: 313

Is it possible to trigger the transfer from the putty command prompt if I have winscp open? – Herman Toothrot – 2019-03-08T05:52:32.327

@HermanToothrot putty and winscp are completely separate software. They do not interact with each other. So, no. – Zertrin – 2019-03-12T03:06:24.573

...cannot understand pscp, when I click it. It closes automatically? How am I supposed to use it or does it install itself somewhere? – None – 2012-02-07T17:46:25.650

Hi hhh, pscp is a command-line tool as specified in the documentation available on the official website : http://the.earth.li/~sgtatham/putty/0.62/htmldoc/Chapter5.html#pscp

If you are looking for a graphical tool, I suggest you to use WinSCP .

– Zertrin – 2012-02-08T20:07:26.173

yes, I got it running but I find this a bit unconfortable -- all this winscp and pscp. Seriously, no way to get scp or pscp to Cygwin or something else under one emulation? Now look I have CMD, Cygwin and Winscp -- well I can do things with them but it is much slower than a full-blown *ix tools. I would like to get pscp to work in Cygwin and CMD automatically, people are really supposed to create env vars or how to do it in W? Feels too hxckish to me... what about so-called "powershell", does it handle things under one emulation? – None – 2012-02-08T21:19:02.173

You didn't say you had Cygwin installed ! And i didn't mentionned it because I think it's even more "hxckish" as you say if your intention was only to transfer a file.

In this case you can install scp under Cygwin if not already done (re-run setup.exe and select scp package) and use scp like you would do on an *ix system. – Zertrin – 2012-02-09T00:24:50.610

Sorry but my Cygwin installation -setup-thing has no scp, I think there is a reason why there are things such as WinSCP and gscp -- no scp in Cygwin? – None – 2012-02-09T09:57:34.640

1

A quick search (cygwin scp) with my favorite search engine enable me to find that the ssh and scp commands are provided with the openssh package of the Cygwin setup : http://www.question-defense.com/2010/01/07/how-to-install-scp-and-ssh-on-windows-7-using-cygwin

– Zertrin – 2012-02-09T11:39:13.403

Thank you for the Cygwin/Scp -thing, do not ever ask whether I will bin putty/winscp/pscp for the cygwin -alternative :P Very very cool, I need no mock-putty-ssh-key-pairs etc, saves me a lot of hassle to use cygwin directly...nice. – None – 2012-02-09T13:17:29.657

2

Download PSCP from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

This is a windows application.

You can then do some like this scenario.

SOURCE FILES /home/user/documents/* DESTINATION d:\backup\user\documents

pscp -r user@192.168.x.y:/home/user/documents/* d:\backup\user\documents

kobaltz

Posted 2012-02-03T02:06:03.003

Reputation: 14 361

where am I supposed to write this command? When I click pscp, it closes?! – None – 2012-02-07T17:47:14.760

Open up command prompt and navigate to the directory where you have pscp saved. You can then use the above command to copy the files. – kobaltz – 2012-02-07T23:48:11.197