Password recovery for Debian / Ubuntu


I have noticed that there are few topics for password recovery on the Penguin world (Linux, of course), instead we see many Windows password recovery videos, methods, and articles. So I decided to share with you my experience with password recovery through Debian 13. Just notice that this method will work for all other Linux distributions based on Debian, including Ubuntu, Linux Mint
Well, there are many methods to do so, but using GRUB is better in case you don't have a USB stick with recovery tools and images.
Tweak GRUB before booting up your Linux machine.
When the GRUB menu shows up, press "e" for edit mode. Then move to the line "linux /boot/vmlinuz.... ro quiet splash", change ro (readonly) with rw (read & write), and add at the end of that line init=/bin/bash, then hit F10 to boot up.
Hit the following commands:
mount -n -o remount,rw /
(Remounts the root filesystem (/) as read-write in emergency or recovery mode.)
ls /home
(check for users)
passwd <yourUserName>
(change your password)
sync
(flushes all pending disk writes from memory to disk, ensuring data integrity)
reboot
(just to reboot your machine)
๐ Congratulations โ your Linux password recovery journey comes to an end! ๐๐ง
Your password is reset, and you're back in control. ๐ช
Subscribe to my newsletter
Read articles from Zakaria Farhati directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Zakaria Farhati
Zakaria Farhati
Hey there! I'm Zakaria, a passionate IT enthusiast with a strong focus on systems, networking, and everything infrastructure. From Linux terminals to cloud servers, I love diving deep into the tools and technologies that power the modern digital world.