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

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *