RSS Subscription
Linux Howtos & Tutorials

Enter your email:

Delivered by


NOTE:New tutorials are from LinuxCareer.com

Poll

Do you own or wish to have iPhone?
 


Linux eBooks FREE Download
A guide to programming Linux kernel modules
Introduction to Linux - A Hands on Guide
A Newbie's Getting Started Guide to Linux

Linux from Scratch - Create Your Own Linux System - Free eBook

Linux: The Hacking Solution (v.3.0)

SQLite 3 with PHP Essential Training – Free Video Training Tutorials

This guide will introduce you to the world of GNU/Linux

The GNU/Linux Advanced Administration

A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)

Advanced Bash-Scripting Guide

Set up, maintain, and secure a small office email server

Partner Linux Sites:
How-To.LinuxCareer.com
Jobs.LinuxCareer.com
TuxMachines
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
All For Linux

Recover - Reset forgotten linux root password

Article Index
1. Introduction
2. Edit Grub boot menu options
3. Remount / and /proc
4. reset / recover forgotten linux root password
5. Reboot

1. Introduction

 

This method of reseting/recovering of lost Linux root password should work on most of linux distributions. I have tested this method for couple years already, starting with debian woody trough redhat and suse to ubuntu hardy.

If you run lilo boot loader instead of grub you can use the same method but with some modifications on how to edit lilo boot prompt.

2. Edit Grub boot menu options

First you need to get into grub menu options. This menu is displayed right at the beginning of the boot. If you cannot see your grub menu options press "ESC' key.

 

You should get something similar to this:

grub boot menu

Now we attempt to edit grub's boot option. Press "e" to edit the first grub menu option and navigate to kernel line:

edit grub boot option with

Press "e" key again to edit and remove:

quiet splash 

and add:

init=/bin/bash 

You may have some different boot options but the main part you need to change/add is init=/bin/bash. You will get something similar to this:

change to init=/bin/bash

Press enter:

ready to boot from edited grub menu


At this point, we have edited grub boot menu, and we are ready to boot. Press "b" key to boot.

3. Remount / and /proc

After successfully boot you will be presented with bash command prompt:

booting to a bash command prompt

On some linux systems, you will need to completely mount / and /proc partitions. To do that, enter following commands:

mount -o remount,rw / mount -o remount,rw /proc 

* NOTE: If you are not sure that if your partition is already mounted RW, run the above command anyway as, otherewise on some systems you will not be able reset your root password. If you fail to do so, you get this error displayed on the screen:

passwd: Authentication token lock busy 

* NOTE: On some Linux distributions, you will have /proc mounted already if this is not your case, just run following command:

mount /proc 

mount and remount partitions in single boot mode

4. reset / recover forgotten linux root password

To reset a actual root password is now simple as typing :

passwd 

reset / recover forgotten linux root password

5. Reboot

Before you reboot it is recommended but not compulsory to run

sync 

command. Your job of reseting a linux root password is accomplished.

Share this linux post:

Submit Recover - Reset forgotten linux root password in Delicious Submit Recover - Reset forgotten linux root password in Digg Submit Recover - Reset forgotten linux root password in FaceBook Submit Recover - Reset forgotten linux root password in Google Bookmarks Submit Recover - Reset forgotten linux root password in Stumbleupon Submit Recover - Reset forgotten linux root password in Technorati Submit Recover - Reset forgotten linux root password in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.


Linux eBooks FREE Download