Disable password authentication in SSH

SSH is by default configured to allow password login. You can disable password authentication if you're in favour of public key authentication by following these steps;

  1. Set PasswordAuthentication to no in /etc/ssh/sshd_config
    PasswordAuthentication no
  2. Reload or restart SSH

Sign up for Complete Secure Shell Course and many other great courses on Udemy to learn more.

Written by Mohd Shakir Zakaria. Last updated on 2019-02-12