Installed Ubuntu Server LTS 14.04 from Azure library on Azure VM. Logged in as standard "azureuser" created by Azure with my password. Changed root password:
sudo passwd root
If I try to login as "root":
Access denied
What do I miss? And yes, the password is correct.
by default, Ubuntu disables the root account. Since root is godmode, disabling it means that all of the hackers with automated scripts that try to break the root account are wasting their time.
I highly recommend against this. (There are many reasons, here are some: https://askubuntu.com/questions/16178/why-is-it-bad-to-login-as-root) However, the steps to do so are Over on askubuntu.com
According to that page, to unlock the root account you must execute
sudo passwd -u root
. To relock the root account, usesudo passwd -l root
To reiterate: this is kinda a bad idea. A better solution would be to create a new user that has unlimited permissions ONLY WITHIN THE SCOPE OF WHAT YOU REQUIRE. Root is godmode; if you screw something up too bad for you. An elevated user for your scope, on the other hand, would only be able to destroy what it has access to...not your entire system.
I wasn't able to get any of the other answers to work for me, but this answer worked for my case.
For those too lazy to click the link:
Just run
sudo -s
, you will get the root terminal.It's an old post but it happens sometimes. Here is what I solved after research.
sample log
For macOS user, here is simple steps. (at least you need node installed)
or asm, depends on your VM
change mode if no VM listed
copy sudoers file from other machine to /tmp/sudoers.default of you target machine
backup sudoers
copy default sudoers to /etc/sudoers
It's easier just to do
sudo <command>
. Then you don't have the full terminal for the super user. This will just execute the command with root privileges. See this article.To enter into a Azure VM using SSH...
First, You need to enable the root account:
Then you need to enable the root login for ssh editing the file /etc/ssh/sshd_config (the default value in Azure VMs is PermitRootLogin without-password, so you need to change/comment it):
Finally, you need to reload/restart the ssh service: