Linux - DistributionsThis forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on...
Note: An (*) indicates there is no official participation from that distribution here at LQ.
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 think you're gonna have to format, (but you don't have to lose important data, see below) if there is only one user on your machine (which there shouldn't be really, you should have at least one "normal" user aside from root) there is very little you can do to get in.
The password to root will be stored in encrypted form so unless you've got a really easy password I wouldn't bother trying to brute force decrypt it. Apart from a remote machine root exploit, I doubt it is going to be easy to get in.
What you could do of course if you don't want to lose data is:
Boot of a Linux Live CD (There are plenty of them out there)
Mount your hard drive
Copy the data you need to CD-R, other harddrives or another computer
Then format the hard drive and reinstall, this time don't forget your root password and create a new user. If you have a really bad memory and your computer isn't a server, then you may as well write it down somewhere safe :)
Steve
Edit: lack of coffee, yes there are a few ways of doing it - followed below...
Do a search for "linux-single" - if you haven't put measures in place to prevent it from being used (and you haven't already reformatted) that will tell you how to change the root password.
If you are using redhat just boot from the redhat cd "disk 1" and choose recovery mode. You should be a ble to get to a linux shell at which point you want to locate your /etc/shadow or /etc/passwd file and find the line that looks like:
root:$2$6Fhe48fjFsSSkcms.e4SDjcDD:12546:0:99999:7:::
Change the line to look like root::12546:0:99999:7:::
You should then be able to login without a password.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.