Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I had a power outage yesterday and the system shut down right in the middle of booting up. When the power came back on Linux would boot up, but I could not log in as root any more. somehow the password got corrupted or lost or something. It will let me log in as a user, but it won't let me change any configuration files or change the root password from there??. Is there anything I can do to repair this short of reinstalling the whole thing again??
It would be easier if we knew what distribution you are using. You can set that in the User CP.
You can try using your install CD to boot. When you get to the point where it asks if you want to install there is usually an option to rescue or repair. If this works like it did with my distribution, eventually you will get to a command line where you can chroot to your normal / and then reset your password.
With LILO or Grub, you may have the option to select "single". If you do, select it, and it will boot up into a console, with you as root. Then just type "passwd" to change it.
Otherwise, you may try booting with a linux bootable cd and mount the partition. Then you can generate the MD5 encrypted key via a console (or whatever encryption is used) and paste it into your /etc/passwd or /etc/shadow file (use the latter file if you have it) into the appropriate place.
I do appologize. I am using RedHat 9 (Shrike) distribution. I will try the suggestions that you have provided so far, if I still can't get it, I will let you know. Thanks again. Jaz.
You should have no problem with either solution. Alex has a good suggestion with going into Single user mode. You can do that by temporarily editing grub during boot up. When grub comes up use the E key to go into edit mode. You'll see the lines that make up the boot commands. Edit the line with vmlinuz in it to include a 1 right after vmlinuz (see below). Then use the B key to boot. Once the command line comes up you can change the password on root with the passwd command.
Thank you guys, that worked great and I learned something new. I was able to edit the Grub loader and boot into run level 1 and change the password. I am so greatful for this site and everyone here. Thanks again Mr. Makowski and Student 4 for you help. Jaz
Jaz, glad to hear everything worked out. In my opinion this is one of the best sites out there for getting help with linux.
aunlead, I can't give you the exact steps for lilo, but I know it is possible to do the same thing. I know the latest version of lilo is not like the one I run on my old 386. In my version all I had to do was type linux 1 when it came to the lilo prompt and it would continue into single user mode. You might check out the LILO mini-HOWTO at the linux documentation project for more help.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.