2 minutes
Forgot my Portainer Password
Quick Background
I use a portainer setup for my home lab. I have 3 different Intel NUCs that make up my workers. They are all running an instance of docker and portainer. While setting up this blog I was looking to see if I could improve this setup a bit or at least upgrade to the latest version (this has been running for 6+ months now). When I fired up my browser and targeted my portainer instance I was greeted with an unfamiliar authentication page.
Head Over to Google
I began by searching around for anyone with a similar issue. This ultimately led me to an open issue on github. Seeing that green open button made me think about blowing away the portainer db and starting over, but then I cam across this comment:
At this point I just shutdown my container, edited the file by pasting in my new password hash and done!
Create new password hash (taking everything after the :
):
[root@worker1 _data]# docker run --rm httpd:2.4-alpine htpasswd -nbB admin 'turd'
admin:$2y$05$c7YabuHwYNFboeXU/qrS6u4j9H6D0q6c6ebj9X2bMe/o9vGbYi0uu
[root@worker1 _data]#
Stop, edit, restart:
[root@worker1 ~]# docker stop 2946f43374f2
2946f43374f2
[root@worker1 ~]#
[root@worker1 _data]# /tmp/boltbrowser
Usage: boltbrowser [OPTIONS] <filename(s)>
Options:
-timeout=duration
DB file open timeout (default 1s)
-ro, -readonly
Open the DB in read-only mode
[root@worker1 _data]# /tmp/boltbrowser portainer.db
[root@worker1 _data]# docker start 2946f43374f2
2946f43374f2
[root@worker1 _data]#
boltbrowser view: