CentOS / Red Hat: Sudo Allows People In Group Admin To Run All Commands
By default, CentOS and Red Hat systems are configured to allow users who are members of the "wheel" or "sudo" group to run all commands using the "sudo" command. Here's how to add users to the "sudo" or "wheel" group:
- Log in as root or a user with sudo privileges.
- Open the sudoers file in a text editor with the command:
visudo- Find the line that says:
## Allows people in group wheel to run all commandsrn%wheel ALL=(ALL) ALL- Uncomment the line by removing the "#" at the beginning of the line.
- Save and exit the file.
- Add the user to the "wheel" or "sudo" group using the following command:
usermod -aG wheel <username>- Log out and log back in for the changes to take effect.
