Single user mode – How to reset(bypass) root password without bootable CD

Single user mode – How to reset(bypass) root password without bootable CD

Introduction – In many systems, User has to enter root password to enter in to “single user mode“. On Ubuntu/Debian system, you have to enter root password while entering into single user mode.

What to do if you loss or forgot root password ?

method(1) Use bootable CD – This is the last options to reset root password on your system. Infact if you have set GRUB password and you have loss root as well as GRUB password then only you need to go for this method. Otherwise go with second method…

method(2) Single user mode and bypass root password – You can reset root password even if your system require root password to enter in to single user mode. GRUB will help you to bypass , and will not ask you for root password.

This is as simple editing the preferred boot line in your GRUB boot loader menu at boot time…

  • Reboot the system, and when you are at the selection prompt(GRUB menu), highlight the line for Linux and press ‘e’.
  • This will take you to another screen, where you should select the entry that begins with “kernel” and press “e” again….
  • Append "single" to the end of that line (without the quotes and give space)
  • If your system requires you to enter your root password to log into single-user mode, then append init=/bin/bash after “single“. Hit “Enter” to save the changes.
  • Press “b” to boot into Single User mode.
  • Once the system finishes booting, you will be logged in as root. Use passwd and choose a new password for root.
  • Type reboot to reboot the system, and you can login with the new password you just selected.

Original Line –

/vmlinuz-2.6.22-14-generic root=/dev/sda5 ro quiet splash

Modify as –

/vmlinuz-2.6.22-14-generic root=/dev/sda5 ro quiet splash single init=/bin/bash

Thank you,

Arun Bagul

Similar Posts:

Leave a Reply

Your email address will not be published.