Removing Linux user passwords

All you need is a USB stick loaded with a live distro, Ubuntu in "Try mode" is enough.

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:

#To look for partitions on the system
lsblk

#Create a directory to mount the partition we want to access
sudo mkdir /media/partition
sudo mount /dev/sdaN /media/partition

#Access it as root in the mounted partition
sudo chroot /media/partition

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.

Last updated