Solved

Ubuntu Lost Sudoer

Posted on 2010-11-23
6
726 Views
Last Modified: 2012-05-10
Hi

I am running Ubuntu 10.10. I have only one user which was able to Sudo few hours back. I made a new group abc and mistakenly ran the this statement

usermod -G abc myuser

I then logged out. Now I am not able to sudo.

When I sudo Linux says "myuser is not in the sudoers file.  This incident will be reported"

Is there any solution?
0
Comment
Question by:systemsautomation
6 Comments
 
LVL 35

Expert Comment

by:Ernie Beek
ID: 34195392
Can you still log on as root (from the terminal)?

Then try this:

echo 'myuser ALL=(ALL) ALL' >> /etc/sudoers

But be SHURE to put in >> (two >'s , whatever they are called) otherwise there might be some unexpected effects :-~
0
 
LVL 35

Expert Comment

by:Ernie Beek
ID: 34195395
Offcourse I meant: SURE

0
 

Author Comment

by:systemsautomation
ID: 34195409
No. I cannot login as root. It says "Login Incorrect"
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 200 total points
ID: 34195412
Hi,

this should help you: http://www.psychocats.net/ubuntu/resetpassword

Basically, you will have to enter recovery (or "rescue") mode (that's described in the link) to go to the root shell prompt. The rest of the article above deals with resetting your own password, which is not of relevance here.

Once you're in the root shell you can revert the effects of your usermod command or you can customize sudoers using "visudo" to either add the "abc" group with same settings as the "admin" group, or to add "myuser" with the settings of the "admin" group.

wmp
0
 
LVL 6

Accepted Solution

by:
brb6708 earned 300 total points
ID: 34195506
very easy:

boot from ubuntu live cd

open a terminal and enter

sudo su
mkdir /rootdisk
mount /dev/<device> /rootdisk

if you do not know which device contains your rootfolder you can enter "fdisk -l" to see which devices are available and try the right one.

use a editor to edit /rootdisk/etc/group and find the line "admin:122:<user>" (122 is maybe different - important is admin:xxxx)

just write the login names of all users that should have sudo rights like
admin:122:user1,user2

then reboot your computer and you should be able get sudo rights again.
0
 

Author Closing Comment

by:systemsautomation
ID: 34198127
Thanks
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Use CRON to save a copy of an open file 1 56
curl SSL certificate unable to get local issuer certificate 15 108
awk file 6 79
Upgraded from Debian 7 to 8.7 and got black screen 20 70
Hello EE, Today we will learn how to send all your network traffic through Tor which is useful to get around censorship and being tracked all together to a certain degree. This article assumes you will be using Linux, have a minimal knowledge of …
Fine Tune your automatic Updates for Ubuntu / Debian
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question