Help! I Can't Log into my Ubuntu Server!

Can't boot your Ubuntu server?

Garbled GRUB file got you down?

SSH on the fritz?

Driving you crazy and ready to DELETE AND REINSTALL the O.S.???

Quick and Simple chroot to server stuck in Limbo

Wait one. Well, I can't guarantee a solution, but this strategy has worked for me a few times.

First Things, First

Grab yourself of LiveCD. Distro does not matter. Version does not matter. You're looking for a Linux distro that will allow you to run and enter the console (terminal).

All of the following needs to be run as sudo.

  1. Create a mount point:

    mkdir /mount/point

  2. Mount /proc /sys /dev to chroot:

    mount -o bind /proc /mount/point/proc
    mount -o bind /dev /mount/point/dev
    mount -o bind /dev/pts /mount/point/dev/pts
    mount -o bind /sys /mount/point/sys

  3. Copy resolv.conf to networking:

    cp /etc/resolv.conf /mount/point/etc/resolv.conf

  4. Open bash in chroot

    chroot /mount/point /bin/bash

  5. Do what you need to do (i.e. fix whatever is broken), then exit chroot.