Root password gone?
I was editing a user in Kuser (added a user to 2 groups). When I exited, it gave me an error on not being able to write to 'shadow'. Now, I can not log on at all (both the user password and root passwords do not work, it gives me an error that the logon failed). The distro is Morphix. I am afraid that I'll have to reinstall :(
I don't know Morphix, but if you have a CD that you can use to boot to (rescue CD or Live CD), if you edit /etc/passwd to delete the password for root, it may help:
If it works like it does in Fedora, next time you login as root, you will not need to provide a password. You should then use the 'passwd' command to reset it.
Thanks for the suggestion, but I've already reinstalled the sistem. Works OK now. It is not really a loss, as I am just starting to play around with it anyway.
You could also have added "single" to the kernel options and typed "passwd" there. I think that's even easier than booting from a livecd.
Or you could boot the sistem with Live CD and change the shadow file.
root passwd gone - reply
:) :) If you are using LILO then while u boot at the prompt type linux single and press enter. it will give you the # prompt . Then type passwd & enter a new password for root. It will show you all tokens successfully updated & then it will carry on with the boot.
If you are using grub then when the option to select OS appears, click on e . then select the kernel option & append single at the end of the line. & then press b to boot. It will give you the bash prompt ..Change password with passwd command , if it asks for the old password then reboot ....do the same things only at the end of the line instead of single also add init=/bin/bash & then press b. This time you can change the password with passwd command.
Then login with the new password. can also delete the user's account & create a new one.
For changing root password you need not re-install linux.
See if it works or not.