RHCSA 9.4: Privileged access
sudo without a password for a group, one command for one user, and full sudo the RHEL way.
Before you start
The lab creates group devs with member dan, and users gina and
alice (password Lab-Pass-1 for all three). It notes /etc/sudoers and
/etc/sudoers.d/ so reset can put them back.
Tasks
- Let the members of group
devsrun any command as root without a password. - Let user
ginarun onlysystemctl restart httpdas root. - Give
alicefull sudo the RHEL way, with her password.
Hints
- A file in
/etc/sudoers.d/, edited withvisudo -f(or checked withvisudo -c);%devs ALL=(ALL) NOPASSWD: ALL. Asdan:sudo -n id -u. gina ALL=(root) /usr/bin/systemctl restart httpd; asgina:sudo -l. Installhttpdif you want to run it for real.- The
wheelgroup;usermod -aG;id alice,sudo -l -U alice.