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';

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’;