Linux – no root access on ubuntu vm azure


I just raised ubuntu on an azure vm and try to run some commands from the same console that includes the azure page panel, for example:

sudo apt-get update 

but I get the following error:

bash: sudo: command not found

I don't really have permission to run anything, what could be the problem?

Best Answer

The Cloud Shell UI in the portal is not your VM, this is an admin tool, running in a container that allows you to execute things like Azure CLI in the portal. Sudo is not found there because it is not enabled, you do not have admin access in cloud shell.

To connect to your VM you need to SSH to it using the credentials you setup at the time you created the VM. You should connect to it's public IP using your SSH client of choice and work from there.