[Freedombox-discuss] Forgot admin password

Joseph Nuthalapati njoseph at riseup.net
Thu Apr 2 02:54:22 BST 2020

Hi Paul,

Thanks for sharing your method with the community.

I took the liberty of adding your solution to the FAQ page on the wiki
since this question is quite frequently asked.

BTW, a password reset feature is planned for this year.

I noticed that you used the word "customer" in the your first email. I'm
glad to know that Debian system administrators are offering consulting
services for FreedomBox as well. The fact that paid support and
consulting services exist can give more confidence to non-technical
users to adopt FreedomBox. I'm curious to know more about how you are
supporting people with their FreedomBox installations.

On 02/04/20 3:51 am, Paul van der Vlis wrote:
> Op 01-04-2020 om 12:26 schreef Geert Stappers:
>> On Wed, Apr 01, 2020 at 11:53:52AM +0200, Paul van der Vlis wrote:
>>> Hello,
>>> A customer changed the admin-password and forgot the new password.
>>> I can come into his Freedombox as root using SSH,
>>> but did not found a way to change the password.
>>> I guess I will do a reinstall now,
>>> but I would like to know the way to reset the password.
>> ML archive has some clue.  Websearch on me + password reset.
>> I guess it was about a year ago.
>> Please report back.   En dat mag in het nederlands.
> Let's do it in English.
> Changing the password did work.
> First change the LDAP password (this is one line):
> echo -n '<password>' | /usr/share/plinth/actions/users set-user-password
> <username>
> Then you need to create a little script "change_plinth_password.py":
> ------
> #!/usr/bin/python3
> from django.contrib.auth.hashers import PBKDF2PasswordHasher as Hasher
> import subprocess
> import sys
> hasher = Hasher()
> salt = hasher.salt()
> encoded_password = hasher.encode(sys.argv[2], salt)
> query = 'UPDATE auth_user SET password="{}" WHERE
> username="{}"'.format(encoded_password, sys.argv[1])
> subprocess.run(['sqlite3', '/var/lib/plinth/plinth.sqlite3'],
> check=True, input=query.encode())
> -----
> Executing the script gave an error, I needed first to install the
> package "sqlite3":
> apt install sqlite3
> Then run the script:
> python3 change_plinth_password.py <username> <password>
> Bye,
> Paul

Joseph Nuthalapati

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/freedombox-discuss/attachments/20200402/d5a3f50a/attachment.sig>

More information about the Freedombox-discuss mailing list