Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
in AWS by (12.9k points)

I have an EC2 instance running (FreeBSD 9 AMI ami-8cce3fe5), 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 [email protected]:/


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

1 Answer

0 votes
by (18.2k points)

This could be happening because of the wrong order of the arguments you used in the command to copy the file to your instance.

Try the following command:

scp -i mykey.pem somefile.txt [email protected]:/

Related questions

0 votes
1 answer
asked Jul 6, 2019 in AWS by Amyra (12.9k points)

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
0 votes
1 answer

28.4k questions

29.7k answers


94k users

Browse Categories