I suppose you have var $authLib = 'Builtin'; in your config.php.
To add a user, you can use:
username="thomas"
password="password1234"
isAdmin=0
#Uncomment the following if you want the user to have admin rights
#isAdmin=1
vboxmanage setextradata global phpvb/users/${username}/admin ${isAdmin}
vboxmanage setextradata global phpvb/users/${username}/pass $(echo -n ${password} | sha512sum | awk '{print $1}')
To delete a user, you can use :
username="thomas"
vboxmanage setextradata global phpvb/users/${username}/admin
vboxmanage setextradata global phpvb/users/${username}/pass
Note that phpvirtualbox has several authentification modules available (see here). For example, the MySQL authlib could be more appropriate to manage user from command line or bash scripts.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I would like manage users phpvirtualbox with a bash script. Please, tell me if it's possible?
Thank you, good day.
Hi,
I suppose you have
var $authLib = 'Builtin';
in your config.php.To add a user, you can use:
To delete a user, you can use :
Note that phpvirtualbox has several authentification modules available (see here). For example, the MySQL authlib could be more appropriate to manage user from command line or bash scripts.
I forgot to say that the
vboxmanage
command must be run as your virtualbox user, e.g. the user you have configured in config.phpvar $username = XXX;
.Hello, that's all I needed, really thank you it will be useful.