Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm using ami-c2a255ab. It is up and running. I can SSH to it. But when it asks for password for any sudo command - I have nothing to say.

Where can I get this info?

share|improve this question

3 Answers 3

up vote 2 down vote accepted

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.

share|improve this answer
    
And if it's one of the prebuilt Ubuntu AMIs the ubuntu user doesn't even have a password. –  Erik Kronberg Nov 28 '10 at 14:50
    
Rich, you were right. That was my mistake. It all was caused by messed up sudoers file. It has nothing to do with AMI, itself. Thank you –  user45286 Nov 28 '10 at 15:00

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.

share|improve this answer

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.