OVH Community, your new community space.

forgot root password


ryansstuff
18-03-2011, 06:23
Thank you that was really helpful and have been able to do it.
Many Thanks

Myatu
17-03-2011, 22:51
Try mount /dev/md1 /mnt instead. It's one of the exceptions when using soft-raid.

ryansstuff
17-03-2011, 21:44
yes i do this is what i get

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000e3c4f

Device Boot Start End Blocks Id System
/dev/sdb1 1 2550 20480993 fd Linux raid autodetect
/dev/sdb2 2550 60671 466854912 fd Linux raid autodetect
/dev/sdb3 60671 60801 1048096 82 Linux swap / Solaris

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000d3deb

Device Boot Start End Blocks Id System
/dev/sda1 * 1 2550 20480993 fd Linux raid autodetect
/dev/sda2 2550 60671 466854912 fd Linux raid autodetect
/dev/sda3 60671 60801 1048096 82 Linux swap / Solaris

Disk /dev/md2: 478.0 GB, 478059364352 bytes
2 heads, 4 sectors/track, 116713712 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0x00000000

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

Disk /dev/md1: 20.9 GB, 20972437504 bytes
2 heads, 4 sectors/track, 5120224 cylinders
Units = cylinders of 8 * 512 = 4096 bytes
Disk identifier: 0x00000000

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

Myatu
17-03-2011, 21:36
When running the "fdisk -l" command (last letter is a lower-case L), do you see /dev/mdX where "X" is a number?

ryansstuff
17-03-2011, 21:14
hiya my give the result which means
mount /dev/sda1 /mnt

but i am getting an error with it, it is:

root@rescue:~# mount /dev/sda1 /mnt
mount: unknown filesystem type 'mdraid'


What is the issue?

Myatu
17-03-2011, 20:45
Basic requirement: You need to use SSH (e.g., PuTTy on Windows) to access your server. If you're not used to this and need help with that, let us know (though it is pretty straight forward).

Login to your OVH Manager v3 and select your dedicated server.

Select "Services" from the left side, then "Netboot".

From the drop-down list, select "Rescue Mode Pro" (write down what this is currently set to before you change it).

Then reboot the server (do this from the OVH Manager or using the following SSH command):
Code:
reboot -f
After a few minutes, you will receive an e-mail with a username ("root") and password.

Use SSH to login to the server, using the new username and password from the e-mail received.

To show a listing of your disks, you type ...
Code:
fdisk -l
... and it will show something similar to:

Code:
...

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1        1449     5242879+  83  Linux

...
The one /dev/sd... or /dev/md... with an asterisk (*) behind it (see the Boot column above) is the disk you need to mount. So in the above example you type:
Code:
mount /dev/sda1 /mnt
.

Now you need to change the working root partition with this command:

Code:
chroot /mnt
And finally, you change the password for your original root account with:

Code:
passwd
Once done, go back to the OVH Manager and change the Netboot service option back to what it was (e.h., HD). Now reboot the server again (same way you did in first steps above).

When the server comes back online, you should be able to login to your server using the password you specified during the passwd command.

Now, I'm throwing this out for those who are quite comfortable with using SSH and Linux: you can use
Code:
ssh-keygen
or PuTTy's key manager to generate a private/public key pair. You can simply add the public key to the authorised keys on the server (after mounting it - no need to chroot, just use the proper directory), which gives you password-less access to the server (and thus also an easier method of resetting the root password if need be). In fact, you can disable password-based SSH root access using this method, which is a security improvement.

PS: You will not lose data, but your websites will be temporarily inaccessible while you reset the password (until the 2nd reboot, when you return everything to normal).

ryansstuff
17-03-2011, 20:36
Right and how do you get that?

I am sorry i am usless.

Will that take down the sites and lose data?

Winit
17-03-2011, 20:31
rescue mode.

ryansstuff
17-03-2011, 19:56
Hiya i am in a bit of an issue as i dont seam to be able to get the root password of my server.

I am very noobie with all this so need as much help as possible i have cent OD and direct admin.

I have looked at http://forum.ovh.co.uk/showthread.ph...+root+password
Hi

You need to do this:

fdisk -l
the root one is marked with an asterisk. Thus now you can use the following command to mount the root partition:
mount /dev/yourrootpartition /mnt
Then, to use your partition type the command:
chroot /mnt
Then type the command:
passwd
type the new password at the prompt request

Then just boot back onto HD.
But i do not understand where about he has typed that in.
Any help?