sudoers: Including /usr/local/etc/sudoers.d

apiening

Cadet
Joined
Nov 18, 2020
Messages
2
I have created a sudo configuration with the following commands:
Code:
mount -wu /
vim /conf/base/etc/local/sudoers.d/mysudoconfig
mount -ru /

I checked that this change is persisted, and I can access the file after rebooting the TrueNAS-12.0 system.

However, the custom config file was not included.
When I add the following line to the file /usr/local/etc/sudoers, the custom sudo config is included and does work immediately.
But, after a reboot the line is not there anymore.

I also checked the file /conf/base/etc/local/sudoers, but this seems not to be the source for the file /usr/local/etc/sudoers so I assume that the later file is generated somehow else.

How can I make this change persistent and enable sudo to include custom configs from /usr/local/etc/sudoers.d?
 

apiening

Cadet
Joined
Nov 18, 2020
Messages
2
I missed to paste the line that needs to be added to the end of the file /usr/local/etc/sudoers:
Code:
#includedir /usr/local/etc/sudoers.d


Sorry for confusion.
 
Top