How to reset the root password on a Raspberry Pi

Put the Raspberry Pi SD card into a linux computer.

(If you do not have a linux computer you will need to install software that can read linux file systems)

Open the file /etc/passwd located on the SD card (you may need to be a super user to access this file on the SD card)

You should see the “pi” user, it will look something like this:

pi:$6$DYC5BlZ3$drMksdfpLq/zEkby6gb/m.W/b23423q7K9ery31fV65R7AyAcEymg7a9fE6JNRqbasdflkidwEPha1imMq.kJ61:17002:0:99999:7:::

Replace this complete line with the following:

pi:$6$nr7jrCVL$ZRCRDNJuB1Bc8JegDSnaKDyC6WtK4AftXcXKrkCKXAFP5Hbhg.JPhbEU1fUmeVbcAEqcnwQSrwPcO6LxAbCoc0:17044:0:99999:7:::

This is the encrypted value for “password”. So now the password for the “pi” user is simply “password”.

Put the SD card back into the Pi, boot it up, login using pi/password, then change your password again.

Enjoy!

 

Leave a Reply

Your email address will not be published. Required fields are marked *