- Log on as root ( or switch to su with root password).
- On the command window, do the following.
- Enter "visudo".
- vi loads the sudoer file.
- Look for %wheel in the sudoer file by entering " /%wheel "
- Remove # from the line "# %wheel ALL=(ALL) ALL" to enable the wheel group with same privileges as root.
- Save and exit vi via :wq.
- To create a new user:
- adduser [new_user_name]
- passwd [new_user_name] [password]
- Use the usermod command to add the user to the wheel group:
- usermod -aG wheel [user_name]
- Switch to the non-root user by entering "su - [user_name]"
- Test by running a command that's allowed for root only.
For example, /root is generally accessible only by root user. Try listing the content of /root. - sudo ls -al /root
Monday, April 9, 2018
CentOS 6 - Add a user to sudoers
Here are steps in adding a user to sudoers in CentOS 6
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment