# Removing Linux user passwords

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

{% hint style="warning" %}
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.
{% endhint %}

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:

```bash
#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
```

{% hint style="info" %}
`chroot` allows the specified directory to become the root directory for a process, limiting and "jailing" the directory and its contents from the outside

![](https://611212939-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeWeOizQQ8RqMzCSYDkwj%2Fuploads%2FqsgjsBCPyhWZQkrnUxFW%2Fimage.png?alt=media\&token=e824eb00-5a5e-412f-bff9-94e6ed02ad3c)
{% endhint %}

Once you chroot you could simply change the password with `passwd`&#x20;

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.&#x20;
