How to disable password authentication?

QuestionsQuestions8 SkillsProBrute Force SSH in HydraNov, 25 2025
068

To disable password authentication for SSH, you can modify the SSH server configuration file. Here’s how to do it:

  1. Open the SSH configuration file with a text editor (using sudo for superuser privileges):

    sudo nano /etc/ssh/sshd_config
  2. Find the line that says:

    PasswordAuthentication yes

    If it doesn't exist, you can add it.

  3. Change it to:

    PasswordAuthentication no
  4. Save the changes and exit the editor.

  5. Restart the SSH service to apply the changes:

    sudo systemctl restart sshd

This will disable password authentication, requiring users to use key-based authentication instead. If you have any further questions, feel free to ask!

0 Comments

no data
Be the first to share your comment!