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.
There is no way to recover it. But you can boot from live cd, edit your /mnt/yourlinuxpartition/etc/passwd and delete it completely, then restore it with loging in as root (no password) and running 'passwd'. Or if you have sudo installed and configured properly, you can run 'sudo passwd' and enter new root password.
1. Download the Gentoo Minimal CD (any Live CD should work)
2. Boot the CD
3. Mount your partitions. like
mount /dev/hda3 /mnt/comp mount /dev/hda1 /mnt/comp/boot
4. Chroot to the mounted partitions and update the environment
chroot /mnt/comp /bin/bash
env-update
source /etc/profile
As far as your machine is concernced, you are now running linux on your hard drive rather than the Live CD, so just change the password
passwd root
5. Unmount and reboot
exit
umount /mnt/comp/boot
umount /mnt/comp/
reboot
in grub
go to the kernel that you want to boot, e (edit) then put 'single' (no quotes) behind it, then enter, the b to boot it. once it's boots then passwd and you're set.
for the lilo, the above will apply. if the distro that you're running won't let you into the edit mode of lilo, then boot with a small live disk, like feather or dsl linux. you can then either mv the old /etc/passwd into place, which i suspect you have, (make a cp of the original one first) and then reboot.
once you learn the tricks, make sure that your buddies don't let you near their boxes on boot.
Lil noob question, but it seems way too easy to reset the root password. Is this not a bit of a security flaw? If I set up a shared computer with Linux, I don't want someone with a little know-how to change the password on me, and then do as he/she pleases.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.