Root and User Passwords Both Bolixed  [SOLVED]

Need support for GhostBSD. Ask here if your question does not fit elsewhere.

Root and User Passwords Both Bolixed  [SOLVED]

Postby frogprince » Sat Jul 29, 2017 9:52 pm

Suddenly, neither my root nor standard user passwords will log me into Ghost BSD. I pulled out my copy of "The Complete FreeBSD" by Lehey, and based on what was suggested, booted into support mode and selected the bash shell. I then typed:

mount -u
mount -usr

but got an error message about no such directory for the latter. So I typed:

passwd root

and then entered a new password twice. At the end, I got the message:

passwd: pam_chauthtok(): error in service module

I did the same with

passwd myusername

and got the same message. And of course, neither password will work. Does anyone have any suggestions before I simply bite the bullet and reinstall?
Thanks in advance.
Last edited by frogprince on Sun Jul 30, 2017 1:42 pm, edited 2 times in total.
Vas you efer in Zinzinnati? Asus M2N-MX, Athlon 64 3800+ CPU, 4 GB/250 GB, GeForce 210, missing front drive panel just like its owner.
frogprince
 
Posts: 38
Joined: Mon Jul 10, 2017 8:50 pm
Has thanked: 7 times
Been thanked: 3 times

Root and User Passwords Both Bolixed  [SOLVED]


Re: Root and User Passwords Both Bolixed

Postby ASX » Sun Jul 30, 2017 3:09 am

frogprince wrote:Suddenly, neither my root nor standard user passwords will log me into Ghost BSD. I pulled out my copy of "The Complete FreeBSD" by Lehey, and based on what was suggested, booted into support mode and selected the bash shell. I then typed:

mount -u
mount -usr

but got an error message about no such directory for the latter. So I typed:


If those two are the exact commands you used, they are surely wrong.

Assuming that by "support mode" you mean "rescue mode", your system would boot with the root filesystem mounted readonly (this is not true for ZFS, only for UFS), and thus it is necessary to remount the root filesystem as read-write, that can be accomplished with:

Code: Select all
mount  -u -rw  / 


I will refrain to "guess" what is the about the second mount command, it just doesn't make sense. as it is.
ASX
 
Posts: 988
Joined: Wed May 06, 2015 11:46 am
Has thanked: 58 times
Been thanked: 132 times

Re: Root and User Passwords Both Bolixed

Postby frogprince » Sun Jul 30, 2017 1:41 pm

ASX: thank you, that worked; I'm now responding from my Ghost BSD system.

For the record, (and my motive here is to learn the correct way, not to defend
my ego..~(;^})=..) Lehey's book, which is copyrighted 2003, states on page 148:

"If you do manage to lose the root password, all may not be lost. Reboot the machine to
single-user mode (see page 540), and enter:

$ mount -u / mount root file system read/write
$ mount /usr mount/usr file system (if separate)
$ passwd root change the password for root
Enter new password:
Enter password again: enter ctrl-D to continue with startup
$ ^D

If you have a separate /usr file system (the normal case), you need to mount it as well,
since the passwd program is in the directory /usr/bin. Note that you should explicitly
state the name root: in single-user mode, the system doesn't have the concept of user
ID's."

Page 540 talks about single-user mode:

"..you can stop the boot process before most of the daemons have been started and enter
single-user mode. to do this, set the boot_single variable, or specify the -s flag
at boot time:

ok boot -s

As soon as the device probes have been completed, the system startup is interrupted and
your are prompted for a shell. ONly the root file system is accessible, and it is mounted
read-only."

I couldn't figure out a way to set the -s flag, and so went on to recovery mode instead.
Your commands differ from his, but they worked... :D
Vas you efer in Zinzinnati? Asus M2N-MX, Athlon 64 3800+ CPU, 4 GB/250 GB, GeForce 210, missing front drive panel just like its owner.
frogprince
 
Posts: 38
Joined: Mon Jul 10, 2017 8:50 pm
Has thanked: 7 times
Been thanked: 3 times

Re: Root and User Passwords Both Bolixed

Postby ASX » Sun Jul 30, 2017 2:27 pm

Glad you sorted out the problem! ;)

Btw, a 2003 book is probably still actual concerning the architecture and also about the idea to switch to rescue mode, but very likely the details changed since then, so it is better you compare what you find on the book with the current docs/handbook/man pages.
ASX
 
Posts: 988
Joined: Wed May 06, 2015 11:46 am
Has thanked: 58 times
Been thanked: 132 times


Return to General support

Who is online

Users browsing this forum: No registered users and 2 guests