Linux CLI - Users and Groups
How can you allow a user to run only the
systemctl restart apache2 command with sudo, without full root access?systemctl restart apache2 command with sudo, without full root access?You can restrict sudo to specific commands by editing sudoers file.
Add a line in sudoers: username ALL=(ALL) NOPASSWD: /bin/systemctl restart apache2 correctly restricts sudo to only the specified command with no password prompt.
15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions