Removing Linux user passwords
Last updated
Last updated
All you need is a USB stick loaded with a live distro, Ubuntu in "Try mode" is enough.
If distro doesn't load directly and BIOS has a password meaning you can't change boot order, you would need to open the system and remove the CMOS battery located in the motherboard for a couple minutes, so the BIOS resets to default.
Once inside the live distro we have root privileges, so all we need to do is mount the root file system (AKA partition where the SO is installed) and access it as root:
chroot
allows the specified directory to become the root directory for a process, limiting and "jailing" the directory and its contents from the outside
Once you chroot you could simply change the password with passwd
You could too edit the /etc/shadow
file without the need of chroot, open the file with an editor like nano
and leave the pass field of the user blank user::~
or add a new password with openssl passwd -6
and place the hash result in the pass field.