LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   multiple user accounts with uid 0 . I want to delete all user names except "root" (https://www.linuxquestions.org/questions/linux-newbie-8/multiple-user-accounts-with-uid-0-i-want-to-delete-all-user-names-except-root-909377/)

m00seman645 10-21-2011 12:20 PM

multiple user accounts with uid 0 . I want to delete all user names except "root"
 
Hi guys,

Here's the problem, I asked a coworker to give himself a new user account on our SUSE 10 box. He was going to create a cron job for the account he was making, and wanted to be an equivalent of the root user. He logged in as root and created a new account with the following commands:

Code:

useradd -ou 0 bob
So he added another username to the root uid, I want to remove his account now for obvious reasons and make him a normal user account. I've tried logging in as root and using

Code:

userdel -r  bob
but I get the message that the account is active. Obviously because I'm currently logged into root. Is there any way that I can change the bob user's uid from 0 to something else, or delete the username so that it goes back to how it should be with root being the only username for uid 0? Any help would be greatly appreciated.

Thanks,
Corey

crts 10-21-2011 12:50 PM

Hi,

interesting problem. Now I have not tried this since I do not want to mess up my system but you could try to edit the file
/etc/passwd

Search for the user and change his uid (gid) to something else. Preferably to an unused number. Log out and then log back in as root. The 'active' error should not appear if you now try to delete the account and remake it properly.

P.S.: Welcome to LQ.

m00seman645 10-21-2011 01:56 PM

Thanks crts you're a life saver. I changed bobs uid by editing passwd . That logged him in as a normal user, but when I logged in as root I still wasn't able to delete the account with userdel, it gave me the same error. I was however able to see the bob user in yast and delete it that way. Still it's very strange that the command still wouldn't work. Anyway I got the problem resolved and that's good enough for me. Thanks for you help again and for the welcome crts.

-Corey


All times are GMT -5. The time now is 02:44 PM.