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 sshd WARNING! Now you are no longer able to create new session to that server! Remember to add your ssh certificate before closing the session!