I want to give a group permission to install software without needing to input a root/sudo password. I'm on Linux Mint 20.3 Cinnamon.
I have created a group called "basicsudo".
I first typed
$ which apt-get
/usr/bin/apt-get
Then
sudo visudo
then I added the following line
%basicsudo ALL=(ALL) NOPASSWD: /usr/bin/apt-get install
to /etc/sudoers.tmp
[...]
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
%basicsudo ALL=(ALL) NOPASSWD: /usr/bin/apt-get install
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d
I assigned the group to a user by using the Groups and Users GUI from the menu. To check this I've run
$ groupname Alice
Alice, basicsudo
from my account.
When logged in as Alice, this is confirmed
$ groups
Alice, basicsudo
But when trying to execute the following line as Alice, I do not succeed:
$ sudo apt-get install python3-pip
[sudo] password for Alice:
Sorry, user Alice is not allowed to execute '/usr/bin/apt-get install python3-pip' as root on computername.
So clearly a) I'm prompted for a password and b) I can't execute it despite entering a password.
What is the proper way to do this?
groupnamegroup? Where exactly did you add the lines you show under "I assigned the group to a user."?groupswhen you are logged in as Alice?groupname Alicefrom my root account.apt-get install ./packageand you're done.