This page looks best with JavaScript enabled

Root Access through GRUB

 ·  🎃 kr0m

What would you think if I told you that there is a possibility to access a system as root without the corresponding credentials, but with physical access to the equipment?

This trick consists of pressing the e key to edit the entry you want to boot, at the end of the line where the kernel is specified, add rw init=/bin/bash. You can also add single to enter the system in single-user mode as root. Press b to boot and voila, the system will magically start with root permissions.

If we want to change the root password, we need to mount the / partition with the remount option:

mount /dev/ROOT -o remount,rw

Change the password

passwd

GRUB allows us to assign a password to protect the editing of boot entries:

vi /boot/grub/menu.lst

password PASSWORD

Actually, this “trick” consists of booting /bin/bash instead of init, which would go through the services in the runlevels and so on.

If you liked the article, you can treat me to a RedBull here