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

We using Amazon EC2.

I changed sudoerrs using visudo and changed

ubuntu  ALL=(ALL) NOPASSWD:ALL

to something like:

ubuntu  ALL=(ALL) ALL

Don't ask me why i did it, but after this change i can't call sudo. Now it asks password on each sudo call:

ubuntu@ip:~/deploy/master$ sudo bash
[sudo] password for ubuntu:

Ho can i fix it, and revert my changes?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

Please try following the instructions here.

http://alestic.com/2011/02/ec2-fix-ebs-root

share|improve this answer
    
@Jeff Ferland: Cant create a comment on your post, but there is no way to mount an instance store, only EBS. –  bwight Feb 23 '12 at 16:38
    
Thanks. Updated to work from snapshot for restoring. Just one more reason to avoid instance stores except for automatically launched & culled systems. –  Jeff Ferland Feb 23 '12 at 16:49
    
Thanks! Your post helped, problem fixed. –  Leonid Bugaev Feb 25 '12 at 16:42

When sudo asks for a password, it is asking for the password of your current account. If you know that, use it.

If not, you've basically locked yourself out good & proper. From there, let's hope your root device is EBS. Turn off the instance and mount the EBS volume through another instance. Fix your mistake, then re-attach to the original instance and start it back up.

There's probably a way no direct way to mount an instance store, but if that is your circumstance you can snapshot it to an EBS volume and work from there.

share|improve this answer
    
EC2 uses PEM keys for auth, so password will not work. –  Leonid Bugaev Feb 23 '12 at 20:37
    
You can't snapshot an instance-store disk to an EBS volume if you are unable to ssh to the instance. The only thing you can do with a wedged instance-store instance is beg Amazon customer support to try to help you. –  Eric Hammond Feb 23 '12 at 21:22
    
@Eric Hammond: Is that something Amazon would do if you have Premium Support. I never really even included that into the list of options. –  bwight Feb 24 '12 at 14:07
    
@bwight: When AWS can/can't/will/won't help recover instance-store from a running instance is not something that is clear to me and they can change their policies on it from time to time. All I know is that they have on occasion done this for some customers, so it's worth asking if you have valuable data you cannot access. Better is to not put valuable information on instance-store in the first place. –  Eric Hammond Feb 28 '12 at 0:03

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.