# Lost users after kernel compile



## JohnLWebb (Jun 9, 2009)

I recompiled and installed my kernel from a konsole window in KDE. Then I exited KDE. When I exited, I attempted to su to issue a reboot command. But when I typed su and hit enter, the response was "Who are you?"


So, I switched to a different vterm where I was already su and issued the reboot command.

When the system came back up, I tried to login as my <user> account. My username/password would not work. So, I entered root as the login. It logged me in without asking for a password...

I went back through the console output and found a couple of unknown user messages, haldaemon and polkit.

So, I am assuming my users are all gone but I have no idea why or what I should do now. Does anyone have any idea what happened?


----------



## phoenix (Jun 9, 2009)

You didn't, perhaps, run mergemaster did you?  Overwriting your /etc/passwd, /etc/group, and/or /etc/master.passwd?

If so, hope you have backups.    If not, you'll need to recreate all the accounts manually and/or re-install all your ports to have them recreated automatically.

You may get lucky, and have usable copies available under /var/backups.


----------



## JohnLWebb (Jun 9, 2009)

I did not run mergemaster. At least not to my knowledge. This was a new install of 7.2 and I realized I had not installed the src so, I installed the src before compiling by running sysinstall following the direction in the handbook. I don't know if that could have overwritten something.


----------



## phoenix (Jun 9, 2009)

Yet another reason not to use sysinstall after the OS is installed.  

From the sounds of it, you re-installed the base OS with a couple of extra distribution sets, which overwrites /etc/passwd, /etc/group, and /etc/master.passwd.

Unless you have backups, you're hooped.


----------



## jrm@ (Jun 10, 2009)

You can use vipw to see if your password file was overwritten.


----------



## fronclynne (Jun 10, 2009)

Yes, sysinstall can, and probably did, overwrite your /etc/passwd _et al_.  Check /var/backups, just in case you are lucky.  If not, you will have to recreate your users.  But it's not the worst thing on Rth, and you learned to make sure you've backed up /etc (I also back up /var*) before you do _any_ upgrades.

And as *phoenix* saith: Yet another reason not to use sysinstall . . .


* before buildworld or  a major portupgrade run I do `# tar jcvf /home/backups/hostname_var.tar.bz2 /var && tar jcvf /home/backups/hostname_etc.tar.bz2 /etc` and it generally suffices to mitigate the effects of a mistyped mergemaster command or power failure during portupgrade (or mildly worse, unnamed horrors).  Obviously this does nothing to protect you against the whole freakin' drive dying, but it also does nothing to help if you are eaten by a dinosaur or smushed by a rogue wave in the south Atlantic.


----------



## JohnLWebb (Jun 10, 2009)

Ok. Thanks. Lesson learned... backup /etc, /var, /? before any changes. No sysinstall after initial load...


I changed the root password, added my normal user and two deamon users, polkit and haldaemon. Apparently not all users were blown away. I guess it was only the users created since the install. I guess the sysinstall overwrote my users with the basic set from installation. Everything above polkit must be the default users setup with freebsd install...



$ cat /etc/passwd | cut -d: -f1 | grep -v \#


```
root
toor
daemon
operator
bin
tty
kmem
games
news
man
sshd
smmsp
mailnull
bind
proxy
_pflogd
_dhcp
uucp
pop
www
nobody

polkit
haldaemon
```


----------



## SPlissken (Oct 6, 2009)

Hello , i have same problem after upgrading from 7.2 to 8.0RC1
I did mergemaster and lost my user and not password on root


----------



## SPlissken (Oct 6, 2009)

I think that my mistake was to answer i on each question from mergemaster -i


----------



## henter2009 (Dec 17, 2009)

SPlissken said:
			
		

> I think that my mistake was to answer i on each question from mergemaster -i



Cool, I did exactly the same thing... + a wrong buildworld... blow my system in few minutes...

As far as I can see...

recreating my user, will allow me to access as well to my KDE session... etc...

And rebooting with my old kernel 7.2, recompiling the whole source will not be a mayor problem...

Is there something else I must take care for?


----------



## SPlissken (Dec 17, 2009)

Well i solved it by doing a 
mv /home/splissken /home/splissken.bak
did an useradd and move bak my /home/splissken


----------



## SirDice (Dec 17, 2009)

SPlissken said:
			
		

> Well i solved it by doing a
> mv /home/splissken /home/splissken.bak
> did an useradd and move bak my /home/splissken



You can just create a new user. It will use the directory if it already exists.


----------



## SPlissken (Dec 17, 2009)

SirDice said:
			
		

> You can just create a new user. It will use the directory if it already exists.



Ok thanks , as i didn't know if it will act like this , i did this 'mv' before, was afraid to lost my precious data (holiday divx and stuff like that  )


----------

