Skip to main content

Disable ssh password login

Add a sshd config file with the following content

sudo nano /etc/ssh/sshd_config.d/99-ts.conf
ChallengeResponseAuthentication no
PasswordAuthentication no
UsePAM no

Reload the SSH daemon

sudo systemctl reload ssh

WARNING!
Now you are no longer able to create new session to that server!
Remember to add your ssh certificate before closing the session!