Astrolabos

By:

Sometime you can’t remember root password. On Linux, recovering root password can be done by booting Linux under a specific mode: single user mode.This can be done using GRUB.

Follow these steps to reset the password when using GRUB:

  • While booting the system, in GRUB menu, highlight the line for Linux and press e (for edit). This will take you to another screen where you can edit grub entry.
  • Go to line which begins with kernel append single to the end of that line . And then append init=/bin/bash .So that now the line end with

    …ro single init=/bin/bash

  • Once the system finishes booting, you will be logged in as root. But root file-system is mounted as read only mode.So we should remount it as r+w mode. This can be done by
 $ mount -o remount,rw / 
  • now set new password using passwd.
  • Again remount root file-system as read only (this is only for safety of file system).
 $ mount -o remount,ro / 

Note:

if GRUB is locked by password ,one should use a live CD/USB and then change root (chroot) and edit grub file and comment password –md5 ……. Then reboot.

comments powered by Disqus
An astrolabos is an elaborate inclinometer, historically used for locating and predicting the positions of the Sun, Moon, planets, and stars.