1

I need a non-root user to do certain (safe) things. I didn't pay attention, and used useradd -ou 0 -g 0 new_user_name, which gave root permissions to the user. It also has the same UID of 0.

Before I do something stupid, can anyone help me on how to delete this user, or simply change the permissions/UID? I already discovered what happens with pkill. Hahaha.

Videonauth
  • 33,815

1 Answers1

0

userdel has an option -f to force removal. userdel would probably just delete the passwd entry and home directory, without affecting the actual root account.

To be safer, I might be inclined to hand-edit the password file to remove the entry for your new root user, then hand-remove new root user's home directory. You may have a command on your system named nano, which lets you safely edit /etc/passwd in a text editor.

Source: https://superuser.com/questions/804210/how-can-i-delete-root-users

kek
  • 490