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 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.

Thanks

share|improve this question
add comment

2 Answers

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
add comment

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
add comment

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.