Lost admin rights solved

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help

Lost admin rights solved

Postby manda on Sat Jan 12, 2008 2:17 am

I made a dumb mistake. :oops: I was trying to fix access to Virtual Box files and I changed my user rights on the Groups/user menu. I am the only user on this computer, but now I can't get back in to that option to fix it. I'm using Daryna Main edition, which I absolutely love. And yes, I'm a complete noob, but I'm having a lot of fun trying to figure this all out the fun way. :lol:

How do I get root or admin privileges back as the only user account set up?
manda
Level 1
Level 1
 
Posts: 10
Joined: Wed Jan 02, 2008 12:44 am

Linux Mint is funded by ads and donations.
 

Re: Lost admin rights

Postby Husse on Sat Jan 12, 2008 10:43 am

This is what you do with users for Virtualbox
Code: Select all
sudo usermod -a -G vboxusers YOUR_LOGIN_NAME

You can find a guide in the howto section of the forum
viewtopic.php?f=42&t=8453
I'm not quite sure I understand what happened to you, but I think you have lost "the power of sudo"
This is not easy to fix (don't despair) as you need sudo to do it.
Paste the content of /etc/sudoers here so I can figure out what happened - and don't ever try to change that file if you do are not absolutely sure of what you are doing
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: Lost admin rights

Postby manda on Sat Jan 12, 2008 3:27 pm

When I open sudoers with gedit, it tells me I don't have the rights to open/view that file. I tried to use sudo gedit in the terminal, but it doesn't do anything at all when I use sudo. I hope I'm explaining this right.

Thank you for the link for Virtual Box - that's just what I was trying to do! :D
manda
Level 1
Level 1
 
Posts: 10
Joined: Wed Jan 02, 2008 12:44 am

Re: Lost admin rights

Postby Fred on Sat Jan 12, 2008 3:37 pm

Use another live cd. I like puppy linux for those kinds of chores but there are many to chose from. then you can edit the offending file and all should be well.

Enjoy

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Lost admin rights

Postby Husse on Sat Jan 12, 2008 4:54 pm

The sudoers file is a very special file. I'm sorry I forgot that you can't even view it if you don't use the right editor.
It might be that I'm tired, but I have to ask, does sudo work for you at all?
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: Lost admin rights

Postby manda on Sat Jan 12, 2008 5:14 pm

Using a live CD I can view it with gedit but it's read only. When I'm in Daryna, I can't even view it using gedit. Here is the output:

# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
# Defaults

Defaults !lecture,tty_tickets,!fqdn

# Uncomment to allow members of group sudo to not need a password
# %sudo ALL=NOPASSWD: ALL

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) NOPASSWD: ALL
manda
Level 1
Level 1
 
Posts: 10
Joined: Wed Jan 02, 2008 12:44 am

Re: Lost admin rights

Postby Fred on Sat Jan 12, 2008 5:37 pm

I just tried it to make sure I was correct. If you will download and burn Puppy linux, (whichever version strikes your fancy), you can modify that file to your hearts content.

You might want to look at my second post on this thread.

viewtopic.php?f=90&t=8363

Good luck

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Lost admin rights

Postby manda on Sat Jan 12, 2008 5:59 pm

Fred, I am using my Puppy CD, but when I try to add user using visudo, it says permission denied. Maybe I'm missing a simple step somewhere? I'm learning as I go. :)

Edit: I think I figured it out. Reading the sticky on "logging in as root" helps. :oops:

Edit again: I was able to add myself to the root users using visudo. However, all of my admin privileges still don't seem to be restored. When I try to use Mint Assistant, it says that I don't have rights to access it.
manda
Level 1
Level 1
 
Posts: 10
Joined: Wed Jan 02, 2008 12:44 am

Re: Lost admin rights

Postby Fred on Sat Jan 12, 2008 6:38 pm

manda,

Ok, Let me try to help. The version I am using has an icon on the screen, I think it is called "drives." Let me back up.

1. When you first see the Puppy boot splash screen.
Type: puppy pfix=ram and hit enter. This causes puppy to run completely in ram and not touch the hard drive. From there follow the directions until you get the desk top.

2. On my version, (2.16 NOP) you will see an icon on the desk top called, (I think) "drives." If it isn't there on your version look in the menu and find the utility for mounting the drives and partitions.

3. With the mouse, click on the partition that your Mint root directory is in. That should open a window showing all the files and directories in that partition.

4. Look for the etc folder and click on it. Then scroll down the the sudoers file, right click and pick "open as text."

