I lost administrator privileges

Quick to answer questions about finding your way around Linux Mint as a new user.
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. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
scorp123
Level 8
Level 8
Posts: 2272
Joined: Sat Dec 02, 2006 4:19 pm
Location: Switzerland

Post by scorp123 »

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.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Boo
Level 7
Level 7
Posts: 1633
Joined: Mon Mar 26, 2007 7:48 am

Post by Boo »

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 7
Level 7
Posts: 1633
Joined: Mon Mar 26, 2007 7:48 am

Post by Boo »

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 7
Level 7
Posts: 1633
Joined: Mon Mar 26, 2007 7:48 am

Post by Boo »

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!
Locked

Return to “Beginner Questions”