1

I'm currnetly trying to retrieve files from my AWS EC2 Linux server to my Windows 7 PC using scp

I'm a bit of a Linux newbie and from the server I'm currently trying things like:

scp transferMe.tar Username@publicIP/lanIP/C:/

But it doesn't seem to be going very well, I've also tried things like tcp comands, filezilla, and winSCP to retrieve these files, but they also hit stumbling blocks that I won't go into here.

I think that the way I'm trying to use the scp command is invalid. How should I structure the command?

3 Answers 3

2

You have a couple of problems here. The first, as laurent pointed out is that scp does not work out of the box with Windows. You need to use specific software, for example pscp from the putty tools. Once you have installed it, you can run this command from the Windows command line:

pscp [email protected]:/home/user/transferMe.tar C:\

The second problem is that even if you had an ssh server on your windows machine, copying from the server to the local computer would not have worked the way you are attempting it. You probably don't have access to your private IP from outside your home network, you need to configure your router to forward port 22 to the private IP of your computer. The details on how to do that depend on your router. So, even if you were trying to copy to another Linux machine, it would not have worked. You cannot use IPs like folder names, public_ip/private_ip is a reasonable assumption, but that's not how it works unfortunately.

5
  • you need to have pscp installed, just having putty won't help.
    – galuano1
    Apr 4, 2013 at 0:42
  • 1
    Thanks @galuano1, made it clearer. You can download one installer for all the putty tools (except one) which includes pscp.
    – terdon
    Apr 4, 2013 at 0:45
  • Ah thank you, I've done port forwarding before, it makes sense that it should be used in this situation.
    – Kris Welsh
    Apr 6, 2013 at 13:23
  • I cant seem to get this to work, could you suggest a different way of getting my data from the instance?
    – Kris Welsh
    Apr 6, 2013 at 14:20
  • I would recommend you post a new question with any error messages you are getting. This should work if done correctly as long as the linux server is accessible via ssh.
    – terdon
    Apr 6, 2013 at 14:21
1

You can't scp from the EC2 instance to your home computer for various of reasons, such as

  1. You don't have a SSH daemon running on your windows machine
  2. You are behind a NAT, can't initiate a connection from the internet unless you do port forwarding

But, as others have suggested, you can initiate the connection from your Windows machine to the EC2 Instance, using various tools, such as WinSCP or pscp

Personally, I would use pscp.

1

As far as I know, scp doesn't work with windows. You need to use winscp (introduction to winscp) or use cygwin.

Is your local machine accessible from internet (public IP on the machine or port forwarding on the router conected to internet)? If not, it would be better to transfer the files using your local machine to issue the command as the ec2 machine is probably reachable from internet.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .