Greenbone Security Assistant 20.08.1 Admin password reset

GVM versions

gsad: (‘gsad --version’) 20.08.1
gvmd: (‘gvmd --version’) 20.08.1

Environment

Operating system: Ubuntu 20.04 LTS
Kernel: (‘uname -a’) 5.4.0-66-generic
Installation method / source: Thirdparty package

I am unable to change the default “admin” password which is currently admin. I tried the following commands but nothing worked:

sudo runuser -u gvm – gvmd --create-user=admin --new-password=“newpasswordhere”

sudo gvmd --user=admin --new-password=“newpasswordhere”

gvmd --user=admin --new-password=“newpasswordhere”

what am I missing? How can I change the default admin user password?

Thank you for your help

Hi @mstjohn,
I have just checked with
gvmd --user=admin --new-password=newpassword

in the gvmd log file I can see
md manage: INFO:2021-03-04 10h59.05 utc:29623: Modifying user password.

Are you using quotations to set the password? Maybe some char not allowed?

2 Likes

I entered the following command as root:

gvmd --user=admin --new-password=MyNewPassword2021

and I see this in the log:

md main:MESSAGE:2021-03-04 18h27.09 utc:52551: Greenbone Vulnerability Manager version 20.08.1 (DB revision 233)
md manage: INFO:2021-03-04 18h27.09 utc:52551: Modifying user password.
md manage:WARNING:2021-03-04 18h27.09 utc:52551: sql_open: PQconnectPoll failed
md manage:WARNING:2021-03-04 18h27.09 utc:52551: sql_open: PQerrorMessage (conn): FATAL: role “root” does not exist
md manage:WARNING:2021-03-04 18h27.09 utc:52551: init_manage_process: sql_open failed

You need to run the command as the user which has been used / configured for the database connection of the gvmd daemon. The user depends on your environment / installation guide you have followed, please have a look at the thirdparty package manual for possible more information on the user.

2 Likes

Maybe you want to take a look at the DB section in the install file if you still didn’t solve the issue.

2 Likes

I was able to change it simply using gvmd --user=‘user’ --new-password=‘password’

This issue for me was using double quotes or no quotes at all. Had to use single quotes around the user and password

2 Likes

Thanks for this, you saved me a lot of time. It works with GVM 21.4

sudo -u _gvm gvmd --user=‘user’ --new-password=‘newpassword’

3 Likes

@rippledj

you can use command without modifying pw file

su - _gvm -s /bin/bash

Eero

@redray chmod 777 is very bad advise :see_no_evil::woman_facepalming:t2:

Eero

3 Likes

Just some background info on the previous posting:

Setting a folder to 777 (meaning world-writable for all users/services of the system) is usually a bad idea from security perspective. Please use a correct owner (e.g. on systems there is a gvm user) instead.

2 Likes

@cfi Giving 777 to /var/lib is insane. That bad post should be deleted.

:smiling_face_with_tear:

Eero

1 Like

You can use the “flag” function of the forums to flag that post for deletion by the moderation team.

@rippledj this post is totally wrong and contais even dangerous commands to system security. please delete it :face_holding_back_tears:

Eero

1 Like