After trying all possible GVM command to get access to GUI after setup I found the only way how it worked for me.
I have to change password directly on DB. Here are steps. And I tried to run this wihtout stopping service and it worked anyway.
I;'m assuming that you know KALI terminal. You need 2 of them one for SQL and another for other things including HASH generation
Directly Resetting the Admin Password in PostgreSQL
Stop the GVM services:
shsudo systemctl stop gvmd sudo systemctl stop ospd-openvasAccess the PostgreSQL database: You need to access the
gvmddatabase. The default user is usuallypostgres. Use the following command to access the PostgreSQL command line:shsudo -u postgres psql gvmdList the users in the gvmd database:
sqlSELECT name FROM users;This will list all users. Identify the admin user.
Reset the password: Replace
admin_usernamewith the actual username of your admin account, andnewpasswordwith your desired password. Note that the password needs to be hashed.Generate a new password hash using
gvmdcommand:sudo gvmd --user=admin_username --new-password=newpasswordThis should display a hash. If this does not work, you can generate the password hash using Python:
pythonpython3 -c "import crypt; print(crypt.crypt('newpassword', crypt.mksalt(crypt.METHOD_SHA512)))"Update the user's password in the PostgreSQL database:
sqlUPDATE users SET password='hashed_password' WHERE name='admin_username';Exit the PostgreSQL command line:
sql\qStart the GVM services again:
shsudo systemctl start ospd-openvas sudo systemctl start gvmdVerify the Password Reset: Try logging into the GVM web interface with the new password to ensure the reset was successful.
No comments:
Post a Comment