HowTo : Create USER with ROOT Privileges in Linux
From this article you'll learn how to create a user with root privileges or grant root permissions to an existing user by setting User and Group IDs.
I'll also explain how to delete a user with root privileges (with UID 0 in particular).
Actually it is not a good idea to give all the permissions of root to a non-root user, so use the sudo command on the production servers to run items as superuser, instead of using the methods below.
Create a USER Account with ROOT Privileges
Lets say we need to add a new user and grand him root privileges.
Use the following commands to create the new user
# passwd john
We've just created the user
Grant ROOT Privileges to an Existing USER
Perhaps you already have some user
Delete a USER Account with UID 0
You won't be able to delete second root user with another UID 0 using
userdel: user john is currently used by process 1
To delete user
For example, change the line :
to something like :
Now, you'll be able to delete user