Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenVPN authentication requiring Unix account #183

Open
syutbai opened this issue Jan 31, 2019 · 2 comments
Open

OpenVPN authentication requiring Unix account #183

syutbai opened this issue Jan 31, 2019 · 2 comments

Comments

@syutbai
Copy link

syutbai commented Jan 31, 2019

Hi,

We ran into this issue after we upgraded our OpenVPN sever OS to Ubuntu 18.04. The OpenVPN client kept reporting "Wrong credentials" even though the credentials were correct and the OTP process succeeded.

We saw in the pam_yubico.log that the process completed successfully; however, OpenVPN reported the following indicating the plugin failed:

AUTH-PAM: BACKGROUND: user 'pek' failed to authenticate: Authentication service cannot retrieve authentication info

PLUGIN_CALL: POST /usr/lib/x86_64-linux-gnu/openvpn/plugins/openvpn-plugin-auth-pam.so/PLUGIN_AUTH_USER_PASS_VERIFY status=1

The root cause turned out to be the /etc/pam.d/openvpn file did not have the "account" section, so the default was being used from /etc/pam.d/common-account (which requires Unix login). We added the account line in the /etc/pam.d/openvpn file and it works now:

account required  pam_yubico.so

When troubleshooting the PAM configuration, I tried to use the following documentation but just got more confused by it: https://developers.yubico.com/yubico-pam/YubiKey_and_OpenVPN_via_PAM.html .

Cheers,
syutbai

@kbabioch
Copy link
Contributor

kbabioch commented Feb 8, 2019

Not sure if I understand this issue correctly, but what do you want us to do here? Is it about updating the documentation, or should something else be changed? Configuration of the PAM stack can be somewhat tedious, but the general approach is outline in the documentation. The specifics will be different for each distribution (and version thereof) and I don't think that Yubico is willing/able to provide very specific instructions for each distribution and keep it up to date.

@syutbai
Copy link
Author

syutbai commented Feb 8, 2019

Hi,

First, I must amend my previous comment about 18.04 upgrade since the system stopped working around the same time as the upgrade, I conflated the two events together; but, in reality, there's not likely a cause-effect relationship. I double-checked Ubuntu 16.04 configuration and it looks like /etc/pam.d/common-account is the same as 18.04.

I also double-checked my configs, and as documented in #174 (comment), I had at one point used the account configuration for testing. It was removed later at some point - I don't remember when, but I do remember why: For simplicity, if the PAM configuration works for auth, without account, then I simply do not include account. I had forgotten that I created a unix account for iniital testing the configs and that's how the unix user worked (but worked for it only).

For simplicity, we wanted a minimal PAM configuration. Our server's scope is just OpenVPN authentication via LDAP and Yubikey OTP. For a minimal PAM config, would you agree it be appropriate to recommend the following:

auth    required     pam_yubico.so <parameters: ie, id=2...>
account required pam_yubico.so

If possible, we would like to help improve the docs for the benefit of the community. I opened this ticket primarily because I found it to be the best place to document our findings (and possibly be helpful for someone else).

Cheers,
syutbai

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants