![How to change the ‘root’ password from Grub.](https://miguelmenendez.pro/en/blog/2021/change-root-password-grub/Cambiar-contrasena-root-Grub-1.png)
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:
![In Grub, press e.](https://miguelmenendez.pro/en/blog/2021/change-root-password-grub/Cambiar-contrasena-root-Grub-1.png)
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 must remount the system in write mode.](https://miguelmenendez.pro/en/blog/2021/change-root-password-grub/Cambiar-contrasena-root-Grub-4.png)
I remount in write mode:
# mount -o remount rw /
Now I can edit the /etc/shadow
file:
# nano /etc/shadow
![Edit file '/etc/shadow'.](https://miguelmenendez.pro/en/blog/2021/change-root-password-grub/Cambiar-contrasena-root-Grub-5.png)
And I delete any characters between the first two colons on the line that starts with root
:
![I remove any character between the first two colons.](https://miguelmenendez.pro/en/blog/2021/change-root-password-grub/Cambiar-contrasena-root-Grub-6.png)
After restarting, I log in as root without a password. The first thing I will do is assign a new one:
# passwd