5. Modify the file as you wish and click save. Exit the editor and close all the windows.

6. Unmount the drive partition we have been working with by clicking on it in the same drive utility.

7. Log off puppy and when it asks, tell it not to save anything.

You are done. Be sure and remove the puppy disk from the cd drive and reboot. If you modified the correct file appropriately, all should be well.

Hope this helps,

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Lost admin rights

Postby manda on Sat Jan 12, 2008 7:49 pm

Fred, thank you so much for the detailed instructions. I used Puppy to modify the sudoers and rebooted, but it didn't save the changes. I found a thread on the Ubuntu forum that suggested booting in recovery mode then using visudo there to add myself to the admin group. That seems to have fixed my access problem as I can access everything I need to.

I am still missing the Users and Groups option in Administration, but unless I need that for something I'm not aware of I should be good to go. Unless I find something else missing later! :D
manda
Level 1
Level 1
 
Posts: 10
Joined: Wed Jan 02, 2008 12:44 am

Re: Lost admin rights

Postby Fred on Sat Jan 12, 2008 8:22 pm

Interesting, There must be another config file that it is syncing to on boot up. Security in depth kind of thing.

I can't really help you with what files to change, or what to change them to, to completely solve the problem. I just am not familiar enough with the Mint distro. I was only trying to help with the editing process.

I am sure someone else on here can guide you though. I believe Husse is the resident Mint expert, but I am sure there are others too.

Good luck

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: Lost admin rights

Postby Husse on Sun Jan 13, 2008 8:07 am

I wrote
don't ever try to change that file if you are not absolutely sure of what you are doing

This is because you can mess things up completely!
Your sudoers file seems "almost" correct
Below is a correct sudoers file for Daryna
The (somewhat complicated) way to fix it if you can't use sudo at all is to boot in "Recovery mode"
and copy this content into the sudoers file.
First you have to copy the content to a text file, then copy it into the sudoers file using the terminal
I don't go into the details about that as you seem to be able to use sudo
Again never, ever change the sudoers file if don't know exactly what you are doing or, like now, get advice from a reliable source.
Open the sudoers file for editing
Code: Select all
sudo visudo

This is the correct somewhat strange command
The correct sudoers file
Code: Select all

# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
# Host alias specification

# User alias specification

# Cmnd alias specification

# Defaults

Defaults        !lecture,tty_tickets,!fqdn

# User privilege specification
root    ALL=(ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: Lost admin rights

Postby manda on Sun Jan 13, 2008 5:25 pm

Husse, when I change sudoers to what you suggest, I again lose the power to sudo or anything else that requires root permissions.

But if I add %Manda ALL=(ALL) ALL at the end of the admin group, I seem to be fine except that now I'm not prompted for a password outside the terminal. This seems to be a workaround but still not the right answer.
manda
Level 1
Level 1
 
Posts: 10
Joined: Wed Jan 02, 2008 12:44 am

Re: Lost admin rights

Postby Husse on Mon Jan 14, 2008 7:49 am

I have to give this a thought.
Could you post your sudoers file - something tells me it's wrong :)
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: Lost admin rights

Postby manda on Tue Jan 15, 2008 3:29 am

Here's my sudoers file:

# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
# Host alias specification

# User alias specification

# Cmnd alias specification

# Defaults

Defaults !lecture,tty_tickets,!fqdn

# User privilege specification
root ALL=(ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
%manda ALL=(ALL) ALL
manda
Level 1
Level 1
 
Posts: 10
Joined: Wed Jan 02, 2008 12:44 am

Re: Lost admin rights

Postby Husse on Tue Jan 15, 2008 6:55 am

Your sudoers file seems to be correct except for the last line
%manda ALL=(ALL) ALL

This is a complicated area, and one that I've not studied in depth as most people don't get problems but I will dig into it.
That line should not make any difference
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: Lost admin rights

Postby Husse on Wed Jan 16, 2008 10:48 am

Does this help?
Read carefully
http://www.psychocats.net/ubuntu/sudo
Note that the number after x in /etc/group is not necessarily 106 as in the example
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19703
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: Lost admin rights

Postby manda on Thu Jan 17, 2008 4:06 pm

That fixed it! :D My user name wasn't listed after that one line. Added it in, rebooted, and now everything seems to be working perfectly. Thank you so much for your help!
manda
Level 1
Level 1
 
Posts: 10
Joined: Wed Jan 02, 2008 12:44 am

Linux Mint is funded by ads and donations.
 

Return to Newbie Questions

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 14 guests