systemctl – execute commands without password
We make changes to the file to execute commands systemctl no user password.
To file / etc / sudoers add:
Username ALL=(ALL) NOPASSWD: /bin/systemctl start service_name
Username ALL=(ALL) NOPASSWD: /bin/systemctl stop service_name
Username ALL=(ALL) NOPASSWD: /bin/systemctl restart service_name