How to scp secure copy to ec2 instance without password

0 votes

I have an EC2 instance running, and I can ssh into it using my amazon-created key file without password prompt, no problem.

However, when I want to copy a file to the instance using scp I am asked to enter a password:

scp somefile.txt -i mykey.pem root@my.ec2.id.amazonaws.com:/

Password:

Any ideas why this is happening/how it can be prevented?

Mar 26, 2019 in AWS by ravi
2,591 views

1 answer to this question.

0 votes

I figured it out. you had the arguments in the wrong order. This works fine:

scp -i mykey.pem somefile.txt root@my.ec2.id.amazonaws.com:/
answered Mar 26, 2019 by Esha

Related Questions In AWS

0 votes
1 answer
0 votes
1 answer

How to ssh into EC2 instance without PEM key?

You need ssh-agent to supply your PEM file during ...READ MORE

answered Mar 13, 2019 in AWS by trisha
1,703 views
0 votes
3 answers
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to find instance id from within an Instance?

For Amazon Linux AMIs you can use: $ ...READ MORE

answered Mar 26, 2019 in AWS by Esha
1,134 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP