ROOT , The super user in LINUX , Lets learn how to create user with root privileges in Linux, delete a root user or make user root
How To Create USER Account with ROOT Privileges
Commands to create the new user abhinav, grant the root privileges & set password :
# useradd -ou 0 -g 0 abhinav
We created the user abhinav, with UID 0 and GID 0, so he is in the same group and has the same permissions as root.
Giving ROOT privillages to existing user
Example user abhinav exists and we wanna give it ROOT privillages
# grep abhinav /etc/passwd
Edit /etc/passwd file and grant root permissions to the user abhinav by changing User and Group IDs toUID 0 and GID 0 :
# $ grep john /etc/passwd
Delete a USER Account with UID 0
We can’t delete second root user with another UID 0 using userdel command.
# userdel abhinav
userdel: user john is currently used by process 1
To remove user abhinav with UID 0, open /etc/passwd file and change abhinav’s UID.
For example, change the line :
to something like :
Now, we can remove user abhinav with userdel command :
# userdel john