Administrator group and privilege gone

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
palo
Level 4
Level 4
Posts: 476
Joined: Mon Jun 25, 2012 7:28 am
Location: Walking on sunshine

Administrator group and privilege gone

Post by palo »

Greetings.
Running a Xfce setup in VBox I have managed to borken it and instead of installing again (so many updates) have been trying to fix it without success.
There is only the initial user and I am now without the ability to do things as the administrator normally would do. From what I can tell the administrator group has gone missing along with all priveleges. In Users and Groups administrator is gone and in the file /etc/group it has vanished too. I tried as root

Code: Select all

addgroup administrator
but that in itself which puts the group in (as 1001) is bringing me no closer to getting it back the way it was. Is there a way to fix this or is it time to flush?
I did re-install gnome-system-tools but that had no effect.

Pat
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
karlchen
Level 23
Level 23
Posts: 18157
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Administrator group and privilege gone

Post by karlchen »

Hello, Pat.

On a default installation of Linux Mint xfce, there is no user group named "administrator" or "administrators". To the best of my knowledge, this statement applies to all current Linux Mint editions.
Therefore adding a new group named "administrator(s)" to your system will not fix any problem that you experience.

The term administrator(s) or admin(s) is frequently used in the Linux Mint environment in order to refer to those users who have got the privilege of using the sudo command (sudo, gksu, gksudo) in order to run programmes with root privileges.

By default a user must be a member of the user group sudo in order to be able to run any command with root privileges.

Code: Select all

grep sudo /etc/group
sudo:x:27:karl
Whether or not the members of the group sudo can run commands with root privileges is determined by the file /etc/sudoers.

Code: Select all

sudo grep "%sudo" /etc/sudoers
%sudo	ALL=(ALL:ALL) ALL
As you were able to add a new user group to /etc/groups you seem to be able to use sudo. How else could you have done this with root privileges? Therefore I wonder which privilege it really is that you are missing? :?

By default the first user created during the Mint installation will be a member of the following groups:

Code: Select all

grep karl /etc/group
adm:x:4:karl
cdrom:x:24:karl
sudo:x:27:karl
dip:x:30:karl
plugdev:x:46:karl
lpadmin:x:109:karl
sambashare:x:127:karl
The crucial entry which allows this user to run commands as root is the membership in the group "sudo", because by default "sudo" is allowed to run any command with root privileges through /etc/sudoers.

As long as you are able to authenticate as root, you can fix the files /etc/group and /etc/sudoers with the help of a text editor manually.

In case you can no longer acquire root privileges, you will have to boot into recovery mode. This will automatically give you access to a root session. Fix anything which needs fixing and reboot back into normal mode.

Kind regards,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 750 days now.
Lifeline
palo
Level 4
Level 4
Posts: 476
Joined: Mon Jun 25, 2012 7:28 am
Location: Walking on sunshine

Re: Administrator group and privilege gone

Post by palo »

Thanks for the help Karl.
On a default installation of Linux Mint xfce, there is no user group named "administrator"...
Yes, now I see that I brought this confusion upon myself because I was comparing to another setup where I had named the first user administrator - embarrassed totally but now I know.

On the install with the problems things appear to be the same as yours with the exception of the last line:

Code: Select all

pat@XFCE ~/Desktop $ grep sudo /etc/group
sudo:x:27:pat
pat@XFCE ~/Desktop $ sudo grep "%sudo" /etc/sudoers
[sudo] password for pat: 
%sudo	ALL=(ALL:ALL) ALL
pat@XFCE ~/Desktop $ grep pat /etc/group
adm:x:4:pat
cdrom:x:24:pat
sudo:x:27:pat
dip:x:30:pat
plugdev:x:46:pat
lpadmin:x:109:pat
sambashare:x:127:pat
pat:x:1000:
As you were able to add a new user group to /etc/groups you seem to be able to use sudo. How else could you have done this with root privileges? Therefore I wonder which privilege it really is that you are missing?
Me too (and when I know I will fix the heading). I will try to explain the problems:

