Linux allows us to log in using a number of secure techniques. On a desktop Linux system, we typically login with a username and password. However, we can use SSH keys to login to a remote server without providing a password. Several cloud services require their users to utilise SSH keys to login, which some users may not desire for a variety of reasons. If your SSH server is not configured to allow passwords, the ssh command to connect to the remote server will fail with the message ‘Permission denied, please try again.’ In this article, I will demonstrate how to configure remote servers to accept passwords for remote login. We can also enable root user login if your cloud provider does not allow it. Before we begin, I’d want to remind you that using an SSH key to login is considered secure. If your cloud provider has blocked remote login via password, it significantly improves the security of your server.
sudo nano /etc/ssh/sshd_config
Press CTRL + W and search for ‘PasswordAuthentication’. To enable this setting, just remove the #.
PasswordAuthentication yes
You should now be able to remotely login using a password in addition to the ssh key. If your cloud provider has also disabled root login, go down to the bottom of the config file or search for ‘PermitRootLogin.’ Remove # from ‘PermitRootLogin yes’ to allow root user to login remotely.sshd config permit root login Now restart SSH daemon for the changes to take effect.
sudo service sshd restart
You can now access your remote server by entering your username and password. It is suggested that the root login be disabled. For added protection, server administrators can create new non-root and less-privileged users.