Recover or reset admin password

Hi,

I took the installation advice and reset my admin password for the lora-app-server web interface, but lo and behold I forget it.

Is there any way to recover or reset the admin password? Not a frequent postgres user so couldn’t find it anywhere.

thanks

This is the hash of the initial admin password:

You can use this password as the password_hash in the user table of LoRa App Server.

Thanks,

maybe I’ve broken my installation but I can’t see any admin entry… or is that the wrong database?

root@ubuntu:~# psql -h localhost -U loraserver_as -W loraserver_as
Password for user loraserver_as:
loraserver_as=> select * from user;
current_user

loraserver_as
(1 row)

The table user is a reserved one in postgres. As you can see, when querying it, it’ll show the current logged user, in this case loraserver_as. In order to get the loraserver_as’s DB user table, you must query it with quotes, i.e.:

select * from "user";

When updating the admin user, you must do the same.

Thanks, that worked.

For reference to update existing entry, I entered

UPDATE "user" SET password_hash= 'PBKDF2$sha512$100000$4u3hL8krvlMIS0KnCYXeMw==$G7c7tuUYq2zSJaUeruvNL/KF30d3TVDORVD56wzvJYmc3muWjoaozH8bHJ7r8zY8dW6Pts2bWyhFfkb/ubQZsA==' WHERE username='admin';
2 Likes

How can I access my Chirpstack network because I accidentally deleted the user account and can no longer log in?

you can do that via postgresql cli by this insert

insert into "user"(created_at, updated_at, username, password_hash, session_ttl, is_active, is_admin, email, note) 
values(now(), now(), 'admin', 'PBKDF2$sha512$100000$4u3hL8krvlMIS0KnCYXeMw==$G7c7tuUYq2zSJaUeruvNL/KF30d3TVDORVD56wzvJYmc3muWjoaozH8bHJ7r8zY8dW6Pts2bWyhFfkb/ubQZsA==', 0, true, true, 'some@email.com', 'some_note');

how?
Is it by using a Debian terminal or how?
because I don’t know how I can do the procedure exactly.

example :
chribuk@chribuk-HP-ENVY-x360-Convertible:~$ insert into “user”(created_at, updated_at, username, password_hash, session_ttl, is_active, is_admin, email, note)
values(now(), now(), ‘admin’, ‘PBKDF2$sha512$100000$4u3hL8krvlMIS0KnCYXeMw==$G7c7tuUYq2zSJaUeruvNL/KF30d3TVDORVD56wzvJYmc3muWjoaozH8bHJ7r8zY8dW6Pts2bWyhFfkb/ubQZsA==’, 0, true, true, ‘some@email.com’, ‘some_note’);

or is there a path to follow?

this is postgresql command. you need to connect to exact database and make insert. how to connect described in installation guide on the main site docs.

i had this message

ERROR: column “email” of relation “user” does not exist
LINE 1: … password_hash, session_ttl, is_active, is_admin, email, not…

hi gus i’m looking for the command can help me to int inside of Postgres sha512 to modify somethings please i need your help.

With the change to the Chirpstack user tables, the command to reset the admin user password becomes:
UPDATE “user” SET password_hash= ‘PBKDF2$sha512$100000$4u3hL8krvlMIS0KnCYXeMw==$G7c7tuUYq2zSJaUeruvNL/KF30d3TVDORVD56wzvJYmc3muWjoaozH8bHJ7r8zY8dW6Pts2bWyhFfkb/ubQZsA==’ WHERE email=‘admin’;

To reset the login to u:admin pw:admin you have to remove the appropriate docker volume and recall $docker-compose up

Hi, tried this. Bot no way to reset my admin password.

chirpstack=# UPDATE “user” SET password_hash=‘PBKDF2$sha512$100000$4u3hL8krvlMIS0KnCYXeMw==$G7c7tuUYq2zSJaUeruvNL/KF30d3TVDORVD56wzvJYmc3muWjoaozH8bHJ7r8zY8dW6Pts2bWyhFfkb/ubQZsA==’ WHERE email=‘admin’;
UPDATE 1

But it does not work. I’ve installed the Debian version with latest updates.

Any hints???
Thanks

Reset admin user to admin PW (V4 tested)

  1. select email, password_hash from “user”;

  2. UPDATE “user” SET password_hash=‘$pbkdf2-sha512$i=10000,l=32$DMJEl+7IRJrDcd3/VamdSw$TukY3fi2kgtbV+8Oq7eCVuvPAaL7gUqL7IurFCaBMIo’ WHERE email=‘admin’;

– To Validate
3. select email, password_hash from “user”;

Tnx, will give it this evening a try. There are many instructions in this forum… Outdated or old release… Difficult to find.

The hash format for ChirpStack v3 and v4 is a bit different.

Thanks, that has worked. But i had to play around with " ’ , but that could be a problem with this webeditor. So i attach a picture… :wink:

UPDATE “user” SET password_hash=‘$pbkdf2-sha512$i=10000,l=32$DMJEl+7IRJrDcd3/VamdSw$TukY3fi2kgtbV+8Oq7eCVuvPAaL7gUqL7IurFCaBMIo’ WHERE email=‘admin’;

It worked for me on Ubuntu.