sipcapture / homer

HOMER - 100% Open-Source SIP, VoIP, RTC Packet Capture & Monitoring
https://sipcapture.org
GNU Affero General Public License v3.0
1.66k stars 244 forks source link

HOMER7 Password Reset #573

Closed crawc closed 1 year ago

crawc commented 1 year ago

How can I reset the password for the admin user for HOMER7?

I think this must be done directly in the Postgres database but I'm not sure and I'm unable to find recent documentation on how to do so.

root@HOMER:~# sudo -u postgres psql -U homer_user -W could not change directory to "/root": Permission denied Password: psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432" failed: FATAL: Peer authentication failed for user "homer_user"

FYI I have this installed on Debian.

Any help would be appreciated

naqashsaeed commented 1 year ago

Hi @crawc

Please follow the following steps to reset password

Step1: Find the Password for Database.

cat /etc/heplify-server.toml | grep DBPass | awk '{print $3}' | tr -d '"'

Step 2: Take backup of the table. Execute following command and it will not ask you for password and you can take backup of your database.

  $ export PGPASSWORD=`cat /etc/heplify-server.toml | grep DBPass | awk '{print $3}' | tr -d '"'`
  $ pg_dump -U homer_user -h localhost -d homer_config -t users > /root/backup.sql

Step 3: update admin user to default password.

$ su postgres
$ psql homer_config

homer_config=# UPDATE users SET hash =
'$2a$10$wWsjhHFHqPLd4Q4FNbcR3OjYTcaz.WbiJ8pvrUwXPbZx3zP3VItPK' where username='admin';
homer_config=# exit

Step 4: try login again in HOMER UI with the following credentials.

Username: admin
Password: sipcapture