I'm on Linux Mint 18. I'm writing a program which temporarily removes the current admin user from the sudo group. The intention is to use this program in conjunction with others to be able to precommit to certain actions, such as blocking some websites.

The program currently functions for any new terminal windows I open after removing the current user from the sudo group. However, I am still able to access the "Software Manager" GUI, and the "Users and Groups" GUI interface using my password. These are things which typically need root access. Is there some way of relaying the changes in the sudo group to the session so that I'm not able to access these GUIs?

1 Answer 1


You can force the kernel to reset the group id, i would recomend not having that user on the sudo group but instead add/remove a file in /etc/sudoers.d, like for example making a file called /etc/sudoers.d/admin-$USER with the contents


And when the program runs if it runs as root it will have SUDO_USER variable, and you cloud remove the file like rm -- /etc/sudoers.d/admin-$SUDO_USER Else use sudo -- rm -- /etc/sudoers.d/admin-$USER

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .