Amazon Community AMI: How to know root password?

I understand you are using Ubuntu on EC2 and you have logged in successfully using SSH keypair authentication.

You don't need the root password to use sudo, that's the point of sudo.

Set the password for your current logged in user using the command, "passwd".

If your user is already in the sudoers file, then you should now be able to sudo using the password you have just set.


The Amazon documentation on safely using shared AMIs actually lists steps for a good shared AMI that suggests either setting a randomized root password on startup or completely disabling root password and using SSH identity key that is installed on bootup. The AMI you've mentioned specificially is an EBS backed instance image so if it had set a randomized password it would be retained so you would have needed to remember it. Otherwise if it installed the SSH identity file you'd need the private key data portion of it which you could determine which was used by the Key Pair Name in the instance description.


Sounds like there is no password set so you'll need to login using the SSH keypair method.