Resetting user password in Linux OS using Linux live CD

Panaam to all bha ji _/\_
Today we will learn how to trouble shot problem of password reset in linux OS
i dont know would you like it or not but i am goign to share as i found it easy way to reset password if we have forgotten password :)

lets start.........
for this , we need Linux live OS installed either on USB or on CD/DVD

access partition in which your OS is installed and open /etc/passwd file 
remove 'x' from the line containing your OS username 
save that file and reboot your system in OS whose password you have forgotten.
here is detailed information 

boot your system with Linux live OS, i am using ubuntu 11.10
after that , check for your linux partition in which OS is installed.
in my case , it is CentOS minimal installed on a partition whose size is around 4 GB

ok , now open shell terminal

execute command 'sudo bash' to get bash shell with root user power :)

enter into directory /media , you will get your installed OS partition there,
enter into that partition using command cd  partition_name
you need not to type full name of partition , type cd and first 2-3 characters of partition name and then press 'tab' key from keyboard for auto complete

as i typed cd 67, pressed 'tab key' from keyboard to auto complete the name and entered into partition

ok now we need to edit passwd file which is located under directory etc
so lets pen it with nano text editor using command

nano etc/passwd

passwd file will be like this

here comes our main step using which we would be able to reset our os password
we need to remove symbol 'x' from second field of that user whose password we want to reset
like i want to reset password of user having username root, so i wll have to remove 'x' from the line which contains username root .

and save this file by pressing ctrl+o key simultaneously
text editor will ask to you for confirmation about saving file or not , just press enter key
press ctrl+x key   simultaneously for closing text editor
ok , we have done XD

now boot your system with the OS whose user account password you have forgotten.
type the username whose x value you deleted in last step(i deleted for user root)

and just hit enter key :D
system will let you login without asking for password.
once you have logged in to account , dont forget to set new password
execute command passwd to set new password for your account

type your new password , system will ask for password confirmation too and type you new password for confirmation too and press enter key

hell yesh XD , now our user account is safe with password login
this was nothing but we just tricked system for shadow file masking field
means , the x in /etc/passwd file in a line is to forcing system to check for password of user account in /etc/shadow file .
if x is not set for a user in /etc/passwd file , it means system wont check for user account password and will let login user without password

hope you people enjoyed it :)
Thank you

Greetz to :-
Zero cool ,code breaker ica, Aasim shaikh,Reborn,lord crusi, Raman kumar rana,INX_r0ot,Darkwolf indishell, lord crusi, Chinmay Pandya ,Silent poison India,Magnum sniper,Atul Dwivedi,ethicalnoob Indishell,Local root indishell,Irfninja indishell,Hardeep bhai,Mannu,Viki , AR AR bhai ji, Anju,RR mam and Deepika kaushik

Share this post


  1. hmmm u shared it .. already bhai g .. Nice ! :)


:) :-) :)) =)) :( :-( :(( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ :-$ (b) (f) x-) (k) (h) (c) cheer

© 2009 Start With Linux | Mannu Linux
Designed by cyb3r.gladiat0r
Posts RSSComments RSS
Back to top