I am going to write sudo su on terminal but I get this error.
sudo: unknown user: root
sudo: unable to initialize policy plugin
I am using Ubuntu 16.04 running on a virtual machine in the Microsoft Azure cloud. I can't login as root.
"By default, the root user is disabled on Linux virtual machines in Azure. ", see more on https://docs.microsoft.com/en-us/azure/virtual-machines/virtual-machines-linux-use-root-privileges
You might be able to use sudo <cmd> one command at a time ... if this doesn't work you will have to contact Microsoft support, I think.
By default, the root user mode is disabled, since root/superuser mode allows anything to be done, even if its malicious. This is also to discourage hackers or automated scripts that try to manipulate the root permissions.
Quoting this article on Microsoft Docs:
By default, the root user is disabled on Linux virtual machines in Azure. Users can run commands with elevated privileges by using the sudo command. However, the experience may vary depending on how the system was provisioned.
SSH key and password OR password only - the virtual machine was provisioned with either a certificate (.CER file) or SSH key as well as a password, or just a user name and password. In this case sudo will prompt for the user's password before executing the command.
SSH key only - the virtual machine was provisioned with a certificate (.cer, .pem, or .pub file) or SSH key, but no password. In this case sudo will not prompt for the user's password before executing the command.
You can visit this page for more information:
An alternative suggestion would be to use sudo -i which will run your user's shell with sudo privileges. Otherwise it may be wise to rely on the sudo timeout, which means you only have to enter your sudo password once within the defined time frame. Also worth noting is that sudo -v should extend the current timeout period by a further 15 minutes if you're already in a sudo session.