Root password Linux reset in 1 minute

This little trick recently saved me from a critical situation and shows one more time the weakness of every system with unencrypted disks.

Press e at grub loading :

 

Add a init=/bin/bash after the line /boot/vmlinuz (…)

 

Press CTRL+X to boot. If your partition is encrypted, you’ll be prompted to enter your password. If not, you’ll be directly dropped in a shell with root privileges.

You still need to mount the partition to be able to modify /etc/shadow file.

Execute :

mount -o remount -o /

 

Change your password with the basic command :

 passwd

 

Just reboot, et “voilà” !

Leave a Reply

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