RHEL 7 / CentOS 7 : Single User Mode / Recovering / Reset Root Password

Hello,
Setting up the root password is a mandatory part of the Red Hat Enterprise Linux 7 / CentOS 7installation.
If you forget or lose your password, it is possible to reset it. Now it is known as Rescue Mode / Emergency mode in CentOS / RHEL 7, Previously in RHEL / CentOS 5/6 It was “Single User Mode”.
Note: In GRUB 2, resetting the password is no longer performed in single-user mode as it was in GRUB included in Red Hat Enterprise Linux 6. The root password is now required to operate in single-user mode as well as in emergency mode.
systemd_recover_root_password
systemd_recover_root_password
Process: Resetting the Root Password
  1. Please follow this procedure carefully, any mistake can make your system / Linux unstable, Perform this own your on risk.
    q
  2. Start the system and, on the GRUB 2 boot screen, press the e key for edit.
  3. Add the following parameter at the end of the linux line, or linuxefi on UEFI systems (In case of  VMWare like KVM or VirtualBox use rb.break instead of init=/bin/sh):
    init=/bin/sh
    The Linux kernel will run the /bin/sh shell rather than the system init daemon. Therefore, some functions may be limited or missing.

    Important

    The rhgb and quiet parameters must be disables in order to enable system messages.
  4. Press Ctrl+x to boot the system with the parameter.
    The shell prompt appears.
  5. The file system is mounted read-only. You will not be allowed to change the password if the file system is not writable.
    To remount the file system as writable, run the mount -o remount, rw / command.
  6. Run the passwd command and follow the instructions displayed on the command line to change the root password.
    Note that if the system is not writable, the passwd tool fails with the following error:
    Authentication token manipulation error
  7. To make sure that SELinux context of the files that were modified is restored properly after boot, run
    touch /.autorelabel
  8. Run the exec /sbin/init command to resume the initialization and finish the system boot.
    Running the exec command with another command specified replaces the shell and creates a new process; init in this case.
    Alternatively, if you wish to reboot the system, run the exec /sbin/reboot command instead.

Enjoy RHEL 7 🙂 Enjoy CentOS 7 🙂 Enjoy Linux 🙂 Enjoy Open Source 🙂

Please Keep in Touch with Social Networking :- 
Facebook Page :- https://www.facebook.com/AllLinuxUsersBlog

Howto: Reset/Recover Root Password | OpenSUSE 11.1

Hello,

Today I am writing something about OpenSUSE. This is very basic howto and this will be very helpful to beginner mostly.

I am not at all Familiar with OpenSUSE but I Installed it and Just Give a try to reset password of OpenSUSE 11.1 and posting the howto/solution.

In OpenSUSE 11.1 it is different to reset password then other distributions like Fedora, Ubuntu and Red Hat Enterprise Linux.

I Don’t say that this is the only method to Reset/Recover root password in OpenSUSE 11.1, May be there are some other methods also but I found this is the easiest method to reset root password.

To Reset Root password in OpenSUSE 11.1 please follow the following procedure :-

1) Boot your OpenSUSE and Keep your screen on Grub.

2) On Selected Kernel at Down side you’ll able to see BOOT OPTIONS.

3) Remove Whaetever return in BOOT OPTIONS

4) Now Type init=/bin/sh and press ENTER

5) Wait some time until it loads your shell prompt.

6) Now Once you get shell prompt then execute passwd commnad and then it will ask you password twice

7) That’s it, Your root password is resetted.

Hope this helps to you.

Let me have feedback for the same.
Enjoy OpenSUSE 🙂 Enjoy Linux 🙂 Enjoy OpenSUSE 🙂