OVH Community, your new community space.

Reset Root Password


Kitty
06/01/2016, 05h39
Citation Envoyé par audi0galaxy
I forget the password of my root, its possible get default password without losing my files ?
You can't get it, but you can change it.

In the control panel, set the boot mode to Rescue Pro [Netboot -> Rescue -> Rescue Pro].
Reboot [Restart] the server.
Log in as root using the password that will be emailed to you..

You'll need to know the name of the usual root device from here. I'll use /dev/sda1 as a placeholder, change it to suit if necessary.

Code:
$ mount /dev/sda1 /mnt
$ mount --bind /proc /mnt/proc
$ mount --bind /sys /mnt/sys
$ mount --bind /dev /mnt/dev
$ chroot /mnt/
$ passwd
Enter your new root password when prompted (twice).
Logout (CTRL-D, or 'logout') to end up back in the Rescue shell.

Code:
$ umount /mnt/dev
$ umount /mnt/proc
$ umount /mnt/sys
$ umount /mnt
Cancel Rescue Mode in the control panel.
Reboot

nowwhat
05/01/2016, 08h57
Citation Envoyé par audi0galaxy
...., did you did before?
Of course.
Loosing a password and thus loosing access to your server, that happens (that's why most of us don't use "password access" anymore. Using the BIG SSH key means : storing it on a (removabel) disk and easy to copie (== backup) .... [ these keys have ... you won't believe it ... a password ] )
So, normally, as soon as you get your hands on a server, even before installing something on the server, test-drive then rescue mode (as proposed by KS, every host company has its own procedures how to boot in this rescue mode).
Never ever say to yourself:
=> I do not need to do that, I'll see how to do so later on.
=> This will never happen to me.

Citation Envoyé par audi0galaxy
But i done it last time i lost all mine info i dont want to do it again and lose everything ,
Ah, you broke another rule. Making backups.
Normally, that's fine if the files on your server have no value to you.

janus57
04/01/2016, 21h05
Hello,

???
if you have lost your file you have make a bad command…

If you have juste reboot in rescue mode it's "normal" since it's like a liceCD, wihtout mounting your HDD you will see nothing.

To change root paswword in rescue from memorie you need to mount your FS en chroot and use the "passwd" command, as simple as that.

Next time use a SSH Key and backup your SSH key.

Cordialement, janus57

audi0galaxy
04/01/2016, 20h12
But i done it last time i lost all mine info i dont want to do it again and lose everything , did you did before?

janus57
04/01/2016, 20h08
Hello,

you will need to reboot in rescue mode and change the root password.

I think there a tuto in this forum (or in the french forum).

Cordialement, janus57

audi0galaxy
04/01/2016, 20h02
Dear all,
I forget the password of my root, its possible get default password without losing my files ?