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
cfi
March 5, 2021, 12:35pm
4
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
Sw1tch
March 29, 2022, 10:38pm
7
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
redray
April 17, 2022, 2:36pm
8
rippledj:
sudo chmod 777 /var/lib
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
Eero
June 21, 2022, 5:21pm
10
@rippledj
you can use command without modifying pw file
su - _gvm -s /bin/bash
Eero
Eero
June 21, 2022, 5:23pm
11
@redray chmod 777 is very bad advise
Eero
3 Likes
cfi
June 24, 2022, 6:33am
12
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
Eero
June 24, 2022, 8:38am
13
@cfi Giving 777 to /var/lib is insane. That bad post should be deleted.
Eero
1 Like
cfi
June 24, 2022, 8:57am
14
You can use the “flag” function of the forums to flag that post for deletion by the moderation team.
Eero
June 24, 2022, 10:36am
15
@rippledj this post is totally wrong and contais even dangerous commands to system security. please delete it
Eero
1 Like