Enable Password Authentication and Disable Public Keys in SSH Print

  • 0

SSH (Secure Shell) is a secure protocol used for remote server access. By default, SSH uses public key authentication. However, there may be cases

where you want to switch to password authentication instead. This tutorial will guide you through the process of disabling public key authentication and

enabling password authentication in SSH.

Step 1: Log into SSH
Connect to your server using SSH:

ssh username@server_ip_address

Step 2: Edit SSH configuration


Open the SSH configuration file:

sudo nano /etc/ssh/sshd_config

Step 3: Modify "PasswordAuthentication"
Find the line "PasswordAuthentication" and change "no" to "yes":

PasswordAuthentication yes

Step 4: Save and exit
Save the file and exit the text editor.

Step 5: Restart SSH service
Restart the SSH service for changes to take effect:

sudo service sshd restart

Step 6: Log in with password authentication
Use SSH to log in with your password:

ssh username@server_ip_address

Conclusion:
By following these steps, you have successfully disabled public key authentication and enabled password authentication in SSH. Remember to use strong passwords to ensure the security of your server.


Was this answer helpful?

« Back

Send Message