After resetting root password on FreePBX via init=/bin/bash, system stuck in -bash-4.2# and not booting normally or receiving DHCP IP

Hi everyone,
I’m running FreePBX 16 Distro (Sangoma Linux 7 - CentOS 7 base) and recently I had to reset the root password.

I followed the usual method by editing the GRUB boot entry:

  • Added init=/bin/bash at the end of the linux16 line
  • Booted into bash-4.2#
  • Ran these commands:
mount -o remount,rw /
passwd
sync

Password reset worked
Then I also ran these (to prepare for proper reboot):

mount -t proc proc /proc
mount -t sysfs sys /sys
mount -o bind /dev /dev

Problem:

Now, no matter what I do, the server always boots back into -bash-4.2# shell instead of the normal shell ([root@freepbx ~]#).

Also, after reboot:

  • NetworkManager doesn’t start
  • DHCP doesn’t assign a public IP
  • FreePBX web UI is not accessible

What I Tried So Far:

Removed init=/bin/bash from GRUB
Rebuilt /etc/default/grub and ran:

grub2-mkconfig -o /boot/grub2/grub.cfg

Tried booting with:

systemd.unit=multi-user.target
instead of quiet

Tried running:
/sbin/init
…but it returns init: required argument missing

  • How can I force the system to boot fully into normal shell mode (not bash-4.2#)?
  • How can I fix DHCP or networking issue on boot?

What tutorial/FAQ/wiki/KB did you review for these instructions ?

Did you add the word single as well (to boot into single user mode) ?

And did you do this by editing the GRUB entry during initial boot by pressing ‘e’ key ?
Or, after the system was already running, you logged in, then edited the menu via /etc/default/grub modifications ? (The former at the boot screen with 'e’diting is temporary and preferred in this situation.)

Maybe instead of mounting proc/sysfs/dev, next time, try in full:

mount -o remount,rw /
passwd
sync
mount -o remount,ro /
exit

…might kernel panic at the end, but no big deal as disks are unmounted, so manually reboot it. Then, the system should come up normally.

Maybe compare your current GRUB menu with another fresh test install’s version ? Seems like there could be a typo lurking in there…