When I spin up a VM in the cloud like Vultr or Digital Ocean, I get root access.

On the other hand, in AWS and Azure, I am stuck in a user account. Security and best practices aside, this is an inconsistency from a developer standpoint.

I find that I need to log in with root access over SSH to my Ubuntu systems sometimes, and this is disabled in most cases.

If you need to log in to root over SSH, here’s how:

Edit the file:



Or you can run this one-liner:


Afterwards, make sure to restart the SSH services:


That’s it! You can log in to root via SSH in Ubuntu 16.04 LTS.

Categories: Linux Server