How can I change username "admin"?

Hello Guys,

I would like to change username "admin " to “yoyofamily”. How can I do?

I googled how to reset the admin password and the results showed using this:
gvmd --user=admin --new-password=new_password
But did not find any information for change username, could someone help me?

Many Thanks.

============more information===================
gsad --version
Greenbone Security Assistant 8.0.0
Copyright © 2010-2016 Greenbone Networks GmbH
License GPLv2+: GNU GPL version 2 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

openvassd --version
OpenVAS Scanner 6.0.0
Most new code since 2005: © 2018 Greenbone Networks GmbH
Nessus origin: © 2004 Renaud Deraison deraison@nessus.org
License GPLv2: GNU GPL version 2
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

openvas-nasl --version --debug-tls=1
openvas-nasl 10.0.0
gnutls 3.3.29
libssh 0.7.1/openssl/zlib
gpgme 1.12.0
Copyright © 2002 - 2004 Tenable Network Security
Copyright © 2013 Greenbone Networks GmbH

Environment

**Operating system:CentOS7
**Kernel:3.10.0-1062.4.1.el7.x86_64 #1 SMP Fri Oct 18 17:15:30 UTC 2019 x86_64 GNC/Linux

You need to first create a new user with admin privileges:

gvmd --create-user=yoyofamily --password=pwd --role=Admin

Then inherit tasks from user admin:
gvmd --inheritor=yoyofamily

Then you can delete admin user:
gvmd --delete-user=admin

5 Likes

HI Tatooin,

Many thanks. I can create a new user by your command as 2 below, but it is missing the original tasks and Hosts. Would you have any idea about that?

You need to first create a new user with admin privileges:
gvmd --create-user=yoyofamily --password=pwd --role=Admin
Then inherit tasks from user admin:
gvmd --inheritor=yoyofamily

–inheritor= USERNAME

Have USERNAME inherit from deleted user.

If you delete user admin, tasks belonging to admin will automatically be assigned to the username assigned with --inheritor.

2 Likes

Hi tatooin,

I try to type gvmd --delete-user=admin and will show “Resources owned by the user are still in use by others”.Would you have any advice about that?

P.S: I have stopped service: openvas-scanner, openvas-manager, gvmd.service, gsad…etc.

Hi Owem

My bad, you must use inheritor with --delete-user. I just tried and it worked. Eg;

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

3 Likes

Hi tatooin,

Thank you so much. It worked and this problem is solved.