I lost administrator privileges

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

I lost administrator privileges

Postby gvm12 on Wed Jul 04, 2007 1:35 pm

I have an external usb hard drive in which I always record my files just to back up my stuff. Suddenly I found that I was not able to write anything in it because the Root was the owner. Since I open my account I was the administrator, so I activated the root account to go into the external hard drive icon, right click it and under properties give permission to my user name (Gabe) to access, read and write in the hard drive. The problem was that I still could not change the permissions because the hard drive icon did not show up in the root account (I don't know why) and I never changed those permissions before, it's like something happened and suddenly the root was the owner. Anyway, I still was the administrator, so I went to accounts and users and thinking of something so I could be able to write in the hard drive, I changed my user name from Gabe to Root, logged out, and when I logged back in I was no longer the system administrator, I cannot activate the root account anymore, I don't have any privilege, and I don't know what to do. How could I return my privileges again?
Please someone give me a solution because now I'm not even able to update my system
gvm12
Level 1
Level 1
 
Posts: 20
Joined: Wed Jun 13, 2007 7:26 pm

Linux Mint is funded by ads and donations.
 

Postby scorp123 on Wed Jul 04, 2007 8:11 pm

You shouldn't have touched the root account ... I'm afraid but you will have to reinstall. :?

BTW, this isn't Windows. "administrator" here only means "has the right to use 'sudo' and thus temporarily become 'root' ". The real "administrator" with the real infinite God-like powers always is "root". You should never ever login to a GUI using the "root" account: you get too many powers and you could do too many scary things to your system and nothing will stop you ... root's actions are never to be questioned by the computer, whatever happens will happen!

The best thing for you would be to leave the "root" account "as is" and not enable it, only use root's functions via "sudo".

One of the things that most likely happened is that by renaming you locked yourself out of /etc/sudoers ... Another thing you shouldn't do. Never ever rename an account ... There may be plenty of entries somewhere else in the system and incorrectly renaming your account without taking care of those extra-entries in all those other places definitely will have bad consequences.
User avatar
scorp123
Level 8
Level 8
 
Posts: 2287
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

I lost administrator privileges

Postby gvm12 on Wed Jul 04, 2007 10:59 pm

I now understand everything you're saying, so my only solution to have the administrator privilege back is to reinstall the system?
gvm12
Level 1
Level 1
 
Posts: 20
Joined: Wed Jun 13, 2007 7:26 pm

Postby Boo on Thu Jul 05, 2007 2:25 am

here is a fix.

boot off the mint CD.

open a terminal, and mount you old / file system

sudo mount /dev/sda1 /mnt

now you set you old / as the current root file system

sudo chroot /mnt

now be careful as you are root.
edit the /etc/passwd file and change your user account name from root to Gabe, the account will have a UID of 1000 NOT 0. save and close.

nano /etc/passwd

now exit the chroot terminal

exit

reboot and login as Gabe.
use sudo in the future not the root account.

:D
Image
Now where was i going? Oh yes, crazy!
User avatar
Boo
Level 8
Level 8
 
Posts: 2364
Joined: Mon Mar 26, 2007 7:48 am

I lost administrator privileges

Postby gvm12 on Thu Jul 05, 2007 7:18 pm

Hi Boo, thanks a lot for your suggestion but I didn't mention that I got Ubuntu and maybe the commands that need to be typed in the Terminal are not the same since nothing worked... any other idea for Ubuntu? I will really appreciate it because re-installing the system is the last thing I wanna do, I have a lot of things in my pc and I cannot record them in the external hard drive (another problem I have because the root is now the owner and I'm not allowed to write anything in it)
gvm12
Level 1
Level 1
 
Posts: 20
Joined: Wed Jun 13, 2007 7:26 pm

Postby Boo on Thu Jul 05, 2007 8:00 pm

It will work with ubuntu too.

things to check:
/dev/sda1 may not be your / filesystem so you may have to change it.
you could use gparted to look at you partitions in a gui to make it easier to find /.

nano is an easy to use text editor but you could use pico or vi.

you can use any live CD distro to do this not just Mint, ubuntu will do.

:D
Image
Now where was i going? Oh yes, crazy!
User avatar
Boo
Level 8
Level 8
 
Posts: 2364
Joined: Mon Mar 26, 2007 7:48 am

I lost administrator privileges

Postby gvm12 on Fri Jul 06, 2007 11:24 pm

Hi Boo:
I tried your suggestion but there is a problem now, in the part that you told me to change the name root to gabe has not changed, the user name still says gabe:x:1000:1000:Gabe,,, :/home/gabe:/bin/bash
Despite I changed the user name from gabe to root in the users and groups menu, I've always been able to log in as gabe again with the difference that after that, I no longer had any privilege (such creating new accounts, installing new softwares, updating the system, etc) and also, there is no longer sound in my account only, because the other accounts still have sound. What should I do now? Thanks for the support.
gvm12
Level 1
Level 1
 
Posts: 20
Joined: Wed Jun 13, 2007 7:26 pm

Postby Boo on Sat Jul 07, 2007 8:31 am

so gabe is no longer a sudoer.

people in the admin group are sudoers.
so run

cat /etc/group | grep admin

if your user name is not in that group then you will have to add it.
there are 2 ways.
if you can login as root you can run the command

usermod -G admin gabe

or you have to use the live cd again and sudo the same command.

Remember Linux is case sensitive so make sure you are consistent.

:D
Image
Now where was i going? Oh yes, crazy!
User avatar
Boo
Level 8
Level 8
 
Posts: 2364
Joined: Mon Mar 26, 2007 7:48 am

Linux Mint is funded by ads and donations.
 

Return to Newbie Questions

Who is online

Users browsing this forum: Bing [Bot], Pyro2577, Reorx and 43 guests