I'm running openvpn 2.4.0 on Debian Stretch. Ultimately I want to authenticate against Active Directory using Kerberos, but as that wasn't working, I disabled pam_krb5 and I'm just attempting to authenticate with a local user.
AUTH-PAM: BACKGROUND: user 'john' failed to authenticate: System error
10.21.43.233:50183 PLUGIN_CALL: POST /usr/lib/openvpn/openvpn-plugin-auth-pam.so/PLUGIN_AUTH_USER_PASS_VERIFY status=1
10.21.43.233:50183 PLUGIN_CALL: plugin function PLUGIN_AUTH_USER_PASS_VERIFY failed with status 1: /usr/lib/openvpn/openvpn-plugin-auth-pam.so
10.21.43.233:50183 TLS Auth Error: Auth Username/Password verification failed for peer
# saslauthd -d -a pam -m /var/run/saslauthd &
# testsaslauthd -u john -p ******** -s openvpn
saslauthd[3357] :released accept lock
saslauthd[3367] :acquired accept lock
saslauthd[3357] :auth success: [user=john] [service=openvpn] [realm=] [mech=pam]
saslauthd[3357] :response: OK
0: OK "Success."
It seems that the 'Operation not permitted' error is then being reported by openvpn as a 'System error', but I don't know what I can do next to debug this any further.
It's always good to make sure! I did restart it and to make sure I ran 'ps' to check that it was now running under root, which it was.
This morning, I ran openvpn manually under strace to try and shed more light on where it was going wrong, and lo and behold it worked! It turns out that the Debian systemd configuration is too restrictive. It has:
By doing a binary chop on the full set of capabilities, I've been able to determine that CAP_AUDIT_WRITE is missing. Adding this enables openvpn to work. I'll file a bug with Debian.
This issue is that Debian and Openvpn both ship systemd unit definitions, and in fact there is a bug to that effect: https://bugs.debian.org/cgi-bin/bugrepo ... bug=866523. I was using the Openvpn one, but the Debian one does include the necessary additional capability.
Thanks for a great debugging! Yes, it is quite likely CAP_AUDIT_WRITE is lacking. I will look into that.
Please file this issue in the OpenVPN Trac instance, we try to ensure all distributions ship our openvpn-server@.service and openvpn-client@.service unit files unmodified. This is to ensure the behaviour is identical across all Linux systemd based distributions - something which is far more easy with systemd unit files than earlier. And feel free to assign it to me.
Sorry for necro posting but I think I don't have permissions to open a new topic, and my problem is very similar to this.
I've a VPN server with Debian 11 and OpenVPN where PAM authentication works only if I start OpenVPN server manually from root account. If I leave it start automatically from system services (I think is systemd this way) the VPN server starts but authentication from client always fails. The client behavior in this case is weird, it doesn't say authentication failed or wrong password or other, but it continues to write a message about "timeout" or "waiting" (I don't remember, I've to check again) but anyway it doesn't bring VPN up.
I already checked the systemd configuration and CAP_AUDIT_WRITE is already there.
What else could it be the problem?
Thank you
PS: in these days I've problems with openvpn forum; ofwn it gave "too many connections to database" error; does it happen to everybody?