1

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?

3

Please try following the instructions here.

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

  • @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
3

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.

  • 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

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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