25% off on first invoice for all services*

SPRING SALE

Use coupon

*Offer valid for new customers only

25% off on first invoice for all services*

SPRING SALE

Use coupon

*Offer valid for new customers only

Need help?

Our experts have had an average response time of 11.43 minutes in March 2024 to fix urgent issues.

We will keep your servers stable, secure, and fast at all times for one fixed price.

How to safely change root password in Vultr server?

by | Jan 5, 2019

Setting a complex password is the first step of securing any server.

But, what if you can’t remember the Vultr server root password few days after the setup ?

One of the solution is to reset the root password of your Vultr instance. And, this involves a series of steps depending on the server type.

At Bobcares, we often get requests from customers to recover root access to Vultr servers as part of our Technical Support Services for web hosts.

Today, we’ll see how our Cloud Engineers safely change the root password of Vultr server.

 

Need for root password reset in Vultr

Before proceeding further, let’s first see the scenarios where we generally need to change root password.

 

1. New servers

Usually, the initial root password details of a new Vultr server can be viewed from the Vultr Dashboard. To view the root password, we just need to clicking on the eye icon in the server page below.

 

 

But, when you change the root password via command line, it will not update in the Dashboard. And, if you forget it, all you can do is a root password reset.

 

2. Restore from another server snapshot

Vultr also allows to create new VPS based on the snapshot of existing server. Here, the root password will be the one that was set for the server at the time of snapshot.

From our experience in managing servers, we often see customers creating a VPS from old snapshot having problems with recovering root password. In all these situations, it becomes a necessity to change the root password.

 

How we change Vultr root password?

Managing a server requires root password. Let’s now see how our Dedicated Engineers reset the root password in Vultr server.

To change root password, we boot the server in a minimal working mode called “single user mode“. Let’s see the steps involved in this.

 

1. Restart the server

The first step is to restart the server.

For this, our Support Engineers access the console option and restart the server by clicking the “CTRL+ALT+DEL” button on the top right.

As the server starts, we press the ESC key to bring up the GRUB boot prompt.

 

2. Edit boot option

Here, at the boot prompt, we edit the boot option to change the working mode of the server. This step depends on the type of server.

For example, in a CentOS7 server, at the GRUB boot prompt, we press ‘E’ to edit the first boot option. Then edit the kernel line as

rw init=/sysroot/bin/sh

Similarly, in Debian or Ubuntu servers, we find the kernel line that starts with linux /boot/ and add init=/bin/bash at the end of the line.

After saving the file using F10 key, the system boots in single user mode.

Likewise, to boot CentOS6 server in single user mode, we type A to append to the boot command, add the text single and press ENTER.

 

3. Set new root password

Now that we are in single user mode, we need to set the new root password. This step also varies depending on the server type.

For this, in CentOS7 servers, our Support Engineers access the system with the command:

chroot /sysroot
passwd

The passwd command will prompt for the new password and we set a complex password for root.

 

4. Reboot the server

As the final step, we reboot the server once again. Now, we have reset the root password of the Vultr server.

 

Common errors with password reset

Just like any server, changing root password is not a one-click task. Therefore, we often see customers finding problems with Vultr root password change too. We’ll now see the top problems.

 

1. Commands for wrong server type

Often, customers attempt to use commands not suitable for their server type. For example, trying CentOS commands on an Ubuntu server will cause password reset to fail.

That’s why, our Support Engineers primarily check the server version and then proceed with the respective commands to reset password.

2. Copy/paste of commands

Similarly, copying and pasting of the commands will not work in Vultr console. And, we’ve seen customers making typo errors in the commands too.

To fix, we enter the command manually from the console and change the root password for the customer.

 

Proactive measure to avoid the need for password change

We just saw the series of steps to change the root password. Once we have accessed the server, our Dedicated Engineers go one step further and set up proper SSH keys on the Vultr server.

This method works with a private and public ssh key pair and do not need root password. Fortunately, even if you forget root password, ssh keys will grant you access to the server. Additionally, we set the VPS to only accept keys from trusted IP addresses.

 

Conclusion

Root password change in Vultr server involves a series of steps based on the type of servers. Today, we saw how our Cloud Engineers reset Vultr root password from console and fix common errors with it.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

SEE SERVER ADMIN PLANS

var google_conversion_label = "owonCMyG5nEQ0aD71QM";

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

Privacy Preference Center

Necessary

Necessary cookies help make a website usable by enabling basic functions like page navigation and access to secure areas of the website. The website cannot function properly without these cookies.

PHPSESSID - Preserves user session state across page requests.

gdpr[consent_types] - Used to store user consents.

gdpr[allowed_cookies] - Used to store user allowed cookies.

PHPSESSID, gdpr[consent_types], gdpr[allowed_cookies]
PHPSESSID
WHMCSpKDlPzh2chML

Statistics

Statistic cookies help website owners to understand how visitors interact with websites by collecting and reporting information anonymously.

_ga - Preserves user session state across page requests.

_gat - Used by Google Analytics to throttle request rate

_gid - Registers a unique ID that is used to generate statistical data on how you use the website.

smartlookCookie - Used to collect user device and location information of the site visitors to improve the websites User Experience.

_ga, _gat, _gid
_ga, _gat, _gid
smartlookCookie
_clck, _clsk, CLID, ANONCHK, MR, MUID, SM

Marketing

Marketing cookies are used to track visitors across websites. The intention is to display ads that are relevant and engaging for the individual user and thereby more valuable for publishers and third party advertisers.

IDE - Used by Google DoubleClick to register and report the website user's actions after viewing or clicking one of the advertiser's ads with the purpose of measuring the efficacy of an ad and to present targeted ads to the user.

test_cookie - Used to check if the user's browser supports cookies.

1P_JAR - Google cookie. These cookies are used to collect website statistics and track conversion rates.

NID - Registers a unique ID that identifies a returning user's device. The ID is used for serving ads that are most relevant to the user.

DV - Google ad personalisation

IDE, test_cookie, 1P_JAR, NID, DV, NID
IDE, test_cookie
1P_JAR, NID, DV
NID
hblid

Security

These are essential site cookies, used by the google reCAPTCHA. These cookies use an unique identifier to verify if a visitor is human or a bot.

SID, APISID, HSID, NID, PREF
SID, APISID, HSID, NID, PREF