I create a new Linux VM (CentOS7)on Azure. The root user is disabled by default. So I enable the root user and change the password. I wonder if this will cause any impact on the VM?

Any suggestion is appreciated!




You have to understand the capabilities of the root user and sudo user. Root user has a user id of 0 and unlimited privileges. You can access any file, execute any system call, run any program if you're a root user. This is the reason a root user is call as superuser. Normally su command represents a superuser.

The sudo command(short for superuser do), allows a normal user partial administrative powers. The sudo command let you execute commands with superuser privileges as long as your user id is in the sudoers file, giving you the necessary authorization. The location of sudoers file is:


So sudo vi /etc/xyz will allow you to only modify the xyz file as you're using the file as a superuser.The sudoers file tells who can use the sudo command and what one can do with it.

So the root user is disabled on Azure by default because they do not want a new user modifies some important files accidentally. But if you're confident enough to handle your own problems then there's nothing to worry about. This article explains about root privileges on Linux Virtual Machine in Azure. Here is the link: https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-linux-use-root-privileges/

Thank you.


Not directly, but it's bad practice and a security concern.

Instead you should create a new user and use sudo/su.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.