Changing server password

Linux server

If we want to change the password of the administrative account for the Linux server, we can change it using the rescue mode.

First, shut down the server (1) and boot it into an rescue mode (2).

Password change

Then go to the server console and mount the main system partition /:

mount /dev/vdXY /mnt

for LVM:

mount /dev/mapper/X-Y /mnt 

X-Y is the name of the device / partition.

The next step is to execute the command:

chroot /mnt /bin/bash

Once the chroot command is executed correctly, you will get access to the system console. If the chroot command ended with an error, verify that the specified partition is a system partition. Having access to the system console, we can change the password of the administrative user with the passwd command.

After changing the password, unmount all mounted partitions using the command:

umount -a

Then exit the rescue mode and restart the server. After restarting the server, we can log in to the account of the administrative user to whom we have just changed the password.


Remember - use strong passwords! It is worth following a set of best practices in this regard:

  • Use all available characters, i.e. numbers, upper and lower case letters, and other symbols and special characters, such as ! , . / @ # $ + _ - % ^ & *.
  • However, avoid repeating the same characters or entering characters in a logical sequence such as 123456, qwerty or abcdefgh.
  • Make passwords as long as possible - the longer the password, the harder it is to crack. If a given login system cannot use the full range of characters to create a password (e.g. only numbers and letters), its strength can be increased only by using the maximum number of characters available in this system in a password.
  • Use passwords that are difficult for others to guess, not only through the use of special symbols in them, but also intentional mistakes and arbitrary interchangeability of symbols, numbers and letters limited only by our imagination.
  • Use separate passwords for different accounts and services.


Windows server

Contact our Customer Support.