I was in the process of disabling root logins on an AWS EC2 instance. Right after setting PermitRootLogin no and restarting sshd, I closed the terminal on accident — before setting up users with sudo privileges. The result is that my key to get into the instance as root does not work (sshd forbids it) and when I log into the instance using my regular user I can't gain root privileges (the root password was never set). The instance is running ubuntu 8.10. Anyone have any idea how can I fix this?
Ssh – root locked out of EC2
amazon ec2ssh
Best Answer
No, don't terminate the instance, all is not lost!!
P.S. next time try Userify to manage your users' keys :)