I am trying to setup 2-phase authentication based on this guide, but instead of entering the password I would like public key to be involved.
If PubkeyAuthentication yes
in /etc/ssh/sshd_conf
then 2 factor authentication phase is not executed (I get the shell) but I want the challenge to be asked. If I set PubkeyAuthentication no
, then the whole authentication cycle is executed (I am asked a password and then the challenge), but I want pubkey to be used instead of password.
How to achieve it?
Similar topic is here.