Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I accidentally removed my user from the sudo group.

A friend of mine told me to go into recovery mode and edit the visudo file.

The problem is, I don't know how to get into recovery mode. Can anyone please tell me how to do this? I am on ubuntu server 10.04 64bit.


share|improve this question
up vote 3 down vote accepted

I think you need to hold down the SHIFT key during boot and this should present you with the option to boot to recovery mode.

EDIT: (Assuming it is a single and not a dual boot system)

share|improve this answer
It is a single boot. Thanks I will try this when I get home :) – AntonioCS Aug 11 '10 at 10:30
This worked. Thanks :) – AntonioCS Aug 11 '10 at 21:05

Once you're in, you don't edit the visudo file; you can either

  • use visudo (assuming you know how to use vi, or do EDITOR=nano visudo (or whatever editor)), which safely edits /etc/sudoers and does sanity checking before saving
  • addgroup <username> admin, since the admin group is in the sudoers file

Of course, you shouldn't add yourself to the admin group if you weren't in it to start with... which won't be a problem if it's your server...

share|improve this answer
Thanks! I was in the admin group I just used usermod -G without -a, and yes the server is mine. It's just a small home server. – AntonioCS Aug 11 '10 at 20:49
Thanks again! I used the command usermod -a -G sudo <username> – AntonioCS Aug 11 '10 at 21:06

Your Answer


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.