Jnnngs
Home
About
 Admin
  ~1 minute

Ubuntu SSH Key Only

PasswordAuthentication is set to yes by default, so explicitly commenting it out within /etc/ssh/sshd_config and restarting sshd has no effect.

You must explicitly set "PasswordAuthentication no" to allow only Public Key Authentication.

# To disable tunnelled clear text passwords, change to no here! PasswordAuthentication no PubkeyAuthentication yes

Restart sshd

  • service ssh restart
  • systemctl restart sshd.service.