Apr 04

Booting into rescue system

Category: Linux   — Published by tengo on April 4, 2008 at 7:09 am

While configuring, changing or testing stuff on a dedicated server, things might break or you lock yourself out. Things like that often happen while securing your server. Anyway, there is help!

Most ISPs offer a rescue console or booting into a rescue system to undo unwanted changes or rescue data from a defunct system. The rescue system is also the last resort when your system got compromised by an attacker. Here are the basic steps to find your way around:

  1. Tell the system to reboot and, this time, load the rescue system. Most ISPs have a command for that on the GUI/ the web interface of your server.
  2. Login via ssh as root: ssh <your-server's-IP> -l root
  3. Find out where the file system of your "real" operating system is now mounted: use the command fdisk -l, look for drive ids in the /dev folder
  4. Mount the filesystem ("sda2" here) to a newly-created directory (for example "foo") to work on the partitition: mkdir /foo && mount /dev/sda2 /foo
  5. Do what has to be done to recover your normal OS
  6. type reboot and <ENTER>