i am trying to copy files to an EC2 instance with the scp command as follows:
scp -i "key-pair-name.pem" somefile.txt ec2xxxx.us-west-2.compute.amazonaws.com:~
I get the following error: Permission denied (publickey). lost connection
I am using an amazon linux machine
I am able to ssh just fine. I've gone over Q&A here, with no luck.
scp -i "key-pair-name.pem" somefile.txt ec2xxxx.us-west-2.compute.amazonaws.com:~/
– sergiy.dragunov.pem
key is the userubuntu
, thus[email protected]...
or-l ubuntu
– Antti Haapala