getting root acces to your linux without knowing the password

you have your linux box… and you dont remember root password. it happens all the time, doesnt it?

you can change the password if you have direct access to computer’s console and there is no additional protection on boot-loader level. you just need to provide additional parameters to the kernel: single init=/bin/bash

to do so in grub select your favorite kernel, press e to edit it, highlight second line with kernel parameters and press e again. add at the end of line single init=/bin/bash, press enter and then b to boot. you’ll get root prompt after a while. you can use passwd or just vi /etc/shadow.

tested with redhat and debian.

Leave a Reply

Your email address will not be published. Required fields are marked *

 

(Spamcheck Enabled)