Saturday, July 27, 2024
FeaturedSysAdmin

Allow SSH Root Login on Ubuntu 20.04 + Tutorial Video

Hi sobat Kekasi, we already learn How To Activate SSH on Ubuntu before. But access SSH can only using user other than root. In this tutorial, sobat Kekasi will learn Hot To Allow SSH Root Login On Ubuntu. It’s quite easy and simple, and of course i have provided tutorial video to make it easier for sobat Kekasi to learn

Allow SSH Root Login

To do configuration changes, sobat Kekasi need to use root privileges access. Type command:

$ sudo su

To avoid the error edited files, i recommend you to do back up first. Type command:

$  sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config_backup

after back up the file sshd_config , sobat Kekasi need to edit the file sshd_config with using user root. Type command:

$ sudo nano /etc/ssh/sshd_config

change the following lines:

From this:
#PermitRootLogin prohibit-password
To this:
PermitRootLogin yes

The quick way to do this task is only use the command sed as indicated below:

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

Restart SSH service:

$ sudo systemctl restart ssh

By default, root password was not set on Ubuntu 20.04 and the error message Permission denied, please try again will show up while we try to enter SSH as root user.

By this reason, we need to setting the root password. When it asked, enter your current password followed by the new password:

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

So that is How To Allow SSH Root Login on Ubuntu 20.04, it’s quite easy and simple.

Tutorial Video

Watch on Youtube

Leave a Reply