There is, but it needs to be included via #includedir /usr/local/etc/sudoers.d
directive from the /usr/local/etc/sudoers file,
which it is not by default.
fyi:
- adding
#includedir /usr/local/etc/sudoers.d
to /usr/local/etc/sudoers doesn't survive a reboot.
- Actually even adding a file to /usr/local/etc/sudoers.d doesn't survive a reboot (it gets removed!)
I also don't understand how to modify /conf/base/etc/local/sudoers so that it would "auto-add" the include to /usr/local/etc/sudoers . Actually it already contains the below lines by default, but still the include is not added to /usr/local/etc/sudoers .
Code:
## Read drop-in files from /usr/local/etc/sudoers.d
@includedir /usr/local/etc/sudoers.d
But I guess that even if I manage to get it added, it still wouldn't survive a TrueNAS upgrade, so it actually isn't a valid solution for our problem...
So I guess I'll have to create a post init task to modify the /usr/local/etc/sudoers file. Thanks for that tip!
edit:
Following post init command seems to do the trick for me:
Code:
echo -e "\n# NOPASSWD sudo for username, added by post-init script\nusername ALL=(ALL) NOPASSWD: ALL" >>/usr/local/etc/sudoers
Replace username by the user for which you'd like to to have NOPASSWD enabled
edit2:
I also found following rejected suggestion which claims that it was added to the GUI in TrueNAS12.0-U3+, but I could not find this in TrueNAS12.0-U4. I've asked for clarification...
edit:
Apparently it is there, but only by using the API, not in the GUI. I'm not sure how to do it using the API though, so if anyone knows, feel free to let us know :)