DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 28th April 2009
roddierod's Avatar
roddierod roddierod is offline
Real Name: Rod Person
VPN Cryptographer
 
Join Date: Apr 2008
Location: Pittsburgh, Pa
Posts: 382
Thanked 13 Times in 13 Posts
Default [SOLVED] root: unknown user

1st the moral to this story is do not upgrade your system at 5am before your 4th cup of coffee

Anyway, that is what I did. Well I hosed the mergemaster of the group file somehow and what that did was to remove root and toor from my group file.

At first I thought the password were just blanked out until I tried

Code:
passwd root
and got the lovely error of:

Code:
root: unknown user
So my question is what is the best way to go about fixing root?

I can just adduser root or can I?
My other option seems to be to boot in single user and copy or merge the group file from /var/temproot.

OR are there other options than those two options that I've missed?

Thanks.
__________________
"The basic tool for the manipulation of reality is the manipulation of words. If you can control the meaning of words, you can control the people who must use the words." -Philip K. Dick

Last edited by roddierod; 28th April 2009 at 10:19 PM.
Reply With Quote
  #2   (View Single Post)  
Old 28th April 2009
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Real Name: Ben
Spam Refugee
 
Join Date: Jul 2008
Location: Rotterdam, The Netherlands
Posts: 337
Thanked 32 Times in 30 Posts
Default

If it's only the group file you hosed I'd suggest dropping to single user and restoring the group file. By the way, root and toor are not in the group file at all. Root is part of the wheel and operator groups, that's all.
Reply With Quote
  #3   (View Single Post)  
Old 28th April 2009
roddierod's Avatar
roddierod roddierod is offline
Real Name: Rod Person
VPN Cryptographer
 
Join Date: Apr 2008
Location: Pittsburgh, Pa
Posts: 382
Thanked 13 Times in 13 Posts
Default

Ok...root is in the wheel group when I look at the current group file.

But trying to login as root gives me incorrect password.
Trying to reset the password gives me unknown user.

I think I'm missing something here, but I don't know what?
__________________
"The basic tool for the manipulation of reality is the manipulation of words. If you can control the meaning of words, you can control the people who must use the words." -Philip K. Dick
Reply With Quote
  #4   (View Single Post)  
Old 28th April 2009
DutchDaemon's Avatar
DutchDaemon DutchDaemon is offline
Real Name: Ben
Spam Refugee
 
Join Date: Jul 2008
Location: Rotterdam, The Netherlands
Posts: 337
Thanked 32 Times in 30 Posts
Default

Is root in /etc/master.passwd and /etc/passwd?
Reply With Quote
  #5   (View Single Post)  
Old 28th April 2009
roddierod's Avatar
roddierod roddierod is offline
Real Name: Rod Person
VPN Cryptographer
 
Join Date: Apr 2008
Location: Pittsburgh, Pa
Posts: 382
Thanked 13 Times in 13 Posts
Default

Can't check that at the moment as ssh isn't working either it seems. But that's the first thing I'll do as soon as I get home.

I did have to adduser my normal user account also to get it to work. I was just uncomfortable doing such with root.
__________________
"The basic tool for the manipulation of reality is the manipulation of words. If you can control the meaning of words, you can control the people who must use the words." -Philip K. Dick
Reply With Quote
  #6   (View Single Post)  
Old 28th April 2009
roddierod's Avatar
roddierod roddierod is offline
Real Name: Rod Person
VPN Cryptographer
 
Join Date: Apr 2008
Location: Pittsburgh, Pa
Posts: 382
Thanked 13 Times in 13 Posts
Default

ok, root was not in /etc/passwd or /etc/master.passwd

I tried to restore /etc/passwd, /etc/master.passwd and group from a backup file I had but that did not work either.

Any hints?
__________________
"The basic tool for the manipulation of reality is the manipulation of words. If you can control the meaning of words, you can control the people who must use the words." -Philip K. Dick
Reply With Quote
  #7   (View Single Post)  
Old 28th April 2009
phoenix's Avatar
phoenix phoenix is offline
Risen from the ashes
 
Join Date: May 2008
Posts: 699
Thanked 90 Times in 81 Posts
Default

Is toor list in the passwd file? If so, you can login as toor and have root access.

Do any of your users have sudo access? You can run "sudo sh" to access a root shell.

Then you can just create a new account with UID 0 and GID 0 with name root.
__________________
Freddie

Help for FreeBSD: Handbook, FAQ, man pages, mailing lists.
Reply With Quote
  #8   (View Single Post)  
Old 28th April 2009
roddierod's Avatar
roddierod roddierod is offline
Real Name: Rod Person
VPN Cryptographer
 
Join Date: Apr 2008
Location: Pittsburgh, Pa
Posts: 382
Thanked 13 Times in 13 Posts
Default

toor didn't work.

sudo didn't work.

I tried to adduser root and it said root exists, but when I tried passwd root it said no such user....
__________________
"The basic tool for the manipulation of reality is the manipulation of words. If you can control the meaning of words, you can control the people who must use the words." -Philip K. Dick
Reply With Quote
  #9   (View Single Post)  
Old 28th April 2009
anomie's Avatar
anomie anomie is offline
Local
 
Join Date: Apr 2008
Location: Texas
Posts: 446
Thanked 69 Times in 46 Posts
Default

It seems like your master.passwd is not in sync with its db. How about:

First, # vipw

And add the following entry if you haven't already:
Code:
root:*:0:0:Charlie &:/root:/bin/csh
Next, # pwd_mkdb

(I don't have a test box in front of me to try that on, but it seems logical.)

edit: Please back up your current /etc/passwd and /etc/master.passwd before attempting what I posted...
__________________
Kill your t.v.
Reply With Quote
Old 28th April 2009
roddierod's Avatar
roddierod roddierod is offline
Real Name: Rod Person
VPN Cryptographer
 
Join Date: Apr 2008
Location: Pittsburgh, Pa
Posts: 382
Thanked 13 Times in 13 Posts
Default

OK...finally.

I got this right before seeing anomie's post.

But after restoring /etc/master.passwd you need to do the following:

Code:
pwd_mkdb -C /etc/master.passwd
pwd_mkdb -p /etc/master.passwd
pwd_mkdb /etc/master.passwd
this rebuilds /etc/passwd and /etc/pwd.db

after that, I could passwd root to set the password!
__________________
"The basic tool for the manipulation of reality is the manipulation of words. If you can control the meaning of words, you can control the people who must use the words." -Philip K. Dick
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
HOWTO: mounting an USB device as normal non-root user in OpenBSD J65nko Guides 5 18th September 2014 09:49 AM
Startx executes as root, "startx:not found" as user Mr-Biscuit NetBSD Installation and Upgrading 4 27th May 2009 08:44 AM
Run daemon as other user than root phreud FreeBSD General 8 11th November 2008 04:11 AM
Non-root user editing automatically mounted smb share tad1214 FreeBSD General 8 8th July 2008 02:28 AM
postfix + dovecot LDA: bounce, user unknown cbrace FreeBSD General 1 9th May 2008 05:19 PM


All times are GMT. The time now is 12:11 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick