I'm trying to setup 2 Factor Authentication. I want to login via 2 methods:

  1. Public Key > YubiKey
  2. Password > YubiKey

And now I have this done, but I want to specify what users can login via password (like Match User ... PasswordAuthentication yes). If user is not in that list, he can login only via PubKey and Yubikey. How can I do that?

This is my sshd_config
This is my common-auth PAM file


Ok, I've already known, how to do that. Just write in Match User something like this:

Match User OnlyPassword
    AuthenticationMethods keyboard-interactive:pam

and in default values only:

AuthenticationMethods publickey,keyboard-interactive:pam

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.