VirtualBox Ubuntu – How to Set Password for Root

rootsudoUbuntuvirtualbox

I loaded ubuntu into virtualbox. It all works well but it occurred to me that I was not asked (or did not setup) a root password. I want to use root on occasion, but I cannot seem to find out how to do this. I've tried to access the sudoers file as well as run visudo but have no authority without root!

Any ideas how to get or setup root password?

I do have a root user in /etc/passwd.
The two accounts I have do not have authority to even manage groups, because it asks for root password and I don't know it!

Best Answer

Ubuntu uses sudo by default. If you preface your command with "sudo" it prompts for your user password and then runs it as root. To get a root session use:

sudo -i

To enable the root account, open a terminal and run the following to set a root password:

sudo passwd root

For more information see:

https://help.ubuntu.com/community/RootSudo

Related Question