Root and User Passwords Both Bolixed

Need support for GhostBSD. Ask here if your question does not fit elsewhere.
Post Reply
frogprince
Posts: 67
Joined: Mon Jul 10, 2017 9:50 pm

Root and User Passwords Both Bolixed

Post by frogprince »

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 2:42 pm, edited 2 times in total.
Vas you efer in Zinzinnati? Asus F1A75-M, AMD A8-3870 APU, 6 GB DDR3/120 GB SSD, GeForce 210, missing front drive panel just like its owner.
ASX
Posts: 988
Joined: Wed May 06, 2015 12:46 pm

Re: Root and User Passwords Both Bolixed

Post by ASX »

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.
frogprince
Posts: 67
Joined: Mon Jul 10, 2017 9:50 pm

Re: Root and User Passwords Both Bolixed

Post by frogprince »

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 F1A75-M, AMD A8-3870 APU, 6 GB DDR3/120 GB SSD, GeForce 210, missing front drive panel just like its owner.
ASX
Posts: 988
Joined: Wed May 06, 2015 12:46 pm

Re: Root and User Passwords Both Bolixed

Post by ASX »

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.
Post Reply