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.
Boot into rescue mode (use cd1 of the install discs)
Mount the disk.
Mount your Linux disk to mountpoint, for example /mnt
mount /mnt /dev/hdXx
Now you can go to the mounted disk
cd /mnt
Use vi, vim, or nano to edit the files
What your need to edit
Try now to edit your file /etc/passwd by vi or sed. But, attention!
Your file /etc/password is in fact /mnt/etc/passwd. You need to edit
the line contains the word "root". For example, if your /etc/passwd
contains the line
root:x3FrTg6uYT7.:0:0:root:/:/bin/sh
edit it and blank out the password field to the next:
root::0:0:root:/:/bin/sh
You should be able to login as root and you needn't any password for root.
After that, don't forget to change your root password to new one.
Yes. If you want, you can disable the "boot from CD" option in the BIOS, then password-protect the BIOS settings, but even that can be overcome with enough effort. Such heroic measures are really unnecessary in most cases.
It's like securing your house; a good deadbolt or rimlock on the door combined with other standard security measures will usually suffice to keep the undesirables out, or you can go nuts and install multiple locks on the doors and bars on the windows in an effort to keep out a few more.
Either way, a really determined person can still get in by driving a car through your wall.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.