Menu

is there a commandline to change the login username & password for the phpvirtualbox

2016-04-17
2016-05-19
  • dov aharonson

    dov aharonson - 2016-04-17

    phpvirtualbox is installed with a default loging user name and password: admin & admin
    Is it possible to use commanline to change it to some other username and password.
    I know we can do it using the gui but I need to do it programatically.

     
  • Ian Moore

    Ian Moore - 2016-05-19

    Yes you can do this using the CLI. Use VBoxManage getextradata and VBoxManage setextradata. E.g. to view the admin password:

    VBoxManage getextradata global phpvb/users/admin/pass

    There is no way to change a key. You'll have to delete it.

    VBoxManage setextradata global phpvb/users/admin/admin
    VBoxManage setextradata global phpvb/users/admin/pass

    Then generate a password for the user using sha512 encryption. On a Mac you can do this with the sha command:

    [ian@laptop : ~]> echo "secret" | shasum -a 512 eaa16b9ced0b5c6ece7aae07cb47c671e8c8f03bfe807f941809477a847337afc5e4335527dee93b083dfcf553042f69583067951ec812149b3fbeb98cb63891 -

    I'm sure Linux has something similar if that's what you're using. Then set the password for your user:

    VBoxManage setextradata global phpvb/users/myuser/pass eaa16b9ced0b5c6ece7aae07cb47c671e8c8f03bfe807f941809477a847337afc5e4335527dee93b083dfcf553042f69583067951ec812149b3fbeb98cb63891

    Set the user as an admin:

    VBoxManage setextradata global phpvb/users/myuser/admin 1

    Let me know if you have any questions.

     
  • klockren

    klockren - 2017-03-13

    Bash always add the newline character, so you'll need to run

    echo -n "secret" | shasum -a 512

    instead.

    Or, run PHP:

    php -r "print hash('sha512','secret');"

     

    Last edit: klockren 2017-03-13

Log in to post a comment.

MongoDB Logo MongoDB