How to delete User with User ID and GID 0


Answer: 1

3 hours ago

I just created a user with UID and GID to 0. Now when I access this user lets say "abc" will login as root. But when I loin as root i cannot list all the directories with ls command where i can do it with the user abc.

I want to go back to normal, delete this user with uid and gid o. I tried to update the passwd file but it does not let me change it.

How do i delete this user abc and use only root as root

Added by: Mrs. Madge Waelchi

Answer: 2

1 hours ago

Instead of deleting the user you can change the UID and the GID of your user:

usermod -u <NEWUID> <USERNAME>    
groupmod -g <NEWGID> <GROUP>

The default group has same name of your username.

Remember in Ubuntu the UId from 0 to 99 is reserved as system users.

Also users with UID < 1000 will not appear in the user lists so choose a UID > 1000

Now you can delete the user eaily and safely if you want to.

Popular Search

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 1 2 3 4 5 6 7 8 9