January 21, 201511 yr Use the following commands to create the new user dennis, grant him the same privileges as root and set him a password : # useradd -ou 0 -g 0 dennis# passwd dennis Perhaps you already have some user dennis and you would like to give root permissions to a normal user. # grep dennis /etc/passwddennis:x:1001:1001::/home/dennis:/bin/sh Edit /etc/passwd file and grant root permissions to the user dennis by changing User and Group IDs to UID 0 and GID 0 : # $ grep dennis /etc/passwddennis:x:0:0::/home/dennis:/bin/sh You won't be able to delete second root user with another UID 0 using userdel command. # userdel dennisuserdel: user dennis is currently used by process 1 To delete user dennis with UID 0, open /etc/passwd file and change dennis's UID. For example, change the line : dennis:x:0:0::/home/dennis:/bin/sh to dennis:x:1111:0::/home/dennis:/bin/sh Now, you'll be able to delete user dennis with userdel command (as shown above)
Create an account or sign in to comment