Skip to main content

Activating Root Login on Ubuntu 20.10

Victoria Harbour, Hong Kong

Edit the SSHD Configuration​

Open the /etc/ssh/sshd_config file with administrative privileges and change the following line:

#PermitRootLogin prohibit-password
PermitRootLogin yes

The quick way to do this job could be just to simply use the sed command as shown below:

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

Restart SSH Service​

sudo systemctl restart ssh

Activate the Root User​

By default the root's password is not set on Ubuntu 20.04 and the error message Permission denied, please try again will appear when attempting to SSH login as a root user. From this reason we need to set root's password. When prompted enter your current user password followed by new root password:

sudo passwd
[sudo] password for mylinuxuser:
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully