0

Hei, The title is self-explaining.

I installed Ubuntu Server 18.04.03 LTS + Canonical Live Patch. I logged it with my username created during installation and run sudo passwd root and changed root account password, but I can not login into my server directly with root account.

Why?

1 Answers1

1

For temporary access, you need to still update the configurations.

In /etc/ssh/sshd_config, there is a line that looks something like this:

#PermitRootLogin prohibit-password

This is the Default which is why it's commented out, meaning you need SSH keys installed/enabled to login to the root account directly.

You can uncomment this and allow root login by changing this to:

PermitRootLogin yes

HOWEVER, this is very dangerous because it allows bots and other attackers to attempt bruteforcing the login. So if you absolutely must have root login, only enable this for a VERY short time, then set the thing back to either...

PermitRootLOgin prohibit-password

... or ...

PermitRootLogin no

... for security reasons.

If you intend to login to root directly in the future, though, then I strongly suggest you go the key authentication route if you intend to login to root directly, or just use sudo for every command you want to run as root on your standard user, rather than changing the security settings.

(I'm an IT Security guy, this suggestion is kind of mandatory from guys like me.)

Thomas Ward
  • 78,878