Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
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 up from a Linux Live CD, mount the internal hard drive and edit the root entry in the /etc/password file to remove the first "x". The revised entry will look something like this:
root::0:0:root:/root:/bin/bash
You will now be able to boot into single-user mode and login as root with no password----then you can create new passwords as needed.
Boot up from a Linux Live CD, mount the internal hard drive and edit the root entry in the /etc/password file to remove the first "x". The revised entry will look something like this:
root::0:0:root:/root:/bin/bash
You will now be able to boot into single-user mode and login as root with no password----then you can create new passwords as needed.
You might find that the live-CD can actually do it just with the passwd command, executed when you have booted the DVD and are therefore logged-on as root. It depends somewhat upon exactly which DVD you are using.
please disregard the previous two [MODERATED] answsers.... here is how it goes
there is a bit more to it, a couple of steps
Hmm, it seems like your answer is just a really really detailed version of pixellany's. It would be useful to say what you think is wrong with the other answers.
And please don't use orange or other light colours like yellow, they're really hard to read.
Last edited by ntubski; 08-21-2012 at 07:41 PM.
Reason: remove quotes of things that moderator removed
If you don't have a password set on the bootloader, you may be able to boot into single user mode and run 'passwd' that way without the need for a live cd. Some systems will ask for the root password to boot into single user mode in which case you would need to access the file system through a live CD (or by mounting the hard drive using another system). The last time I checked, Red Hat based systems (i.e. including CentOS and Fedora) did not have this requirement. Booting into single user mode on these systems is just a matter of editing the boot line in grub and adding 'single' to the boot argument list. Here is a link to Red Hat with some details: https://access.redhat.com/knowledge/...booting-single
@nittmann: you may expect us to be lenient towards new LQ members allowing them time to acclimatize but personal attacks and provocations are a direct violation of the LQ Rules you agreed to adhere to when you signed up. Please do not do that again.
Confirmed, furthermore calling passwd at that point puts the new password in /etc/passwd instead of /etc/shadow:
When we correct wrong information EVERYBODY wins, it's not a competition.
I just ran a test....
I created a new user normally. Then I used my method (remove the x) and--as expected--I could log in to the new user account with no password. I then assigned a new password, and the account was back to normal ("x" in /etc/passwd, etc.)
I've used this method for recovering from lost passwords many times.........
The implication is that some distros are set up differently????
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.