Sudoers file how do i add a user?

I have a user account for accessing the internet etc , where i don’t need "wheel’ privileges.
To use protonvpn i need sudo rights. how do i added this user account to sudo , just for this case ?
Creating /etc/sudoers does not work etc

Many thanks in advance :slightly_smiling_face:

Does this help?
https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux_OpenStack_Platform/2/html/Getting_Started_Guide/ch02s03.html

@doct0rHu Couldn’t manage to get it ti work. CL i assume uses the values in the file /usr/share/defaults/sudo/sudoers ? I have no idea if anything wriiten in /etc/sudoers will add to those default values as it kept saying that my user name was not in the sudoers file, despite what i believe to be wriiten in the correct syntax. In my Gentoo setup it was possible to use sudo to give root access to one particular program ie Veracrypt .
Anyway it’s not critical at this moment as i can still use NM for ProtonVPN connections.

Thank you for help :slight_smile:

I edited sudoer file with visudo to make sure certain environment variables are kept unchanged. And I don’t have any trouble with that.

Did you edit it with visudo or other editor? It shall not make a big difference but visudo provide syntax checks.

I edited with “EDITOR=nano visudo /etc/sudoers” adding the following line

MY_USERNAME ALL=(ALL) NOPASSWD: /usr/local/bin/protonvpn

I even copied /usr/share/defaults/sudo/sudoers to /etc/sudoers and added the line.
But in both cases my username was not found.

Put it in a file within a /etc/sudoers.d/ drop-in directory instead and it should work.

4 Likes

That worked ! I had wiped ProtonVPN prog , but tested with swupd.

Many thanks for the solution :slight_smile:

This URL 404’s for me.

You can use wayback machine

Hi,
so I created /etc/sudoers.d/visudo
with content:

username ALL=(ALL:ALL) ALL

…logged out & in but my application still complains about sudo permissions missing

any ideas ?

Check https://docs.01.org/clearlinux/latest/guides/maintenance/enable-user-space.html

Chris