0 votes
1 view
in AWS by (19.2k points)

I have 2 EC2 instances running Ubuntu 14.04 and I need to figure out how to transfer files from one to another. I read the FAQs from Amazon and it says that I can do this without incurring any additional costs if I use the private IP but I am not sure how to transfer the files using that.

Right now I use the scp protocol to do this -

scp -i ~/Path-To-Key-File/AAA.gem /path/file  [email protected]<Elastic IP>:/path/file

I tried replacing the elastic IP with private IP but it doesn't work. Am I doing something wrong here?

1 Answer

0 votes
by (44.6k points)

Replace your Elastic IP address with the private IP address. Then configure you, security groups, in a way that the instances can communicate.

Consider the two instances as Instance-1 and Instance-2

I am running this code on Instance1

scp -i ~/Path-To-Key-File/yourkeypair.pem /path/file  [email protected]<Private IP of Instance-2>:/path/file

In Instance-2, allow SSH protocol over private IP to communicate.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...