Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Ubuntu Lost Sudoer

Posted on 2010-11-23
6
Medium Priority
?
734 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
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
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

Amazon Web Services EC2 Cheat Sheet

AWS EC2 is a core part of AWS’s cloud platform, allowing users to spin up virtual machines for a variety of tasks; however, EC2’s offerings can be overwhelming. Learn the basics with our new AWS cheat sheet – this time on EC2!

Question has a verified solution.

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

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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.:
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

704 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