The FreeBSD Diary

The FreeBSD Diary (TM)

Providing practical examples since 1998

If you buy from Amazon USA, please support us by using this link.
Scripts / handy tips
 New Topic  |  Go to Top  |  Go to Topic  |  Search  |  Log In   Newer Topic  |  Older Topic 
 Kuser removes root account
Author: Rhyous 
Date:   04-12-03 02:39

Hey all,

I run FreeBSD 5.1 with KDE 3.1.4.

I was just playing around seeing what gui tools came with and I found Kuser.

That is a problem. Kuser is bad...they need to fix it.

This is what happened:

Kuser deleted the first three lines from my /etc/master.passwd file and my /etc/passwd file.

Next thing I know I can't su to root because root doesn't exist.

Guess what else Kuser did?

It set the timeout on my user accounts to December 31, 1969 (or some date in the 1960s).

So I couldn't login at all.

Well Here is how to fix it.

1. Reboot the computer in Single User Mode (option 4 on boot menu)
2. Once booted you will be promted for your shell, just hit enter.
NOTE: Now in single user mode you only have read access
3. Get write access by typing in the following com mands:
mount -u /
mount -a
NOTE: That should give you write access. You should be logged in as toor.
4. copy your /var/backups/master.passwd.bak file to /etc/master.passwd and yes overwrite the old one.
5. Now just run the following command:
pwd_mkdb -p /etc/master.passwd

That should fix your root account!


Jared Barneck

Key words: recover root account - add root account - create root account - fix root account - root login - no such user root

Reply To This Message
 Re: Kuser removes root account
Author: Mike Crosland 
Date:   21-01-04 13:34

I just had the same thing happen to me (using 5.2 release), except it seems to have been partially fixed as it only wiped out the first line of my passwd file, ie "root"! Thanks for the fix btw :)


Reply To This Message
 Re: Kuser removes root account
Author: rastavideo 
Date:   25-07-04 17:12

thanks for the suggestion. same thing happened to me and this is the good fix.

Reply To This Message
 Forum List  |  Threaded View   Newer Topic  |  Older Topic 

 User Login
 User Name:
 Remember my login:
 Forgot Your Password?
Enter your email address or user name below and a new password will be sent to the email address associated with your profile.
How to get the most out of the forum