1. Since I added a group via terminal I assume I could also add a user that way, but, when I open Users and Groups and click "Add" for a new user there is no popup window to add a user- if I click "Advanced Settings" there is no popup window either.

2. Synaptic will start from the terminal either with gksudo synaptic or su first then synaptic. From the menu it will not launch and from Application Finder (synaptic-pkexec) it will not launch either.

Maybe there are other odd things that I haven't noticed yet but, as you pointed out I was on the wrong track as to what the problem is.

Pat
User avatar
karlchen
Level 23
Level 23
Posts: 18157
Joined: Sat Dec 31, 2011 7:21 am
Location: Germany

Re: Administrator group and privilege gone

Post by karlchen »

Hello, Pat.

The terminal command to add a new user is adduser.

Excursion:
About your statement
when I open Users and Groups and click "Add" for a new user ...
This made me want to check here and see what would happen. But to my susprise and my dismay I found out that there is no item "Users and Groups" in any of my sub-menus. It is simply absent from my Linux int 13 xfce 32-bit.
This seems to be in accordance with this recently made complaint and request: Restore Users & Groups to XFCE edition of Mint.
OK. Found a workaround - or maybe it is the solution - here: Users And Groups in Linux Mint 13 xfce. So gnome-system-tools have been added to my xfce and "Users and Groups" are back where they belong: Menu => System. :P


About the problem which you report when using "Users And Groups":

As far as I can tell, you must not launch "Users and Groups" with the help of sudo/gksu/gksudo, but unelevated, i.e. under your own account.
If I launch

Code: Select all

sudo users-admin
or

Code: Select all

gksu users-admin
the GUI will not be functional.
Yet, if I launch it unelevated, simply using my normal user account, it will work as expected. Whenever a selected action needs root privileges, users-admin will display a password dialogue asking me to give my user password, and then execute the action. No problem found here so far.

Perhaps you will have to re-install the gnome-system-tools?


About the Synaptic problem:

You might wish to check the content of the file /usr/share/applications/synaptic.desktop and make sure it reads

Code: Select all

[Desktop Entry]
Name=Synaptic Package Manager
GenericName=Package Manager
Comment=Install, remove and upgrade software packages
Exec=synaptic-pkexec
Icon=synaptic
Terminal=false
Type=Application
Categories=PackageManager;GTK;System;Settings;
NotShowIn=KDE;
X-Ubuntu-Gettext-Domain=synaptic
What happens if you execute the command which the menu icon executes, synaptic-pkexec, in a terminal window? Here it will work as expected. I.e. a password prompt appears and once my password has been verified Synaptic will be launched with root privileges.

Kind regards,
Karl
Image
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 750 days now.
Lifeline
palo
Level 4
Level 4
Posts: 476
Joined: Mon Jun 25, 2012 7:28 am
Location: Walking on sunshine

Re: Administrator group and privilege gone

Post by palo »

Thank you for the effort with this Karl.
As far as I can tell, you must not launch "Users and Groups" with the help of sudo/gksu/gksudo, but unelevated, i.e. under your own account.
Yep, I had to become root and kill it.
Perhaps you will have to re-install the gnome-system-tools?
one of the first thigs I tried but no solution.
You might wish to check the content of the file /usr/share/applications/synaptic.desktop and make sure it reads...
Yes. All matches but it will not launch from there, or any other way, except from a terminal, with synaptic-pkexec, it will launch as expected.

I created a new account via terminal with "adduser" and made all the group members match. Once I logged into that account every function of Users and Groups and launching Synaptic behaved normally. This suggests there is nothing wrong with the applications themselves but only the account. I think it is often considered as a solution (creating a new account) but knowing what went wrong and how to fix it would be better than repeating the same condition again. So if this information gives any new insight please share.

Pat
Locked

Return to “Other topics”