Solved

Ubuntu Lost Sudoer

Posted on 2010-11-23
6
732 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
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

Certified OpenStack Administrator Course

We just refreshed our COA course based on the Newton exam.  With 14 labs, this course goes over the different OpenStack services that are part of the certification: Dashboard, Identity Service, Image Service, Networking, Compute, Object Storage, Block Storage, and Orchestration.

Question has a verified solution.

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

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

630 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