elektropepi
Cadet
- Joined
- Feb 12, 2021
- Messages
- 6
I want to write a program that remotely shuts down my TrueNAS server. When I enable sudo for the user myuser, the command ssh myuser@hostname -t "sudo poweroff" is actually enough.
But I don't want to give that user full sudo access, he should only be able to use the poweroff command. I can achieve this by modifying the /etc/local/sudoers file and adding the following line myuser ALL=(ALL) NOPASSWD: /sbin/poweroff. But as expected, this change isn't persisted over reboots.
How can I persist changes to the sudoer file (since more detailed sudo restrictions are not possible with TrueNAS configurations according to the source code)?
But I don't want to give that user full sudo access, he should only be able to use the poweroff command. I can achieve this by modifying the /etc/local/sudoers file and adding the following line myuser ALL=(ALL) NOPASSWD: /sbin/poweroff. But as expected, this change isn't persisted over reboots.
How can I persist changes to the sudoer file (since more detailed sudo restrictions are not possible with TrueNAS configurations according to the source code)?