I have a system with Linux Ubuntu 18.04.5 LTS (Bionic Beaver) and one user account (root). I can access the system either with a console or an Ethernet connection. Over a console, I have no problem at all and I just need to type root to log in. However, when I try to access through SSH, the system keeps asking for a password even though the root account is passwordless. I executed the following commands to give root user access without a password but it did not help.
sudo sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
sudo service ssh restart
So I gave the root user a password using passwd
command and now I can access my system through SSH.
Now, I am trying to remove the root password to reset the system to its original state. So I executed passwd -d root
which returned passwd: password expiry information changed.
However, when I try to login again using the console the system asks for both user name and the password of the root account.
I searched on the Internet and it seems just executing passwd -d root
is sufficient to make the password empty. So I created a temporary user account with sudo access. Using this account, I tried to remove the root password, but again it did not work i.e. the system keeps asking for the root password and without it, I cannot log in.