In this article, we will learn how to reset the forgotten password of root user account on Ubuntu 18.04 operating system.
- You should have a VPS, Budget Server, or Dedicated Server with Ubuntu 18.04 installed.
- You should have access to your Snel client control panel to open a KVM console.
Note: You can not reset the root password using the OpenSSH shell. You must have access to the KVM console of your server to follow along.
Step 1: Open KVM Console
To open a KVM console on for dedicated server or managed dedicated server, please use this article.
To open a KVM console for budget server please use this article.
To open a KVM console for VPS, login to your Snel account and click on your VPS under services.
Under the VPS service details page, click on
Console to open up the KVM console.
You should have the KVM console open in a new browser tab.
Step 2: Reboot Machine
While you have your KVM console open, reboot the server to get the GRUB menu.
Dedicated server users: Open the
Server Power Control tab from the service details page of the dedicated server. Click the
Reboot button to reboot the server.
VPS users: Open the service details page of the VPS and click on the
Note: After rebooting your server quickly go to the KVM console as GRUB menu waits only a few seconds before booting OS.
Step 3: Modify Boot Parameters
After rebooting the VM quickly switch to KVM console and keep pressing
SHIFT key repeatedly until you see the GRUB screen. You may need to do this very quickly to get the GRUB menu.
Note: If you missed the grub screen, go ahead and reboot your server again.
In GRUB menu, press
e to edit the boot parameters.
In GRUB edit mode, find the line which starts with
linux and has
ro quiet splash $vt_handoff at the end of the line.
ro quiet splash $vt_handoff with
rw init=\bin\bash as shown in the picture.
Once done, press
Ctrl-x to boot with changed parameters.
Step 4: Reset Password
clear command to clear the system messages from the terminal.
Run the following command to change the password.
Now, run the command to reboot the server. You may also use snel control panel reboot buttons described in Step 2 to reboot the machine.
exec /sbin/init 6
In this tutorial, we learned how to reset the password of the root user on Ubuntu 18.04 operating system.