Hello!
I am having some troubles with visudo. The following I want to do:
My main user is called usera. A second user is called userb.
I am logged in with usera and want to run an app as userb. The app is located in /opt.
The command to do this usually looks like this:
sudo -H -u userb /opt/app.appimage
However, with this command, I am asked for the password. I want it to work without entering the password, therefore I tried to set a rule with visudo.
My visudo line looks like this:
usera ALL=(userb) NOPASSWD: /opt/app.appimage
However, this gets ignored, I am still asked for the password. This line works with Ubuntu so I wonder if I it has to be different in Fedora or is there a known issue with visudo?
Any ideas how to resolve the issue?
Thanks
UPDATE: I works now. It seems the line
usera ALL=(userb) NOPASSWD: /opt/app.appimage
needs to be at the right place in the sudoers file. Putting right below
Allows people in group wheel to run all commands
%wheel ALL=(ALL) ALL
works.