Chaitanya Krishna A wrote:
Just in case you get any other rash urges to exercise commands like that in a panic: DON'T exit a root shell when you have just done something likely to crash the system.
I usually think I don't panic, but I did. Got to improve. Next time if I do something dumb, I will not panic (at least try not to).
Just remind yourself in future specifically to NEVER EVER exit a root shell after some desastrous action. Believe me, sooner or later you WILL have opportunity to use that advice. Use another terminal or ssh to verify that you have indeed rectified your mistake and can login as root.
In that case you should be able to use the rescue cd to boot up, chroot to your original system and then use passwd to give root a password.
I did use the rescue CD. I don't understand this chroot thing. Can you elaborate on that a bit.
When you boot the rescue CD the root volume "/" used is from the cd. So any action you try to execute on /etc or /sbin will be executed on the cd files. The command chroot mounts another volume as the root volume. In this case you need to know which device on your hdd is the root volume, something like /dev/hda2 or /dev/sda3. So, you boot the rescue CD and thus you are root. Then you execute "chroot /dev/sd2" (or whatever YOUR root device is). Afterwards you have a running root shell and your normal filesystem is mounted. Then you should be able to run any root command you need.
PS: if you still feel adventurous and decide to experiment with files like passwd manually, you might want to make a BACKUP of it first!
Ya I did make a backup. But then I think the harm has already been done to the files before I made a backup.
If you have only changed the file permissions then the damage is not really significant. Many years ago I remember that I accidentally gzipped all the files in the /etc directory and I also panicked. Fortunately it was a test system with nothing installed yet. Sandy -- List replies only please! Please address PMs to: news-reply (@) japantest (.) homelinux (.) com