I accidentally remove my pem file because of the "Permission denied (publickey)."
error occuring when I log in.
So I found that I can not log in that instance anymore (I don't know why AWS has this bad policy).
So I try to copy instance to another instance. My old instance is Ubuntu 16, but I need to include every configuration files too.
So I found that AMI is used to copy instance.
But when I logged in new instance created from the AMI from old instance.
I got "Permission denied (publickey)."
.
I did all the tries that I can
- ssh -i MY_PEM.pem root@host
- ssh -i MY_PEM.pem ubuntu@host
- ssh -i MY_PEM.pem ec2-user@host
- ssh -i MY_PEM.pem AMI_NAME@host
- ssh -i MY_PEM.pem AMI_ID@host
- ssh -i MY_PEM.pem AMI_OWNER@host