Set Root password

After login to Ubuntu 20.04, Now type following command for reset/set root password.

sudo passwd root

Now you need to change some configuration on /etc/ssh/ssh_config for the permit root login.

Configure SSH config to permit root login

Edit /etc/ssh/sshd_config file with following command.

vim /etc/ssh/sshd_config

 

As you see, the PermitRootLogin is set to No. It means that the root login via SSH has been disabled.

So, to enable root login change the No to Yes. Find PermitRootLogin and change no to yes.

Or just add the line to the file:

PermitRootLogin yes

Save the file.

Restart SSH service for loading new configuration on SSH_config file.

sudo systemctl restart sshd

OR

sudo service sshd restart

Now you can check SSH via Root user.