You are Here: FAQ ->Dedicated Servers->Article #3


I have forgotten my root password, can I reset it?


Yes, if you have forgotten your root password you can reset it using the
rescue system.

Prerequisite: Root-Server has to boot up in the Rescue-System

The Rescue System is a Linux system that runs on a RAM-Disk. A connection with
your Root-Server will look something like this (with your IP address instead of 172.17.1.1):

user@machine:~$ ssh root@172.17.1.1
Password: XXXXX
Welcome to pureserver rescue disk

If you are using a unix/linux/mac from a terminal. If you are using a windows machine you will need to connect with an ssh client such as putty.

Remote Server Access Using Secure Shell (SSH)

From here you can partition your internal hard drive or edit incorrect settings.
The following is the standard partitioning of the internal hard drive:

If you are using hardware raid you will only see one drive.

rescue:~# fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 123 987966 fd Linux raid autodetect
/dev/sda2 124 367 1959930 82 Linux swap / Solaris
/dev/sda4 368 19457 153340425 5 Extended
/dev/sda5 368 976 4891761 fd Linux raid autodetect
/dev/sda6 977 1585 4891761 fd Linux raid autodetect
/dev/sda7 1586 19457 143556808+ fd Linux raid autodetect
rescue:~#

If you are using software raid you will see two drives.

rescue:~# fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 123 987966 fd Linux raid autodetect
/dev/sda2 124 367 1959930 82 Linux swap / Solaris
/dev/sda4 368 19457 153340425 5 Extended
/dev/sda5 368 976 4891761 fd Linux raid autodetect
/dev/sda6 977 1585 4891761 fd Linux raid autodetect
/dev/sda7 1586 19457 143556808+ fd Linux raid autodetect

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 123 987966 fd Linux raid autodetect
/dev/sdb2 124 367 1959930 82 Linux swap / Solaris
/dev/sdb4 368 19457 153340425 5 Extended
/dev/sdb5 368 976 4891761 fd Linux raid autodetect
/dev/sdb6 977 1585 4891761 fd Linux raid autodetect
/dev/sdb7 1586 19457 143556808+ fd Linux raid autodetect

Disk /dev/md7: 147.0 GB, 147002097664 bytes
2 heads, 4 sectors/track, 35889184 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md7 doesn't contain a valid partition table

Disk /dev/md6: 5009 MB, 5009047552 bytes
2 heads, 4 sectors/track, 1222912 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md6 doesn't contain a valid partition table

Disk /dev/md5: 5009 MB, 5009047552 bytes
2 heads, 4 sectors/track, 1222912 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md5 doesn't contain a valid partition table

Disk /dev/md1: 1011 MB, 1011548160 bytes
2 heads, 4 sectors/track, 246960 cylinders
Units = cylinders of 8 * 512 = 4096 bytes

Disk /dev/md1 doesn't contain a valid partition table
rescue:~#

Now mount the internal hard drive into the /mnt directory and change into
the system on the partition. If you do not remember where usr, home, and var are mapped to then mount the root partition first and check the mtab or fstab.

for hardware raid

rescue:~# mount /dev/sda1 /mnt
kjournald starting. Commit interval 5 seconds
EXT3 FS on sda1, internal journal
EXT3-fs: mounted filesystem with ordered data mode.

for software raid

rescue:~# mount /dev/md1 /mnt
kjournald starting. Commit interval 5 seconds
EXT3 FS on md1, internal journal
EXT3-fs: mounted filesystem with ordered data mode.

check to see where the usr, home, and var are assigned to

rescue:~# more /mnt/etc/mtab

or

rescue:~# more /mnt/etc/fstab

as an example of a fstab

/dev/md1 / ext3 defaults 1 1
/dev/sda2 none swap sw
/dev/sdb2 none swap sw
/dev/md5 /usr xfs defaults 0 2
/dev/md7 /var xfs defaults,usrquota 0 2
/dev/md6 /home xfs defaults,usrquota 0 2
devpts /dev/pts devpts gid=5,mode=620 0 0
none /proc proc defaults 0 0
none /tmp tmpfs defaults 0 0


Then mount the other partitions. The below example commands are based on the partitions from the example fstab above. You will need to match 5, 6, or 7 to usr, home, and var based on your fstab or mtab. If you are using hardware raid it will be sdax instead of mdx where x is the partition number.

rescue:~# mount /dev/md5 /mnt/usr
rescue:~# mount /dev/md6 /mnt/home
rescue:~# mount /dev/md7 /mnt/var

then chroot into the mounted operating system.

rescue:~# chroot /mnt
rescue:/# passwd
Changing password for user root.
New password:
Retype new password:
passwd: all authentication tokens updated successfully.

to exit the chroot environment

rescue:~# exit

to umount your partitions

rescue:~# umount -al

Do not forget to unmount your internal hard drive after the restore and BEFORE you
restart the server. Also remember to change your Root-Server back to normal boot
mode from your Control Panel. You have the option of rebooting from inside the recovery tool or just changing the boot image by either selecting the reboot now option or not. If you do not select the reboot now option it will only change the boot mode.

rescue:~# shutdown -r now


Print Article
How useful was this article?
(From 5 = Very Useful to 1 = Not useful at all):
1 2 3 4 5