Solved

Ubuntu Lost Sudoer

Posted on 2010-11-23
6
718 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
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Setting up Secure Ubuntu server on VMware 1.      Insert the Ubuntu Server distribution CD or attach the ISO of the CD which is in the “Datastore”. Note that it is important to install the x64 edition on servers, not the X86 editions. 2.      Power on th…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now