Gangmax Blog

自由之思想,独立之精神

How to Create a Sudo User on CentOS

| Comments

  • Install “sudo”
1
yum install sudo
  • Make sure the following content in the “/etc/sudoers” file below is enabled
1
2
## Allows people in group wheel to run all commands
%wheel  ALL=(ALL)       ALL

If it’s not enabled, you need to run “chmod u+w /etc/sudoers” before editing the file and “chmod u-w /etc/sudoers” after finishing the editing.

  • Create a user account and add it into the “sudo” list
1
2
useradd -m auser
usermod -aG wheel auser

Done.

From: 1, 2, 3, 4, 5 and 6.

Comments