Forgot OS password, how to proceed?

Hi,
I was to the point when I was installing Pi-hole and install failed. I have not been able to get back into my Debian Install? It keeps asking for password? Is there anyway to start over? I do not think so if I cannot get into system ? Any help would be appreciated.

Thanks

If you don't remember your password, you very likely have to start over from scratch (unless your specific OS would allow you to reset its password).

1 Like

If you can mount the root partition "/" contained on the disk on another similar Linux system, you can use below to set a new password:

$ man passwd
[..]
       -R, --root CHROOT_DIR
           Apply changes in the CHROOT_DIR directory and use the
           configuration files from the CHROOT_DIR directory. Only
           absolute paths are supported.

Eg if the root disk partition were mounted on /mnt (check with lsblk) and you want to set password for the root user:

sudo passwd -R /mnt root

This is not possible if the filesystem is encrypted!

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.