Friday, March 11, 2011

How to reset your forgotten password in LInux ...???

1) boot off your linux live CD/ Flash drive

2) ascertain which partition linux is installed on your hard disk
[use fdisk -l command]

3) mount the partition on the hard drive that contains the linux system files
[
sudo mount partition_being_mounted Local_mount_point
ex:- sudo mount /dev/sda2 /mnt

]

4) vi /mnt/etc/passwd and remove the x from a particular user and save /etc/passwd file

ex:- if a user renoy has the entry as follows in /etc/passwd
renoy:x:1002:1002:renoy,,,:/home/renoy:/bin/bash

change it to as follows
renoy::1002:1002:renoy,,,:/home/renoy:/bin/bash


5) reboot and login to your newly unlocked linux installation and set new password

6) Re-shadow your new password for safe keeping

sudo shadowconfig off
sudo shadowconfig on

7) verify that you are able to login with the new password


NB:- tested on ubuntu 10.04

No comments:

Post a Comment