persistent sudo rules

next40

Cadet
Joined
Aug 18, 2021
Messages
2
hi all, i use TrueNAS Core 12.0U5.1 and trying to add custom rules to:
1. /etc/local/sudoers.d/rulesfile
2. /usr/local/etc/sudoers.d/rulesfile
3. /conf/base/etc/sudoers.d/rulesfile (created by me)

or directly to files try adding rules for @includedir /usr/local/etc/sudoers.d directory configs:
1. /etc/sudoers
2. /etc/local/sudoers
3. /usr/local/etc/sudoers
4./conf/base/etc/sudoers

example of rules:
Code:
Defaults:zabbix !requiretty
Cmnd_Alias SMARTCTL = /usr/local/sbin/smartctl
Cmnd_Alias SMARTCTL_DISCOVERY = /etc/zabbix/scripts/smartctl-disks-discovery.pl
zabbix ALL= (ALL) NOPASSWD: SMARTCTL, SMARTCTL_DISCOVERY
Defaults!SMARTCTL !logfile, !syslog, !pam_session
Defaults!SMARTCTL_DISCOVERY !logfile, !syslog, !pam_session


Where i find information about create persistent config?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
You cannot modify configuration files outside of the UI. They will get rewritten at each reboot.

That being said you can create the file somewhere on your persistent storage pool and create a post init task that copies it to the destination every time the system boots.
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
Top