I want to edit the sudoers file on my Synology Disk Station (specifically, to enabled password-less shutdown), however my version of Synology DSM does not have visudo installed.
How can I install it so I can safely edit the sudoers file?
I accidentally bricked it and managed to get it back (using task planner / script as root).
In case you edit your sudoers file, make sure to keep an extra (or two) terminals open with ssh connected to your synology and sudo -i executed, so you have extra root prompts at hand to fix any. And make a backup of /etc/sudoers (e.g. sudo cp /etc/sudoers /etc/sudoers.bak) before editing. Then test with sudo -l with the user you're configuring to make sure you haven't messed up.
Anyways, putting your changes in /etc/sudoers.d/ is probably still the best thing to to.
/etc/sudoers.d/for your own account without any need forvisudo.user_name ALL=(ALL) NOPASSWD: /sbin/poweroff, /sbin/reboot, /sbin/shutdownin/etc/sudoers.d/shutdownand it works. Some sites still recommend using visudo for sudoers.d so I'd still be happy with an answer to the original question.etc/sudoers.dnot in the mainsudoconfig file