Local Admin account cannot be logged into
We have been successfully running phpIPAM in our organization using AD authentication for all of our users for 5 years now, and we have never had the need to log in with the local administrator account. Recently, I took a copy of our prod web and database server to put into a local VM to test updating from 1.4 to 1.5.2, as well as test the implementation of scan agents- Trying to reset the admin account from the GUI (before exporting the VM of both machines) seemed to go through successfully, but trying to log in to ensure the password change worked, fails with 'incorrect username or password', ensuring to use capital A 'Admin' as is shown from the GUI as the login name as well, no success. Several changes with different passwords of varying length (first 24, then down to 16, but later discovered our password policies in IPAM have a limit of 0). I came across several articles saying to try the reset admin password script that is stored on the web server, tried that, still no success.
What are my next steps to gain access to these servers in a remote, not AD-tied environment if I can't get the admin account to work?
Try creating an alternate local account with admin privileges and then export your DB again?
Hello,
You can run php functions/scripts/reset-admin-password.php from the command line (SSH) to reset the Admin password.
Also someone may have messed with the database directly and removed/disabled the "Admin" account. If deleted you can re-add the default account Admin / ipamadmin from db/SCHEMA.sql. Or delete this row and re-add the default.
INSERT INTO `users` (`id`, `username`, `password`, `groups`, `role`, `real_name`, `email`, `domainUser`,`widgets`, `passChange`)
VALUES
(1,'Admin',X'243624726F756E64733D33303030244A51454536644C394E70766A6546733424524B3558336F6132382E557A742F6835564166647273766C56652E3748675155594B4D58544A5573756438646D5766507A5A51506252626B38784A6E314B797974342E64576D346E4A4959684156326D624F5A33672E',X'','Administrator','phpIPAM Admin','[email protected]',X'30','statistics;favourite_subnets;changelog;access_logs;error_logs;top10_hosts_v4', 'Yes');
Thanks for the suggestions. Unfortunately, I'm still having the same issue. As far as making any new database local accounts for testing- regardless of whether it was a admin account or a normal user, trying to log in with any of them resulted in the same 'incorrect username or password'. Does it take time for the accounts to be available for use after creation? I would have tried to log in within minutes of making them, but I imagine time isn't the issue.
I ran the reset-admin-password script before as mentioned in the original comment, but trying again with two other passwords of 'Password123' and 'NewPassword' in case symbols or numbers were the issue, no success, incorrect user/pass.
After logging into mysql as the database connection user from the default config file, I selected the phpipam database and ran the command you posted without errors, but I was unable to log in with Admin and ipamadmin. I didn't delete anything prior to running that, as I wasn't sure from your previous statement whether I'd have to delete anything or the query would take care of it.
Note that I'm a windows admin at my company, so CentOS and MySQL and such aren't my wheelhouse, so if I do need to remove any accounts before running that query again, please list the steps I'd need to do to execute that properly. Thanks
Closed the issue by mistake.
Do you have javascript disabled, no script plugin?
Did you export from Windows MySQL and import into a Unix MySQL instance?
Also check $cookie_samesite = "Lax"; in config.php
If set to secure and you're not running SSL on the VM test server the cookies will be rejected.
Thanks for your quick reply Gary. Looking through yum list installed, I do not see anything like 'java' or 'jre', so it would appear it is not installed, nor enabled. The server was not stood up by me, but I know it was done from a fresh install of centos. The database is stored on a separate centos server. Both of these machines are VMs running inside vSphere, so the copies I have are effectively exact copies of the machines, I did not export the databases or anything. I did not find $cookie_samesite = "Lax"; in the config.php file from /var/www/html/ where the db connection details and whatnot is, adding it to the end of the file and restarting the machine for good measure still didn't help. Any further recommendations are appreciated.
Hi @RyanMcKone I wonder if maybe by now this issue is resolved or does not apply anymore? Do you still need assistance with this?
Hi @RyanMcKone I wonder if maybe by now this issue is resolved or does not apply anymore? Do you still need assistance with this?
I have to use AD auth to log in, which works fine, and was never able to gain access through a local account using all the methods outlined here and otherwise. I'm well past needing a local account as I've completed all the local testing I was talking about in the issue, but as far as I know this is still a problem.
Thanks for the update. Back when you experienced the issue it was on the cloned development servers. Are you currently unable to login with the Admin account on your production phpIPAM server? If so, does resetting the password using the GUI allow you to login?
hi, i am having same issue as above, tried to copy database from another server to dev. however i am not able to login using local db user e.g admin or after creating a new admin account. I dont see invalid username / password. All i see after hitting enter is Please userlogin!. and when i click on that nothing happens, if i purposely put wrong password in login details i do get invalid username / password which it should display but i am not getting passed login screen.
Is any further assistance needed with this? Can this issue be closed?