Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
How do I reset a lost administrative password?
How can I give admin permissions to my account?

I have no root password and I accidentally removed the sudo privileges of the only account left.

Any suggestions?

share|improve this question

marked as duplicate by Eliah Kagan, belacqua, bodhi.zazen, Takkat, gertvdijk Feb 6 '13 at 1:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Please, edit your question adding more details like, What accounts do you have and What privileges they have, etc. –  Lucio Feb 4 '13 at 16:38
add comment

2 Answers 2

  1. Boot into the recovery mode.

  2. Select Drop to root shell prompt.

  3. Add yourself to the sudo (for Ubuntu 12.04 onwards) or admin group (from Ubuntu 11.10 downwards):

     adduser username sudo
    

    or

     adduser username admin
    

    Of course, replace username with your actual user name.

  4. Reboot the computer using your preferred method. Typing Ctrl+Alt+Canc or using reboot are two of the many available methods.

NOTE: This procedure assumes that you have removed yourself from the sudo/admin group, which is not obvious. If instead you have edited /etc/sudoers or have changed some other configuration, please tell us what you have modified and how.

share|improve this answer
add comment

Boot a live CD. Mount your root partition containing /etc. Modify the mounted /etc/group file to have your user back in the sudo group. Umount and reboot.

share|improve this answer
2  
I assume it's self explanatory correct? –  Steve Metzler Feb 4 '13 at 16:24
    
@SteveMetzler See my edit –  Paul van Schayck Feb 4 '13 at 16:34
add comment

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