Additional security measures can be enabled by modifying the OpenSSH server configuration file /etc/ssh/sshd_config, on the remote host. Following are the some steps that can be taken to secure the SSH logins:
- Now, since we have configured the SSH key-based authentication in the previous section, we can disable the password authentication to secure SSH logins in the SSH server configuration file. Edit the SSH daemon config file on the remote host running the SSH server and set the PasswordAuthentication directive value to no as shown here:
$ vi /etc/ssh/sshd_configPasswordAuthentication no
- Prohibit direct login as the root user through SSH, as the root user has unrestricted privileges and exists by default ...