How to Add User to Sudoers CentOS?

HostStud

Administrator
Staff member
Steps to Create a New Sudo User on Centos

  1. Log into the server as the root user.
    # ssh root@server_ip_address

  2. Add New System User in CentOS, replace username with name of new user.
    # adduser username

  3. Use the passwd command to update the New User's password.
    # passwd username

  4. Add User to the Wheel Group in CentOS
    # usermod -aG wheel [I]username[/I]

  5. Switch to the sudo User
    Use the su command to switch to the new user account.
    # su - [I]username[/I]
 
Top