Can't SSH in as root

The default setting in Debian (and hence Ubuntu) for OpenSSH Server is to deny password-based login for root and allow only key-based login. Change this line in /etc/ssh/sshd_config:

PermitRootLogin without-password

to

PermitRootLogin yes

And restart the SSH server:

sudo service ssh restart

To me, works changing (Ubuntu 18.04):

  • sudo nano /etc/ssh/sshd_config

  • PermitRootLogin prohibit-password to PermitRootLogin yes
  • PasswordAuthentication no to PasswordAuthentication yes

then, restart ssh service:

  • sudo service ssh restart

Thanks!