Initial User admin

Environment: kali Linux

The gvm-setup script configures an initial user “admin” with a random password. This user can be used to log in via the web interface.
I did so and created another user with the role Admin.
After this the list of users does not show the user admin anymore.
running gvmd --get-users, the user admin is not shown neither, the newly created user neither.
the login with user admin is still possible, but it cannot be removed, disables nor can the password be changed.
Do you know what went wrong?

You need to look at the gvmd.log file for errors. I suspect your database setup broke in some way.

1 Like

Shouldn’t the commad be as follows?
sudo runuser -u _gvm -- gvmd --get-users --verbose

1 Like

Sorry changed the original post to
gvmd instead of cvmd
sorry that was a typo

sudo -u _gvm gvmd --get-users

did the trick
I was already on the way to this as the command run as root lead into a log entry:

gvmd: Main process is already running
Greenbone Vulnerability Manager version 20.08.1 (DB revision 233)
Getting users.
sql_open: PQconnectPoll failed
sql_open: PQerrorMessage (conn): FATAL: role “root” does not exist
init_manage_process: sql_open failed

Thought that the user account could be the problem.

Now as I was in the correct context, I see the correct list of two user, including the “admin” user of the original post.
It is shown in the console, but not in the web interface, there it disappeared after introduction of the new user with the role “Admin”.
“admin” is able to log in but not shown

1 Like

I’m a bit confused on what could be missing now (you need to safely delete the old admin?), but you may want to give a look at this one, always executing with sudo -u _gvm before

gvmd –delete-user=admin --inheritor=NEWUSER

1 Like

Thnx a lot for all the explanations.
The original idea is to delete the default user as written in our policy.
Plan B is to change the password from the initial one to a new one.
I failed to do the changes in the web interface, that’s why I tried it on console, but failed again, as I was not aware of the user context. My fault, was obvious.
But one inconsistancy still remains: Why does “admin” disappear from the user list after introducing a new user with the role “Admin” on the web interface?

It should still be visible via sudo -u _gvm gvmd --get-users. But at the web interface only the creating admin user can see the new admin user. Not the other way around.