You are not logged in.
Hello,
I am trying to setup my sudoers file so I can run some programs that require root access, without needing to be prompted for password (mainly so I can have them start on login). From the research I've done, it seems like my below sudoers file should suffice, however "sudo mount -a" still requires a password to be entered.
I'm guessing it has something to do with the "terminus ALL=(ALL)..." line somehow superseding the "terminus ALL = NOPASSWD:..." line even though it occurs before, but I am not sure how supersedence works in the sudoers file.
(I've removed all the commented bits for brevity, since that's like 95% of the file)
root ALL=(ALL) ALL
Defaults targetpw # Ask for the password of the target user
terminus ALL=(ALL) ALL # WARNING: only use this together with 'Defaults targetpw'
#includedir /etc/sudoers.d
terminus ALL = NOPASSWD: /usr/bin/mountThank you!
Last edited by TheMohawkNinja (2020-09-17 22:53:11)
Offline
mainly so I can have them start on login
Then this is the wrong approach. Use a systemd service. For the case of `mount -a` that is included in the system services already - why do you need to do this again?
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
With the same /etc/sudoers file, I can 'sudo mount -a' with a unprivileged user without pass. I think your sudoers file is correct. Do you have any NFS mount on your /etc/fstab ?
Last edited by solskog (2020-09-17 02:13:59)
Offline
TheMohawkNinja wrote:mainly so I can have them start on login
Then this is the wrong approach. Use a systemd service. For the case of `mount -a` that is included in the system services already - why do you need to do this again?
You know, I had a feeling that there was a better way to do this. That did the trick!
Oh, and to answer your question, it's so I can access the C: drive of my Windows gaming rig from Linux if needed.
Offline
Then you don't even need a new service - just add a line for it in your fstab.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline