How to reset a lost password.

dos2unix

Well-Known Member
Joined
May 3, 2019
Messages
4,408
Reaction score
4,601
Credits
41,638
Step-by-Step: Resetting a Linux Password via LiveUSB and chroot


Boot from a LiveUSB

Use any Linux Live distro (Ubuntu, Fedora, Arch, etc.).
Most modern distros support chroot, but some minimal ones (like Tiny Core or Puppy Linux) might not include it by default.



Open a Terminal


Identify the root partition

sudo fdisk -l
Look for the Linux partition (usually something like /dev/sda2). (rarely will /etc be on it's own partition, but I have seen it).


Mount the root partition

sudo mount /dev/sda2 /mntShow more lines


Mount necessary virtual filesystems

sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo mount --bind /sys /mnt/sys


Chroot into the installed system

sudo chroot /mnt


Reset the password

passwd username
Replace username with the actual user account name.


Exit and clean up

exit
sudo umount /mnt/devsudo
umount /mnt/procsudo
umount /mnt/syssudo
umount /mntShow more lines


Reboot

sudo reboot


Notes on Compatibility

Ubuntu, Debian, Fedora, Arch, Manjaro, Mint — all support chroot out of the box.
Minimal distros — may require installing coreutils or util-linux to get chroot.
BusyBox-based systems — have a lightweight chroot, but it may lack full functionality.
 
Last edited:




Follow Linux.org

Members online


Top