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:

/etc/ssh/sshd_config

Change

PermitRootLogin prohibit-password

to

PermitRootLogin yes

Or you can run this one-liner:

sudo sed -i 's/prohibit-password/yes/' /etc/ssh/sshd_config

 

Afterwards, make sure to restart the SSH services:

sudo systemctl restart sshd

 

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

Categories: Linux Server

0 Comments

Leave a Reply