Home > debian > Recovering root password

Recovering root password

You have forgotten the root password for a debian machine.

1. On the grub book screen type ‘e’ for edit.
2. Edit the line starting with linux, at the end add init=/bin/bash. Hit enter when done. Then hit ‘b’ to boot it.
3. Now you should be at a prompt. You need to mount as read writable your root partition so that the changes you make can take effect. Type

root@comp# mount -o remount,rw /
root@compp# passwd

4. Enter the new password twice. Then type

root@comp# sync
root@comp# reboot

(if the reboot does not work just power off)
5. Start up the machine and see if you can log in as root.


Categories: debian Tags:
  1. December 29, 2012 at 1:45 pm

    very interesting, good point

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: