Unable to reset web interface password

Hello, newbie here. I'm just a home user with a NAS and very limited Linux experience. Have installed Pi-hole and am able to login using the default 'pihole' password. I'm using Shell in a Box to try to reset the password via SSH, but I can't get it to work. The response is "Sorry, try again" whether I try something new or 'pihole'.

Any advice on what I may be doing wrong? Do I first need to change the directory to pihole? If so, I haven't been able to locate it.

Screenshot-2024-03-07-104615

That looks like a prompt for the sudo user. Pi-hole's prompt will be:

Enter New Password (Blank for no password):

Try the command without sudo.

pihole -a -p

Thanks for the response. This is what happened when I try that:

admin@AS1102TL-132E:/volume1/home/admin $ pihole -a -p     
-sh: pihole: not found
admin@AS1102TL-132E:/volume1/home/admin $

Try it the original way, but you'll need your admin/superuser password to be able to respond to the password prompt from sudo. You should then see Pi-hole's prompt.

Normally the pihole command doesn't need sudo, but it can depend on the environment in which it's installed. I imagine a NAS environment is more restricted. How did you install this on the NAS, are you using the Docker image?

Yes, I installed it via Asustor's App Central, and there was a notification that Pi-hole requires Docker, which I already had installed. Not sure about imaging—the install was more or less automated—but Pi-hole does work.

I've tried using the admin password as well—this is the interaction for that:

admin@AS1102TL-132E:/volume1/home/admin $ sudo pihole -a -p
Password:
sudo: pihole: command not found
admin@AS1102TL-132E:/volume1/home/admin $

This means pihole is not installed on that machine.

If Pi-hole was installed using docker, you need to find out the name of Pi-hole container and then run this command:

docker exec -it <pihole_container_name> pihole -a -p

Note:
maybe you will need to add sudo to the command above, like sudo docker exec ...

1 Like

– rdwebdesign –

That worked.

The proper command/location (after using SSH to list the Docker containers) for my system is:

sudo docker exec -it pihole pihole -a -p

Thank you so much. Now to figure out what exactly I can achieve with Pi-hole!

Note that container manipulations are not persistent, e.g. they won't survive a reboot if you haven't mounted any volumes for your container. Even if you did, they may be overwritten by a container's environment variable.

So when using a dockered Pi-hole, you should prefer to set your Pi-hole container's WEBPASSWORD environment variable, see also Pi-hole's Quick Start docker-compose template.

1 Like

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