Reset Root Password

Share your own howto's etc. Not for support questions!

Reset Root Password

Postby bluesdog » 2010-06-18 04:59

Forgot, you l33t haxx0r you?

Don't panic.

Boot to the GRUB menu. Then, press <e> (for edit) before Linux has a chance to boot.

Using your keyboard arrow keys, move the cursor down a line or so, and press <e> (for edit) again, you should now be on the kernel line, and press <End> to go out to the very end of that line. Now hit the spacebar once, if necessary, to add a space, and then add one of the folllowing:

Code: Select all
 init=/bin/bash


Or:

Code: Select all
 init=/bin/sh


Then press <Enter>, and you're back at the kernel line, press <b> (for boot) and the computer will proceed to boot to a root prompt.

At this point, the root file system is still mounted read-only, so enter the following command:

Code: Select all
mount -n -o remount,rw /


Then type:

Code: Select all
passwd


Enter your new password. Retype if asked to confirm.
Then restart the machine by typing:

Code: Select all
 reboot


Now you should be able to login with your new root password as required.
User avatar
bluesdog
 
Posts: 2082
Joined: 2006-02-01 09:02
Location: Similkameen, British Columbia, Canada

Re: Reset Root Password

Postby marshcast » 2011-04-22 12:24

Top howto Bluesdog

- Elegence ;)
marshcast
 
Posts: 2
Joined: 2011-04-22 12:21

Re: Reset Root Password

Postby Thailipo » 2011-06-03 05:51

So... basically, filesystem encryption and requiring a password for login are completely useless measures against someone with physical access to the computer?

From a security standpoint, this little trick worries me.
User avatar
Thailipo
 
Posts: 22
Joined: 2011-05-09 03:38

Re: Reset Root Password

Postby dasein » 2011-06-03 06:32

Thailipo wrote:So... basically, filesystem encryption and requiring a password for login are completely useless measures against someone with physical access to the computer?

Anyone with physical access to the machine can read unencrypted data. But that's exactly why filesystem encryption is important if you have sensitive data to protect.

But yeah, login passwords on desktop machines are basically just for show. After all, you can boot from a USB stick or rescue CD, and the machine is "yours."
User avatar
dasein
 
Posts: 7775
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Reset Root Password

Postby dilberts_left_nut » 2011-06-03 07:42

This can be controlled by disabling other boot methods in the BIOS and setting BIOS & GRUB passwords.
But then, opening the case and resetting the BIOS, or just pulling the HDD and reading it in another machine works too.

As stated, filesystem encryption is the only way to protect data if "the enemy" has unrestricted physical access to the box.

In most situations the above methods are sufficient to deter opportunists.
AdrianTM wrote:There's no hacker in my grandma...
User avatar
dilberts_left_nut
 
Posts: 4882
Joined: 2009-10-05 07:54
Location: enzed

Re: Reset Root Password

Postby dasein » 2011-06-03 08:34

dilberts_left_nut wrote:But then, opening the case and resetting the BIOS, or just pulling the HDD and reading it in another machine works too.

Perzactly.

Absent physical security measures, passwords really aren't much of a deterrent, except against the idly curious. Encryption is the only solution for a physically insecure machine.
User avatar
dasein
 
Posts: 7775
Joined: 2011-03-04 01:06
Location: Terra Incantationum

Re: Reset Root Password

Postby geazzy » 2011-07-06 12:31

nice how to bluesdog :D
geazzy
 
Posts: 27
Joined: 2011-07-02 05:39


Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 3 guests

fashionable