This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Friday, September 8, 2017

Adding a user to Sudoers in simple way

Login as root to server. The root user are the only one who has privilege to add new user.

Once you logged-in, you may now try the following commands below:

    Create a new user.
    useradd  [username]
    Add password to user
    passwd [username]
    Grant root privileges to user Edit the visudo file by simply typing
    enter code here

Find the following line of code: 

root ALL=(ALL) ALL
Then add this code below:
[username] ALL=(ALL) ALL
In Otherway
 su - root
and enter your password, then :
echo 'USERNAME ALL=(ALL:ALL) ALL' >> /etc/sudoers

  to add the user in sudoers file

No comments:

Post a Comment