[SOLVED] Can not access web interface I can not authenticate

Forum for questions and support relating to the 1.34.x releases only.
Post Reply
linuxnutt
Posts: 37
Joined: Fri Aug 12, 2016 6:06 am

[SOLVED] Can not access web interface I can not authenticate

Post by linuxnutt »

I have no console view any more I locked myself out of Zoneminder Console web interface. Is there a cli command to turn off authentication so I can get back into zm web console? I have authentication enabled for everytime to work with zmninja except it kept complaining about OPT_USE_AUTH not being enabled so reviewed options-OPT_USE_AUTH and enabled it and saved, but apparently I did something else and now I'm locked out of the zm web console. I just need to turn off authentication so I can get into the zm web console, and fix whatever I messed up. So need a commnandline command I can run to turn off authentication.
I'm using Ubuntu 18.0406 and running Zomeminder v1.34. When I try to login here is the /var/log/syslog entry;
Feb 20 22:15:09 media web_php[16975]: INF [Login successful for user "super"]
Feb 20 22:15:10 media web_php[16975]: INF [Migrating password, if possible for future logins]
Feb 20 22:15:10 media web_php[16975]: INF [Migrating super to bcrypt scheme]
Feb 20 22:15:11 media web_php[16975]: ERR [Unable to authenticate user from auth hash 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx']
Feb 20 22:15:11 media web_php[16975]: ERR [Unable to authenticate user from auth hash 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx']

Hash redacted.

Thanks
Last edited by linuxnutt on Wed Feb 23, 2022 7:38 am, edited 1 time in total.
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Can not access web interface I can not authenticate

Post by Magic919 »

Looks like it's in the DB on 1.36. Might be the same.

Code: Select all

select Name, Value from Config where name like '%AUTH%';

Code: Select all

+----------------------------+---------+
| Name                       | Value   |
+----------------------------+---------+
| ZM_AUTH_HASH_IPS           | 0       |
| ZM_AUTH_HASH_LOGINS        | 1       |
| ZM_AUTH_HASH_SECRET        | sshhh   |
| ZM_AUTH_HASH_TTL           | 2       |
| ZM_AUTH_RELAY              | hashed  |
| ZM_AUTH_TYPE               | builtin |
| ZM_OPT_USE_AUTH            | 1       |
| ZM_OPT_USE_LEGACY_API_AUTH | 0       |
+----------------------------+---------+
Change that to zero and restart ZM.
-
linuxnutt
Posts: 37
Joined: Fri Aug 12, 2016 6:06 am

Re: [SOLVED] Can not access web interface I can not authenticate

Post by linuxnutt »

Apparently there are others who are having this same issue," OPT_USE_AUTH Locking Out Users, Aj3", anyway I'm going to post my work around for my solution and hopefully if others are having the issue it will help. To begin with looking at my logs above this has something to do with the new way of authentication using API with tokens, JTW and a bcrypt scheme vs the old auth hash session method, Read The Docs, API evolution, ie TLDR!

In my case I have one ZM server running 1.34.26. I locked myself out of being able to authenticate to use ZM web console, I enabled OPT_USE_AUTH, so I asked for someone to give me a command to disable it, no answer but thanks to Aj3 in his " OPT_USE_AUTH Locking Out Users", Aj3" there was the command I needed, thanks Aj3. Also when Opt-use-Auth was enable zmninja would not load the camera videos, it only listed the monitors and no video.
Here is how to disable OPT_USE_AUTH, from Aj3;
I then have to go in via ssh, jump over to root user, then:
$mysql -u root -p
use zm;
UPDATE Config set Value=0 where Name='ZM_OPT_USE_AUTH';

My Session:

Code: Select all

MariaDB [(none)]> use zm;

MariaDB [zm]> UPDATE Config set Value=0 where Name='ZM_OPT_USE_AUTH';
Query OK, 1 row affected (0.18 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [zm]> quit
Bye 
I was able to login and zmninga was able to load the monitors and see the video.
Here are the settings I used to fix my issue once I authenticated and made the changes in options, system,

zoneminder v1.34.26:

Code: Select all

MariaDB [(none)]> use zm;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed

MariaDB [zm]> select Name, Value from Config where name like '%AUTH%';
MariaDB [zm]> select Name, Value from Config where name like '%AUTH%';
+----------------------------+----------+
| Name                       | Value    |
+----------------------------+----------+
| ZM_AUTH_HASH_IPS           | 0        |
| ZM_AUTH_HASH_LOGINS        | 1        |
| ZM_AUTH_HASH_SECRET        | L6q2qy11 |
| ZM_AUTH_HASH_TTL           | 2        |
| ZM_AUTH_RELAY              | hashed   |
| ZM_AUTH_TYPE               | builtin  |
| ZM_OPT_USE_AUTH            | 0        |
| ZM_OPT_USE_LEGACY_API_AUTH | 0        |
+----------------------------+----------+
8 rows in set (0.10 sec)
Thats it!
Post Reply