Example we create new user with username is tutorialspots:
Step 1:
useradd tutorialspots
Step 2:
Set password with command: passwd
[root@tutorialspots ~]# passwd tutorialspots Changing password for user tutorialspots. New password: Retype new password: passwd: all authentication tokens updated successfully.
Step 3:
Edit file /etc/sudoers
:
visudo
or sudo vi /etc/sudoers
Add this line:
tutorialspots ALL=(ALL) ALL
Done!
Note: if you use command you might get warning:
-- INSERT -- W10: Warning: Changing a readonly file
2 Comments
CentOS 7: how to install xfce Desktop | Free Online Tutorials
(August 9, 2020 - 8:31 am)[…] CentOS: how to create sudo user […]
CentOS 8: how to install xfce Desktop | Free Online Tutorials
(January 22, 2021 - 3:13 pm)[…] Step 1: CentOS: how to create sudo user […]