Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Ubuntu Lost Sudoer

Posted on 2010-11-23
6
Medium Priority
?
740 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
Lessons on Wi-Fi & Recommendations on KRACK

Simplicity and security can be a difficult  balance for any business to tackle. Join us on December 6th for a look at your company's biggest security gap. We will also address the most recent attack, "KRACK" and provide recommendations on how to secure your Wi-Fi network today!

 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 800 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 1200 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
Fine Tune your automatic Updates for Ubuntu / Debian
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…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses
Course of the Month8 days, 11 hours left to enroll

877 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