How to change the ‘root’ password from Grub
How to remove root user password from Grub.
It will only work if the root (/) disk or partition is not encrypted.
In Grub, press e:
I add, as the following images show, init=/bin/bash
to the line linux /boot[...]
:
Press Control + x to boot.
Now I have the system mounted in read-only mode:
I remount in write mode:
# mount -o remount rw /
Now I can edit the /etc/shadow
file:
# nano /etc/shadow
And I delete any characters between the first two colons on the line that starts with root
:
After restarting, I log in as root without a password. The first thing I will do is assign a new one:
# passwd