Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in AWS by (29.3k points)

How to copy my files from my windows machine to an aws instance? Is there any way other than using FTP clients like filezilla, winscp. 

Some insights for this would be helpful.

2 Answers

0 votes
by (50.2k points)

You can copy your files using the 'SCP command' from your windows machine.

Transferring files to your AWS instance can be possible from your command prompt.

Copy the keypair (.pem format) to the folder where the files(that you want to transfer) are present.

open the command prompt, and enter the directory using:

cd /path/to/folder/

Then, try the below command for copying the file:

scp -i ./key-pair.pem ./path/to/files/ <username>@<public-ip>:/pathwhere/you/need/to/copy

For example: 

scp -i ./xyz.pem ./hello.txt [email protected]:/home/ec2-user/hello/

For more information, check out this AWS tutorial.

0 votes
by (3.1k points)

You can copy the files from your local machine to an AWS instance is simple with the scp (Secure Copy Protocol) command. This method allows you to connect to your instance via SSH using your private key and the instance's public IP address. So make sure that your security group is configured with ssh protocol from anywhere. (tcp port-22) 

Steps:

  • Run the below command to send example file in downloads folder to instance machine

scp -i KeyPair.pem -r C:\Users\LENOVO\Downloads\example USERNAME@Public-IP:/path-of-folder
 

Note: Replace the file\folder location as per your requirement
 

Related questions

0 votes
1 answer
Want to get 50% Hike on your Salary?

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

+1 vote
1 answer
0 votes
1 answer
0 votes
1 answer
+1 vote
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...