Hostxpeed
Login Get Started →
Security

How to Disable Password Authentication

4 min read
24 views
Jun 12, 2026

Prerequisites

  • SSH key authentication working
  • Sudo privileges

Step 1: Edit SSH Config

sudo nano /etc/ssh/sshd_config

Step 2: Disable Password Auth

PasswordAuthentication no
ChallengeResponseAuthentication no
UsePAM no

Step 3: Restart SSH

sudo systemctl restart sshd

⚠️ Do NOT close your current SSH session until you have verified key login works in a new terminal.

Was this article helpful?