Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Removing root privileges

New to Debian (Or Linux in general)? Ask your questions here!
Post Reply
Message
Author
User avatar
jagheterintelars
Posts: 1
Joined: 2020-04-02 18:15

Removing root privileges

#1 Post by jagheterintelars »

Hello!

I installed Debian a couple of weeks ago. All went fine. I found all the answers for the questions I had. But a couple of days ago I ran into this simple problem which I really cant find an answer to, even though its probably the easiest solution.

The problem is that I made my own account into an administrator account (root account?) by exploring the graphical interface of the settings. When in the users section I clicked on the button that made me an admin.

As I prefer to operate as a normal user on a daily basis and only use the root privileges only when they really are needed, I would like to reverse these changes.

The button i clicked when i clicked to be an admin on this computer is not clickable anymore, and Ive searched a lot. But the only answers I find is how to make yourself an admin, and not how to take the privileges back. Very irritating. I dont know if its my limited english skills that makes me unable to find a solution online, or if no one in the world before me has wanted to remove their own admin privileges.

Thank you beforehand

Friendly regards,
/Hannes

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Removing root privileges

#2 Post by Head_on_a_Stick »

No idea what you mean by an "administrator account", that term is meaningless for GNU/Linux systems. Are you actually running Ubuntu? Seems like the kind of nonsense terminology they would use to ease confusion for the Windows refugees.

I'm only guessing but you probably mean that your user can gain root privileges with the sudo command so try

Code: Select all

sudo gpasswd -d $USER sudo
deadbang

arid
Posts: 136
Joined: 2014-05-08 18:40
Location: Aridzona
Has thanked: 3 times
Been thanked: 1 time

Re: Removing root privileges

#3 Post by arid »

No idea what you mean by an "administrator account"
I believe what he has accomplished is booting up into the root account. Easy way is to su in cli and startx. Now tell him how easy it is to fix it.
There's no drama in my sid......

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 133 times

Re: Removing root privileges

#4 Post by Head_on_a_Stick »

arid wrote:I believe what he has accomplished is booting up into the root account. Easy way is to su in cli and startx.
Perhaps try actually reading the OP? They used an option in their graphical desktop.

EDIT: and what makes you think they identify as male?
deadbang

cuckooflew
Posts: 677
Joined: 2018-05-10 19:34
Location: Some where out west
Been thanked: 1 time

Re: Removing root privileges

#5 Post by cuckooflew »

===edit----READ the bottom edit first !!!!!

The problem is that I made my own account into an administrator account (root account?) by exploring the graphical interface of the settings. When in the users section I clicked on the button that made me an admin.
Do what H-O_A_S says, or try searching, use the key words,

Code: Select all

How to remove administrative permissions on Debian 
Oddly enough all though I specifically said Debian, all the results are for Ubuntu, but should still be able to be used on Debian, :
jagheterintelars> I dont know if its my limited english skills that makes me unable to find a solution online, or if no one in the world before me has wanted to remove their own admin privileges.
I don't buy this, it is a common question, however, if English is not your language, do the search in your language, and it should return results in your language. If we knew what language, me or some one else could do a translation , maybe.
jagheterintelars> As I prefer to operate as a normal user on a daily basis and only use the root privileges only when they really are needed, I would like to reverse these changes
This is one of the many hits I got, when I did a search, one of the first , :
From:https://askubuntu.com/questions/335987/ ... g-the-user

You can also use gpasswd:

sudo gpasswd -d username sudo

This will remove username from group sudo.
Which is the same as what H_O_A_S suggested,... again, if the OP does not understand, due to lack of english skills, nobody can do a translation with out knowing what language to translate to...
Last note: See 'man gpasswd', for details on the command,..
FRom another hit:
from: https://linuxhint.com/sudo_linux/To remove a user from sudoers on Debian based distributions run the following command:

Code: Select all

deluser USERNAME sudo 
So, there is more then one way to skin a cat,....Take your pick on how you want to do this
===edit==IMPORTANT====
Make sure you do have a root account set up, before you remove your administrative privileges, you might need it one day.
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!

dankurth
Posts: 2
Joined: 2021-09-03 01:50

Re: Removing root privileges

#6 Post by dankurth »

It's been awhile since this question was asked and I see there were some answers which work, but after running into the same situation myself and fixing it in a slightly different manner I'd like to add some perhaps useful context info.

First of all the manner of making the user "account into an administrator account (root account?) by exploring the graphical interface of the settings" on Debian 11 if using the default Gnome can involve just selecting Settings, then selecting Users, then unlocking the Users dialog and then in Account Settings toggling the switch for Administrator to on. Once this is done in the Users dialog there is only one way to undo it in that dialog and that is to make someone else the Administrator. It's as if once someone is chosen as Administrator you can't get rid of it, at least if you're using the GUI only. Behind the scene the user who is Administrator has had their username added to the "sudo" group in /etc/group, but that's not obvious if you don't know it. Once that username is removed from that group (using gpasswd as already explained, or other means to edit /etc/group directly) then the user will be "normal" again and the switch that was toggled to on for Administrator in the Users dialog (for that user) will be toggled back off again.

In my case I had made myself Administrator using the Settings|Users dialog (after unlocking the Users dialog by using the root password). To undo it I then logged out, then logged in on different terminal as root and using vim to remove my username from the sudo entry in etd/group, then rebooted system just to be sure everything was reset and still working, then logged in to Gnome desktop and checked Settings to find myself a normal user again.

User avatar
canci
Global Moderator
Global Moderator
Posts: 2502
Joined: 2006-09-24 11:28
Has thanked: 136 times
Been thanked: 136 times

Re: Removing root privileges

#7 Post by canci »

This sounds like an option that Gnome maybe should do away with. There's a reason why most of the root stuff happens in the command line and not in GUI. I can think of a million reasons how this could go terribly wrong.
Image Stable / Asus VivoBook X421DA / AMD Ryzen 7 3700U / Radeon Vega Mobile Gfx (Picasso) / 8 GB RAM / 512GB NVMe

READ THIS:

* How to Post a Thread Here
* Other Tips and Great Resources

steve_v
df -h | grep > 20TiB
df -h | grep > 20TiB
Posts: 1418
Joined: 2012-10-06 05:31
Location: /dev/chair
Has thanked: 79 times
Been thanked: 189 times

Re: Removing root privileges

#8 Post by steve_v »

canci wrote: 2022-02-11 07:21 This sounds like an option that Gnome maybe should do away with.
To me, this sounds like the standard-issue oversimplified gnome-stupidity I've come to expect.

There is only One True Way to set up Desktop Linux, and that is to lock the root account (root is too confusing) and assign one user as Administrator (sudo is also confusing with all it's fine-grained access controls, but Administrator is nicely familiar to windoze refugees).
This of course means that if nobody is the anointed Administrator, there's no way to gain root privileges... So better make the already poorly explained idiot-mode radio-button mysteriously un-deselectable to keep the users from shooting themselves in the foot...
Yay for UX design by committee.

Or we could, ya know, leave out the button altogether and instead point people to the sudo man page so they understand what's really going on. Just a thought. :roll:

canci wrote: 2022-02-11 07:21 I can think of a million reasons how this could go terribly wrong.
Indeed.
Once is happenstance. Twice is coincidence. Three times is enemy action. Four times is Official GNOME Policy.

Post Reply