Disable YubiKey ssh authentication for my server
I've followed the instructions for enabling YubiKey authentication over ssh in your article How to use a YubiKey for Two-Factor Secure Shell Authentication.
How do I disable this and use public key authentication instead?
1 Reply
To disable YubiKey authentication over ssh, you can modify your ssh configuration file by running the command: sudo nano /etc/ssh/sshd_config
Once editing this file, simply change ChallengeResponseAuthentication to no and PubkeyAuthentication to yes. These will likely be in different places within the file:
PubkeyAuthentication yes
...
ChallengeResponseAuthentication no
After making the changes, restart ssh: sudo systemctl restart sshd
. You can now exit the session and try to reconnect.
If you’re currently unable to connect through ssh because you aren't able to authenticate with your YubiKey, you can use our LISH Console to login to your server and make the changes discussed above. You can learn more about LISH by reading our guide Using the Linode Shell (Lish)