This guide configures only the minimum commands that HighAsCG may run as root without a password when the app runs as casparcg:casparcg.
Use this for the web UI “Nuclear” actions:
nodm)ps -o user= -p "$(pgrep -f highascg | head -n1)"
Expected user: casparcg
Use visudo (never edit sudoers with a regular editor):
sudo visudo -f /etc/sudoers.d/highascg
Add:
# HighAsCG privileged actions (strict allowlist)
casparcg ALL=(root) NOPASSWD: /bin/systemctl restart nodm, /usr/bin/systemctl restart nodm, /sbin/reboot, /usr/sbin/reboot, /bin/systemctl reboot, /usr/bin/systemctl reboot
Save and exit.
sudo chown root:root /etc/sudoers.d/highascg
sudo chmod 0440 /etc/sudoers.d/highascg
casparcgsudo -u casparcg sudo -n /bin/systemctl restart nodm
sudo -u casparcg sudo -n /sbin/reboot
Notes:
-n means non-interactive (fail immediately instead of prompting for password).HighAsCG calls sudo non-interactively (sudo -n).
If sudoers is missing or too strict, API calls fail with permission errors.
systemctl *./etc/sudoers.d/ with mode 0440.