How to Disable SSH Password Authentication?
SSH is a protocol that enables secure communication and access to a remote server. Using a password to log into the system via SSH can pose a security risk. To enhance server security, you can disable SSH password authentication and use only keys.
To disable password authentication, you need to make changes to the SSH configuration file. First, connect to the server via SSH using a password. Then, open the /etc/ssh/sshd_config file with a text editor.
Find the PasswordAuthentication line in the sshd_config file and change its value to no:
PasswordAuthentication no
Save the changes and restart the SSH service for them to take effect:
sudo systemctl restart sshd
Now, access to the server can only be obtained via a key, which provides a high level of security. Remember to configure key-based access beforehand and ensure that you have access to the server using a key.
Disabling SSH password authentication is one of the steps to strengthen server security. Configure servers correctly and remember to update software to ensure safe operation.