Unable to Reset Password/Login

Running on Kali, 5.18.0-kali5-amd64, GVM-21.4.3

I’ve run the following commands (all suggested as fixes in other posts) in an attempt to reset the ‘admin’ password but I’m now unable to login via the UI. The output of gvm-check-setup is below.

How to fix? This appears to be a recurring issue in multiple posts on the same and no clear fix.

  1. sudo gvmd --user=admin --new-password=admin
  2. sudo -E -u gvm -g gvm gvmd --user=admin --new-password=admin
  3. sudo runuser -u _gvm – gvmd --user-admin --new-password=admin

Additionally, I’ve restarted gsad and also rebooted in an attempt to resolve.

gvm-check-setup
gvm-check-setup 21.4.3
Test completeness and readiness of GVM-21.4.3
Step 1: Checking OpenVAS (Scanner)…
OK: OpenVAS Scanner is present in version 21.4.4.
OK: Server CA Certificate is present as /var/lib/gvm/CA/servercert.pem.
Checking permissions of /var/lib/openvas/gnupg/*
OK: _gvm owns all files in /var/lib/openvas/gnupg
OK: redis-server is present.
OK: scanner (db_address setting) is configured properly using the redis-server socket: /var/run/redis-openvas/redis-server.sock
OK: redis-server is running and listening on socket: /var/run/redis-openvas/redis-server.sock.
OK: redis-server configuration is OK and redis-server is running.
OK: _gvm owns all files in /var/lib/openvas/plugins
OK: NVT collection in /var/lib/openvas/plugins contains 107229 NVTs.
Checking that the obsolete redis database has been removed
OK: No old Redis DB
OK: ospd-OpenVAS is present in version 21.4.4.
Step 2: Checking GVMD Manager …
OK: GVM Manager (gvmd) is present in version 21.4.5.
Step 3: Checking Certificates …
OK: GVM client certificate is valid and present as /var/lib/gvm/CA/clientcert.pem.
OK: Your GVM certificate infrastructure passed validation.
Step 4: Checking data …
OK: SCAP data found in /var/lib/gvm/scap-data.
OK: CERT data found in /var/lib/gvm/cert-data.
Step 5: Checking Postgresql DB and user …
OK: Postgresql version and default port are OK.
gvmd | _gvm | UTF8 | en_US.UTF-8 | en_US.UTF-8 |
OK: At least one user exists.
Step 6: Checking Greenbone Security Assistant (GSA) …
Oops, secure memory pool already initialized
OK: Greenbone Security Assistant is present in version 21.4.4.
Step 7: Checking if GVM services are up and running …
OK: ospd-openvas service is active.
OK: gvmd service is active.
OK: gsad service is active.
Step 8: Checking few other requirements…
OK: nmap is present in version 21.4.4.
OK: ssh-keygen found, LSC credential generation for GNU/Linux targets is likely to work.
OK: nsis found, LSC credential package generation for Microsoft Windows targets is likely to work.
OK: xsltproc found.
WARNING: Your password policy is empty.
SUGGEST: Edit the /etc/gvm/pwpolicy.conf file to set a password policy.

It seems like your GVM-21.4.3 installation is OK.

Hi, you need to look at /var/log/gvm/gvmd.log for possible errors while setting the password. Most likely there is an issue with the PostgeSQL database not catch by Kali’s gvm-check-setup script.

1 Like

The log is empty. Thoughts?

ls -al /var/log/gvm/gvmd.log
-rw-r----- 1 _gvm _gvm 0 Dec 26 00:00 /var/log/gvm/gvmd.log

On Kali the following command should work if the setup is correct

The command will return an exit code of 0 if it was successful. To get the exit code just run echo $? directly after the sudo -E -u _gvm ... command. If it isn’t 0 there must be some error message in /var/log/gvm/gvmd.log afterwards.

1 Like

There is a message in gvmd.log but it still fails after returning 0 following with “Login Failed. Invalid password or username” in both Chrome and FF. Thoughts?

$ sudo runuser -u _gvm – gvmd --user=admin --new-password=admin
$ echo $?
0
$ sudo cat /var/log/gvm/gvmd.log
md main:MESSAGE:2022-12-28 16h59.23 utc:313219: Greenbone Vulnerability Manager version 21.4.5 (DB revision 242)
md manage: INFO:2022-12-28 16h59.23 utc:313219: Modifying user password.

Any update to this? The password reset is not working.

Hi @alpha23, using the Preformatted text option in the forum, can you please paste the exact command that you are using in the terminal, as it appears in the terminal (for option 3, which is the way Kali handles it). If it was a copy and paste it can introduce unwanted characters at times. Thanks!

1 Like
sudo runuser -u _gvm -- gvmd --user=admin --new-password=admin

I compared it with what we have here as an example in the Community Portal help for Kali installs
https://community.greenbone.net/how-do-i-common-questions/#toggle-id-1

and it’s a bit different, so try using it in the form of

sudo -u _gvm gvmd --user='user' --new-password='newpassword'

and let us know if that works. Thanks!

1 Like

It does not work. Executed the following and returns with ‘Login failed. Invalid password or username’ when attempting to log in with the credentials in the command.

sudo -u _gvm gvmd --user='admin' --new-password='admin'

Please make sure to use all up2date packages / an up2date Kali version which includes the fixes mentioned in:

A comment in referenced Kali Bugreport mentions that the gsad package needs to be present in version 21.4.4-1kali1 or later to fix any login issues.

2 Likes

I had previously upgraded kali but updated again and retested. It does not work. Do I need to do a dist-upgrade?

lsb_release -a
No LSB modules are available.
Distributor ID: Kali
Description: Kali GNU/Linux Rolling
Release: 2022.4
Codename: kali-rolling

As

works I am really sure that the password has been changed and the issue is related to the glib regexp issue.

1 Like

Unfortunately i’m not able to give detailed info on Kali as i’m not familiar with that Distro and the upgrading of it. But as it is Debian based you could cross-check via e.g.:

dpkg -l | grep gsad

if the required package version 21.4.4-1kali1 or later is installed.

After the package is installed it might be required that the gsad service is restarted (not sure if the upgrade routine of Kali is doing this on it’s own).

Yes, this package is installed. I restarted gsad. Regarding glib2.0, see below for the installed package. The login still fails. Please advise.

sudo dpkg -l |grep gsad
ii gsad 21.4.4-0kali4 amd64 remote network security auditor - web interface

libglib2.0-0:
Installed: 2.74.4-1
Candidate: 2.74.4-1
Version table:
*** 2.74.4-1 500
500 http://http.kali.org/kali kali-rolling/main amd64 Packages
100 /var/lib/dpkg/status

The version provided here doesn’t match the previously mentioned required version 21.4.4-1kali1 (note the different -0kali4 vs. -1kali4).

To receive advanced support for the Kali related question on how to get the correct / updated package i would suggest to open a topic over at https://forums.kali.org/

I updated kali yet again (did so yesterday), and now the gsad version is updated to 22.4.0-0kali1. However, gvmd will not start with the following log and running gvmd --migrate per below results in the error message below related to pg-gvm modules not installed. pg-gvm is installed per below. How do I migrate the database to start gvmd in order to test the password change?

LOG:
md main:MESSAGE:2023-01-14 04h51.27 utc:2227: Greenbone Vulnerability Manager version 22.4.0~dev1 (DB revision 250)
md manage:MESSAGE:2023-01-14 04h51.27 utc:2228: check_db_versions: database version of database: 242
md manage:MESSAGE:2023-01-14 04h51.27 utc:2228: check_db_versions: database version supported by manager: 250
md main:CRITICAL:2023-01-14 04h51.27 utc:2228: gvmd: database is wrong version

MIGRATE:
sudo -u _gvm gvmd --migrate
md manage-Message: 21:40:22.803: db_extension_available: Extension ‘pg-gvm’ is not available.

(gvmd:2139): md manage-WARNING **: 21:40:22.804: check_db_extensions: A required extension is not available.

(gvmd:2139): md manage-WARNING **: 21:40:22.804: init_manage_create_functions: failed to create functions

PACKAGE:
sudo apt-cache policy pg-gvm
pg-gvm:
Installed: 22.4.0-0kali2
Candidate: 22.4.0-0kali2
Version table:
*** 22.4.0-0kali2 500
500 http://http.kali.org/kali kali-rolling/main amd64 Packages
100 /var/lib/dpkg/status

Unfortunately i’m not familiar with the Kali packages and their state / requirements.

Hope that a community user (the packages are not provided by Greenbone) familiar with Kali is able to give further support.

This is greenbone’s package, per https://github.com/greenbone/pg-gvm.

Why is the error produced using greenbone packages?

You are mixing source distribution and Kali packages, please get your Kali Support from the package builder on this issue.