OVH Community, your new community space.

Help! forgot root password

20-04-2015, 19:23
As stated before, the only way to reset password/keys is taking the server in rescue mode. Any other method, if existing, would be a high risk security problem.

The standard procedure is simple: Boot in rescue mode, mount the root partition, chroot to it, run "passwd", exit, unmount, and reboot. If using keys, the chroot may not be needed, because you can edit the authorized_keys file directly. Note that, depending on the partition layout, it could be needed to mount some other partitions is, for example, you have "/etc" or "/usr" on filesystems different than root.

That procedure is described here: No matter it's for ArchLinux, it works for any distro.

They also suggest another method, which would require the KVM options(all servers starting 2014 have it). It involves editing the kernel command line in grub to make it run bash as root. Note that it could be more complicated to use this method if you have a complex partition layout, ot use an initrd.

20-04-2015, 18:57

20-04-2015, 18:56
Hey I had the same problem and tried all the above
nothing worked
Excellent Printing - For All Your Printing, Graphic & Web Design Requirements

18-02-2015, 11:35
that is quite a thread resurrection

@anoop00m: to do operations on the keys stored on the server, I recommend to do so in rescue mode too. Through there, you can modify the content of any keys and, if you know how the stored keys system works, you can do any operation on it.

Alternatively, through rescue mode, you can just overwrite the root password too, and get back into the system with the usual password login and afterwards, you can setup again the keys

17-02-2015, 20:09
@anoopam confusing .. plz desc simple

17-12-2014, 13:17
Hi, I have accidentally forget the root password. And I can only access via ssh-key gen. But while using this key in my local machine, its letting me to ask password. Is there any way to reset ssh-key root? I am using Linux-mint local machine, Any suggestion would be much appreciate.

12-08-2010, 22:10
Quote Originally Posted by Winit
Start using keys.
++ for keys
much better and faster.

12-08-2010, 22:07
Quote Originally Posted by dansgalaxy
Is there a way to do this which doesn't involve taking the sever offline? Don't want to have to take down 10 clients streams because the root pass i have written down is wrong... :/
Start using keys.

12-08-2010, 13:45
Or say your installing security updates or something, looks good on yourself then

12-08-2010, 13:39
Quote Originally Posted by Andy
Just pretend OVH had another network outage if your clients ask...
I dare not. OVH have already lost me 2 clients (each worth 20+/month) because of their downtime... last time lasting a week.. but dare not compensate me because I brought a dedicated server from *THEM* to replace the RPS which was offline... but as its a different server I dont deserve the comp....

Ok this is dangerously close to me ranting... I will stop now. lol

12-08-2010, 13:33
Just pretend OVH had another network outage if your clients ask...

12-08-2010, 13:05
Is there a way to do this which doesn't involve taking the sever offline? Don't want to have to take down 10 clients streams because the root pass i have written down is wrong... :/

12-06-2010, 06:39
sorry to bump an old thread..

when i do the mount /dev/sda1 /mnt that works, but when i do chroot /mnt i get that the command isn't found.. If I mount /dev/sda1 / then chroot / that works.. But.. after I do passwd, change the root password and reboot back off HD.. the root password still isn't working.. am I missing something?

when i checked mount, it was read/write on /.. so I figured it would work

edit: Got it.. i was using the wrong partition.. it was /sda3 (wasn't my server..heh was helping someone)

09-04-2010, 12:48
Try 'reboot -f'

08-04-2010, 22:30
rescue:~# reboot
shutdown: timeout opening/writing control channel /dev/initctl
init: timeout opening/writing control channel /dev/initctl

i get this after i follow neils steps what am i doing wrong?

08-04-2010, 18:24
The official explanation..

Go to Manager => Services => Netboot => mode rescue pro, then hard reboot the server. After some minutes, you can access via ssh the machine with the new codes sent by mail. On the server, you can type in order to list the partition scheme:
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:
type the new password at the prompt request.

For Windows, you boot it into WinPE and then access via VNC and click on the Password Icon to change it.

08-04-2010, 18:18
Short and simple.

This should be stickied.

08-04-2010, 18:02

08-04-2010, 17:48
put the server in rescue mode via manager, login via ssh, mount the root partition, chroot in it, for example "chroot /mnt/sda1", then type "passwd" to change the root password

08-04-2010, 17:42
can anyone tell me how i can change back my root password..working at 5 am all night..i thought i remembered the root password..or atleast typed in correctly..but apparently not