Link to home
Start Free TrialLog in
Avatar of RKFcomputers
RKFcomputers

asked on

Removing multiple accounts with UID 0

We are running a RHEL 6 server, and for reasons I won't delve into at the moment a few additional accounts were created with UID 0 giving them root access.

I want to get rid of them, but trying to delete the user by username doesn't work as the OS goes by UID and says they are logged in. If I try to log them out all processes owned by root are killed off (ya, learned that the hard way).

I theorize that using usermod might let me change the UID - but I don't know if that will also affect the root account.

Should I just create a dummy account, then edit /etc/passwd to set the UID and group for each account to the UID / group of the dummy account, then remove them all?

What do you suggest that will not result in locking up the server?

Thanks!
SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RKFcomputers
RKFcomputers

ASKER

Thank you both!

Sadly I'm not getting alerts from Experts Exchange, so I didn't see these until now.

I've copied the passwd to a backup, just in case, then deleted all the users but one. That one I'll probably change to a new user number.