Linux Live OS and password reset

This article describes what Linux Live OS is, when and how to use it.


What is Linux Live OS and when to use Linux Live OS

Linux Live OS, in simplest term, is an operating system. At LeaseWeb, we call it Rescue Mode. Normally an operating system would be installed on an hard disk, while Linux Live OS is not—it will be temporarily installed to the system's memory.

As Linux Live OS is running from the memory, the data on the hard disk will not be touched or formatted. However, from the Linux Live OS, you can mount the partitions on the hard drive and make changes to it.

When to use Linux Live OS

You can use Linux Live OS to perform the following tasks:

  • Backup: When the bootloader of your current operating system got broken or corrupt, it will not boot anymore. This means you will not have access to your files anymore. As it is possible with Linux Live OS to mount the partitions on the hard disk, you will be able to access your files and move them somewhere else.
  • Lost root password: When you lost your root password, you can reset your root password using Linux Live OS.
  • Server configuration files: If you cannot access your server via SSH because you disallowed root login from the SSH configuration, you can revert this via Linux Live OS.
  • File system check (fsck): If you think that (one of) your partition(s) contains filesystem errors which prevents your server to boot, you can run a filesystem check using Linux Live OS.

How to use Linux Live OS

You can boot your server yourself with a Linux Live OS. Currently we offer two different Linux Live Environments - for Linux and for FreeBSD.

Perform the following steps to use the Linux Live OS:

  1. Log in to the LeaseWeb Customer Portal (
  2. Browse to Bare Metal Servers > Overview.
  3. Next to the server which you want to boot into a Live Environment, click Manage.
  4. Under Rescue Mode, click Start.
    The "Choose the rescue image" dialog box opens. 
  5. Select the environment using which you want to reboot the server.
    It will take a couple of minutes to boot the server in Rescue Mode (Live Environment).
    You will receive the login credentials via email to connect to VNC or SSH.  
  6. Under Server Information, click Show.
    You can locate the root password for rescue mode (it starts with ‘RescueModeRootPass’).


Backup / recover files

Boot your server into a Live environment and log in via SSH.

Print the partition table using fdisk or parted depending on the partition label (fdisk for DOS and parted for GPT):
# parted -l
# fdisk -l
Example output:
Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 204800 83 Linux
/dev/sda2 26 536 4096000 82 Linux swap / Solaris
/dev/sda3 1046 13055 96458752 83 Linux

As you see there are 3 partitions, /dev/sda1 is the boot partition, /dev/sda2 is swap and /dev/sda3 is the root partition.

Create mountpoints, we’ll need this later in order to mount the partitions:
# mkdir /mnt/data

Mount the root partition as /mnt/data:
# mount /dev/sda3 /mnt/data

You will now be able to access your files via /mnt/data (command: cd /mnt/data).

Lost root password

Boot your server into a Live environment and log in via SSH.

Create a mountpoint and mount your root partition:
# mkdir /mnt/root
# mount /dev/sda3 /mnt/root
Notice: Locate your root partition using fdisk -l or parted -l.

Change root to the mount directory:
# chroot /mnt/root

Set a new root password:
# passwd

Server configuration files

Boot your server into a Live environment and log in via SSH.

Mount your root partition as described under the "Backup/recover files" section.
Edit and save the configuration file (example: SSH):
# nano -w /mnt/data/etc/sshd_config

Filesystem check (fsck)

Boot your server into a Live environment and log in via SSH. 

You don’t need to mount the partitions, you can straight away run a filesystem check (fsck) on the partitions.

You can click on any of the keywords below this article to see all related articles for that keyword