In this article, we will see how to create a user in Centos and how to grant root privileges to a user in Centos.
How to Create Users in Centos Linux
You can use the command below to create a user in Centos.
We have added this user, but how do we determine its password. You can use the command below to determine the password.
Instead of the frks above, you should type the username you want to set the password for.
After typing your new password in “New password:” and “Retype new password” above, you will have set your new password for your user.
How To Grant root Privileges to a User in Centos
We created a user and defined his password. Now let’s grant root Privileges to this user. To do this we need to edit sudoers as below.
After editing Sudoers, we add the user created as follows.
After adding, we save and exit(:wq) and our user now has root privilege.