I have 2 servers on Amazon AWS. I need to pass a file from A to B. Both servers have pem keys (different). I put the pem file of B on A (Is that correct?) Then tried to do from A:
scp -i /tmp/B.pem backup.sql.gz ubuntu@ec2-XX-XX-XXX-XX.eu-central-1.compute.amazonaws.com:bckup.sql.gz
I get an error:
Permission denied (publickey).
lost connection
Whats the problem?
BTW - I opened port 22 on both