When we run a deploy script on our server, it's sometimes necessary to restart various tools like PHP or Node process - especially when running a Node renderer process for server side rendering.
These tools require root password, which can stop the deploy process. To avoid this issue we can whitelist some commands that a user can run, without requiring elevated permissions.
Example:
{linux_user} ALL=(root) NOPASSWD: /usr/bin/systemctl reload php8.5-fpm