[HOWTO] Reset Root Password via Rescue Mode

Status
Not open for further replies.

vps9Ryan

Active Member
803
2010
26
0
Hello guys,

Simply step by step HOWTO : reset root pass via rescue mode.

Make sure you are on the rescue mode, or atleast requested rescue mode from your DC or dedi reseller.

1) Login to the SSH console (rescue mode)

Issue the following command ;

Code:
fdisk -l

Then find the disk partition (you will know it by the amount of HD, quite straight forward), then mount using

Code:
mount /dev/xvda1 /mnt

/dev/xvda1 will be shown when you type fdisk -l

NOTE : it will not always be /dev/xvda1 - so make sure to choose the right one when you go for the fdisk -l

/mnt is just a temporary mounting location.

Then you will have to chroot, this is done by ;

Code:
chroot /mnt /bin/bash

or

Code:
chroot /mnt /bin/sh

Then issue the following command to reset your REAL ROOT password

Code:
passwd root

and reset it.

Then type the following to exit chroot;

Code:
exit

Then you will have to unmount the temporary partition using the following command;

Code:
umount /mnt

And finally reboot the server;

Code:
reboot


That's about it really. Nothing hard :P

If you have any comments or easier methods, please do let me know and I will edit this ;)

regards,
Ryan
 
3 comments
Hello guys,

Simply step by step HOWTO : reset root pass via rescue mode.

Make sure you are on the rescue mode, or atleast requested rescue mode from your DC or dedi reseller.

1) Login to the SSH console (rescue mode)

Issue the following command ;

Code:
fdisk -l

Then find the disk partition (you will know it by the amount of HD, quite straight forward), then mount using

Code:
mount /dev/xvda1 /mnt

/dev/xvda1 will be shown when you type fdisk -l

NOTE : it will not always be /dev/xvda1 - so make sure to choose the right one when you go for the fdisk -l

/mnt is just a temporary mounting location.

Then you will have to chroot, this is done by ;

Code:
chroot /mnt /bin/bash

or

Code:
chroot /mnt /bin/sh

Then issue the following command to reset your REAL ROOT password

Code:
passwd root

and reset it.

Then type the following to exit chroot;

Code:
exit

Then you will have to unmount the temporary partition using the following command;

Code:
umount /mnt

And finally reboot the server;

Code:
reboot


That's about it really. Nothing hard :P

If you have any comments or easier methods, please do let me know and I will edit this ;)

regards,
Ryan
Hello!
how do i can exit rescue, then i reboot , server re-load to rescue, don't exit it.
Please help me
 
Status
Not open for further replies.
Back
Top