0

I'm running Debian Jessie on a VPS.

I want to enable both private key and Google Authenticator to get into the server via SSH.

I enabled

auth required pam_google_authenticator.so

in both /etc/pam.d/sshd and common-auth

It works when I log in using the "terminal" (using a VNC provided by the VPS provider), but when I ssh in, it just lets me through without prompting me for Google Authenticator.

What else can I do?

1

Make sure your sshd is even using PAM stack (UsePam option in sshd_config).

Then make sure that PAM authentication is required by your configuration (PAM password authentication part is skipped if publickey authentication method succeeds). You can do that by setting appropriate AuthenticationMethods in sshd_config.

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.