A small mistake of mine has led the /etc/passwd file deleted. So i went to rescue mode and used the following command echo "root::0:0:Superuser:/:/bin/bash" > passwd
but that did not get effect in anyway way. when I switch back to normal mode the root is still asking for a passwd.
Any help please.
you could boot from a live cd-OS which should be the same distibution (syntax) and make an backup of following files:
/etc/passwd (if a new one exits)
/etc/shadow
/etc/group
now copy these files from your live-os to the system and change the /etc/shadow from
root:blaBLAbLaBlA:12318:7:56:7:::
to
root::12318:7:56:7:::
now the root has no password.....
reboot and pray
How do i take the back up of the files you have mentioned...? I mean on what should I take back up(the destination)? can you show how do you do that?
There is no /etc/shadow file in my mandrake 7.0.
And the reply for "Kelam_magnus" ---->
I did this search
find .. -path "../" -name "passwd" but i did not get any positive result.
Just now I got to know that there will be some copies of passwd files in the regular mode but not in the rescue mode(as per my search). Unknowing about this fact I logged out of the normal mode in a haste.
Overall, I made two mistakes
1)Playing with my /etc/passwd file
(tr 'aeioul' 'AEIOUL' > /etc/passwd)Instead of this "<"
2)Logging out of my normal mode in hurry.