Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (19.1k 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  ec2-user@<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.4k 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  ec2-user@<Private IP of Instance-2>:/path/file

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

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer

Browse Categories

...