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 in AWS by ravi
102 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 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 12 in AWS by trisha
71 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
0 votes
1 answer