Problem with boot parameter init=/bin/bash

In SLES 11 I could boot with parameter init=/bin/bash, mount / rw and reset root password, then enter “reboot” and root’s password was changed. In SLES 12.2 I can add the init=/bin/bash parameter and get to a “#” prompt, and also enter the same commands, but I cannot successfully “reboot” – I must be missing something, because when I try to enter the command to reboot, or “init 6” the command interpreter returns information that those are privileged commands and must be entered by root. However, I am logged in as root at the time. What would be the correct sequence of commands to carry out the well-known procedure for resetting root’s password as was possible in SLES 11?

Thank you for any guidance.

[QUOTE=scookacc;40420]In SLES 11 I could boot with parameter init=/bin/bash, mount / rw and reset root password, then enter “reboot” and root’s password was changed. In SLES 12.2 I can add the init=/bin/bash parameter and get to a “#” prompt, and also enter the same commands, but I cannot successfully “reboot” – I must be missing something, because when I try to enter the command to reboot, or “init 6” the command interpreter returns information that those are privileged commands and must be entered by root. However, I am logged in as root at the time. What would be the correct sequence of commands to carry out the well-known procedure for resetting root’s password as was possible in SLES 11?

Thank you for any guidance.[/QUOTE]
Hi and welcome to the Forum :slight_smile:
Welcome to the world of systemd, use the following instead;

systemd.unit=emergency.target

Once done you can boot to any other level eg multi-user or graphical or reboot, to reboot;

systemctl reboot

[QUOTE=malcolmlewis;40424]Hi and welcome to the Forum :slight_smile:
Welcome to the world of systemd, use the following instead;

systemd.unit=emergency.target

Once done you can boot to any other level eg multi-user or graphical or reboot, to reboot;

systemctl reboot [/QUOTE]

Thank you for that.
If I add to the linux boot line in grub2 as you said:

systemd.unit=emergency.target

I then need to know root’s password to continue. The idea I was trying to get at was to reset root’s password without knowing it. Is there a new preferred method to recover root’s password in SLES 12?

Thanks.

If I understand your original post correctly, you are currently able to
reset the password, but then you are unable to reboot. You may need to
specify absolute paths to commands when trying to use them, as I doubt you
have much of a PATH environment variable setup, so try:

/usr/bin/systemctl reboot
/sbin/init 6
/sbin/reboot


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below.

If you want to send me a private message, please let me know in the
forum as I do not use the web interface often.

[QUOTE=ab;40438]If I understand your original post correctly, you are currently able to
reset the password, but then you are unable to reboot. You may need to
specify absolute paths to commands when trying to use them, as I doubt you
have much of a PATH environment variable setup, so try:

/usr/bin/systemctl reboot
/sbin/init 6
/sbin/reboot


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below.

If you want to send me a private message, please let me know in the
forum as I do not use the web interface often.[/QUOTE]
Hi
No daemons are running… so it won’t work… :frowning:

@OP Use Magic SysRq (See https://en.wikipedia.org/wiki/Magic_SysRq_key for more info)

Hold alt+prt scr (sys rq) then press R E I S U B