Breaking into Debian - Adam-Hachem/SEC335 GitHub Wiki

Obtaining access to the root account is fairly easy if you have physical access. This should work on Debian distros, but we will use Kali for this example. Below are the steps necessary to break in:

  1. Restart the system, and press space when you see the boot option screen:

image

  1. Press E to edit the configuration, add the extra text single init=/bin/bash to a line as shown below. Use Ctrl + X to boot with the changes:

image

  1. Mount the filesystem with mount -rw -o remount /

  2. Change the root password with passwd, then set the password for the root account. Save the changes with sync and unmount with umount /

image

You should now be able to power cycle the machine and log in as root, which has the new password.