#TIL 12 - Fix the SSH issue with droplet on Digital Ocean

Mar 28, 2021 · Dung Huynh

What

Fix "Permission denied (publickey)" SSH error by enabling password authentication.

Why

New droplets disable password auth. If you lose your SSH key or can't use key-based auth, you're locked out.

How

Edit /etc/ssh/sshd_config:

PermitRootLogin yes
PasswordAuthentication yes

Restart SSH:

sudo service ssh restart