Allowing SSH root login on Ubuntu 20.04 step by step instructions

Linux Help 

Step 1

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

FROM:
#PermitRootLogin prohibit-password
TO:
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

Step 2

Restart SSH service:

$ sudo systemctl restart ssh

Step 3

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 linuxconfig: 
Enter new UNIX password: 
Retype new UNIX password: 
passwd: password updated successfully

Step 4

Given that your Ubuntu 20.04 system allows incoming traffic on port 22/ssh, you should now be ready to SSH login as root:

$ ssh root@ubuntu-server
root@ubuntu-server's password: 
Welcome to Ubuntu Focal Fossa (GNU/Linux 5.3.0-23-generic x86_64)

Recommended Posts

How to Start Using a Web Hosting Account

Starting with a web hosting account is an essential step in launching your online presence. Whether you’re setting up a personal blog, an e-commerce website, or a professional portfolio, a hosting account serves as the foundation. Here’s a comprehensive guide to help you get started: Step 1: Choose the Right Hosting Plan Before diving into […]

Linux Help 

5 Linux commands to check free disk space

Keeping track of disk utilization information is on system administrators’ (and others’) daily to-do list. Linux has a few built-in utilities that help provide that information. Linux df command The df command stands for “disk-free,” and shows available and used disk space on the Linux system. df -h shows disk space in human-readable format df -a shows the file system’s […]

Linux Help