I have set the UID of user01 to be 0 when I created it. Now I am trying to delete the user and it complains "user01 is currently logged in". I check the process list, and that doesn't seem to be true. However, root (which also has UID of 0) has processes running. How can I delete user01? I also tried changing UID of user01 with usermod, with no luck.
Asked
Active
Viewed 1,813 times
1
-
How are you trying to delete the user exactly? What operating system is this? – David Schwartz Aug 24 '15 at 20:10
-
This is Linux: 3.14.42-31.38.amzn1.x86_64 . Used command "userdel user01" – James Velez Aug 24 '15 at 20:59
1 Answers
1
I would do that with:
sed -i '/user01/d' {passwd,shadow}
Adam Balawender
- 41
- 2
-
1Followed by rm -r /home/user01 to get rid of their home directory ! (James, Adams command deletes the entry from the password and shadow files, effectively killing that user) – davidgo Aug 24 '15 at 21:52
-