Is there any impact if we enable the root user on an Azure Linux VM?

1

1

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!

Thanks,

Steven

Steven Lee - MSFT

Posted 2016-07-28T06:52:01.337

Reputation: 855

Answers

3

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:

/etc/sudoers

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.

Animesh Patra

Posted 2016-07-28T06:52:01.337

Reputation: 2 188

3

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

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

Mikael Kjær

Posted 2016-07-28T06:52:01.337

Reputation: 1 318