I can SSH into the EC2 instance:
ssh -i "my_key.pem" ec2-user@my-public-ip
However, scp doesn't work:
scp -r –i "my_key.pem" ./my_file ec2-user@my-public-ip:/home/ec2-user/my_file
Permission denied (public key).
lost connection
I've also tried using public instance DNS, but nothing changes.
Any idea why is this happening and how to solve it?