The linked manual didn’t really help me and I’ll explain why and describe how I successfully changed the admin user password:
$ gvm-cli socket --xml "<get_version/>"
<get_version_response status="200" status_text="OK"><version>21.4</version></get_version_response>
I found the gvm username on Kali Linux for my install by checking the ownership of the files:
$ ls -lah /var/lib/openvas
total 228K\
drwxr-xr-x 6 _gvm _gvm 4.0K Dec 4 19:22 .
drwxr-xr-x 85 root root 4.0K Nov 17 15:46 ..
drwx------ 2 _gvm _gvm 4.0K Apr 21 2021 .cache
...
But you probably cannot su into _gvm user because the user has been set without a shell profile:
$ sudo su _gvm
This account is currently not available.
$ sudo useradd _gvm
useradd: user '_gvm' already exists
I change the bash profile for the user _gvm:
$ sudo nano /etc/passwd
Change line:
_gvm:x:138:149::/var/lib/openvas:/usr/sbin/nologin
To:
_gvm:x:138:149::/var/lib/openvas:/bin/bash
Now can su to that _gvm user:
$ sudo su _gvm
gvm@kali:~$
gvmd --user=admin --new-password=NewPassword123
No output message from terminal and the new password don’t work so I check the log file:
$ tail /var/log/gvm/gvmd.log
md main:MESSAGE:2021-12-10 20h59.46 utc:8429: Greenbone Vulnerability Manager version 21.4.0 (DB revision 242)
md manage: INFO:2021-12-10 20h59.46 utc:8429: Modifying user password.
md manage:WARNING:2021-12-10 20h59.47 utc:8429: sql_exec_internal: PQexec failed: ERROR: must be owner of aggregate group_concat
(7)
md manage:WARNING:2021-12-10 20h59.47 utc:8429: sql_exec_internal: SQL: DROP AGGREGATE IF EXISTS group_concat (text, text);
md manage:WARNING:2021-12-10 20h59.47 utc:8429: sqlv: sql_exec_internal failed
So, I tried another method all together: use the user postgres:
$ sudo su postgres
$ postgres@kali:/home/kali/Software/gvm-tools$ gvmd --user=admin --new-password=NewPassword123
md main-Message: 20:33:37.883: Greenbone Vulnerability Manager version 21.4.0 (DB revision 242)
(gvmd:6630): md manage-WARNING **: 20:33:37.883: Failed to open lock file '/var/lib/openvas/gvm-checking': Permission denied
(gvmd:6630): md main-CRITICAL **: 20:33:37.883: gvmd: Error trying to get checking lock
But a permission error stopped it so, have to change the permissions of all the files in /var/lib/openvas directory:
$ sudo chmod 777 /var/lib/openvas/*
This is clearly not good but it works and you can change the file permission back afterwards:
$ postgres@kali:/home/kali/Software/gvm-tools$ gvmd --user=admin --new-password=NewPassword123
md main-Message: 20:35:45.858: Greenbone Vulnerability Manager version 21.4.0 (DB revision 242)
$ sudo chmod 664 /var/lib/openvas/*
The terminal output message and now the new password is worked.