April 12th, 2003 09:40 AM
This is the problem I am facing :
xdm does not start.Login prompt appears.When I try to login as root(or as any other user),it shows :
I restart the system and enters into single user mode.
When i try to change the password using passwd, it shows
passwd: Can not identify you!
I tried Linux Rescue and the same message appears. (/etc/passwd file is intact). What could be the problem and solution.
Thanx in advance.
April 12th, 2003 02:12 PM
Maybe /etc/shadow has been corrupted somehow. I have never seen this happen but it's theoretically possible.
Instead of using single user mode, boot (for example from lilo) with the kernel command line
This will bypass *everything* and dump you into a shell (beware, most things won't work)
Next, you need to remount the root fs read-write (as it will undoubtably be read-only at this point). Do something like
This should make the root fs r/w. Assuming this works, try
mount -n / -o remount,rw
which should work
Next, you can repair /etc/shadow. It's easiest to look at it using an editor (say, vi)
You'll see if it appears the correct structure (similar to passwd). If it doesn't seem structurally sound, copy /etc/shadow- over the top (this is a backup which gets made automatically)
Next reset root to having a blank password. Change the 2nd field of root's line in /etc/shadow to nothing, so the line looks something like
Although yours might look slightly different.
Exit the editor, run sync, then unmount the root fs
Then hit ctrl-alt-del (ignore any messages which come up now, it's expected that there will be a lot of errors because the system isn't up running properly)
mount / -o remount,ro
Now you should be able to login as root with no password. Then change the root
All this assumes your system uses shadow passwords (virtually no Linux system
made in the last 5 years doesn't by default)