Ask Your Question

Boot hangs after resetting password with init=/bin/bash

asked 2017-04-12 03:32:17 -0500

Karl Gustavsson gravatar image

I'm tying to figure out what went wrong when I recently tried to add a rescue account losing all admin access for F25 running on an old laptop, I did this:

  1. logged in as normal user everything worked.
  2. rebooted
  3. adding init=/bin/bash to kernel in GRUB
  4. adduser rescue
  5. change uid and GID to 0 in passwd
  6. reboot

The boot failed the next by just showing the white version of the fedora logo, checking the boot up messages it said something about about not being able to load security policies.

Booting into rescue mode I got to the password prompt and got the error message "Could not load password database", so I couldn't rescue the system.

These errors all went away when I set SELinux to permissive in /etc/selinux/config, I don't want to use this solution, I've done some basic google searches but would like some help on how to proceed

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2017-04-12 16:05:53 -0500

sideburns gravatar image

updated 2017-04-13 01:28:03 -0500

Welcome to ask.fedora. What you did didn't reset the root password, it simply created an alias for root. And, I'm not at all sure what interaction this would have with /etc/shadow. My suggestion would be to use Users and Groups to remove the rescue account, then re-add it, making sure to make it an Admin (That gives it access to sudo in case there's a problem with the root password.) and finally, reset the Root Password, just to be sure. If there's a problem with the last step, reboot, using init=/bin/bash again as that will get you logged in as root, and you can use passwd to reset it.

edit flag offensive delete link more


Having multiple users with uid=0 is not the current problem, but I do have to re-add the user with the system running (ok without GUI).


Karl Gustavsson gravatar imageKarl Gustavsson ( 2017-04-13 01:42:19 -0500 )edit

So I'm going through the journalctl -n 100000, and I can't seem to find the errors messages shown at boot.. But the problem was always the loss of SELinux doing a /sbin/restorecon -v passwd shadow group should be enough.

Karl Gustavsson gravatar imageKarl Gustavsson ( 2017-04-13 02:02:58 -0500 )edit

I'm not so sure, because it might be behind your SELinux issue. In any case, getting rid of the duplication can't hurt and may help. (Please note that my only reason for concern was that you'd duplicated root; doing this with other users is probably safe.)

sideburns gravatar imagesideburns ( 2017-04-13 02:11:14 -0500 )edit

Question Tools

1 follower


Asked: 2017-04-12 03:32:17 -0500

Seen: 205 times

Last updated: Apr 13 '17