How To Transfer Files To EC2 Server/Linux Host

You can transfer file to an EC2/Linux host via SCP. For that you first need to have the private key file downloaded on your system. Once you have it, open the terminal window and issue the following command.

scp -i mykey.pem somefile.txt

For simple Linux host, you may not need to provide the .pem file, instead issue the following command.

scp somefile.txt

Hit return and provide the password for root user.

mykey.pem: Private key generated and downloaded through Amazon EC2.

somefile.txt: File that is to be transfered.

ec2-user: EC2 instance user which is created by default EC2 public DNS

/home/files: Location on EC2 server where somefile.txt will be saved

Published by


Some day I'll fill this up. Till then Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nam cursus. Morbi ut mi. Nullam enim leo ....

Leave a Reply

Your email address will not be published. Required fields are marked *