Ubuntu: how to create sudo user


Example we create new user with username is tutorialspots:

Step 1:

sudo useradd tutorialspots

Step 2:
Set password with command: passwd

root@tutorialspots:~# sudo passwd tutorialspots
New password:
Retype new password:
passwd: password updated successfully

Step 3:

sudo visudo

Add this line:

tutorialspots ALL=(ALL:ALL) ALL

Step 4:

root@tutorialspots:~# mkdir /home/tutorialspots
root@tutorialspots:~# chown tutorialspots:tutorialspots /home/tutorialspots

Done!

1 Comment

Leave a Reply