Reset Raspberry password

Edit /etc/shadow on SD card, change the hashed password to

$1$salt$qJH7.N4xYta3aEG/dfqo/0

The new password is password.