Google Authenticator not working with PAM
Posted: Wed Jun 04, 2014 1:00 am
Hi,
I am trying to use Google Authenticator with PAM (end goal is LDAP/AD) but it always fails with interaction issues between GA and PAM it seems.
GA alone works fine
auth requisite pam_google_authenticator.so
#auth required pam_unix.so use_first_pass
#@include common-auth
PAM alone works fine
#auth requisite pam_google_authenticator.so
#auth required pam_unix.so use_first_pass
@include common-auth
I'm using the following:
Ubuntu 12.04 LTS (AWS version)
openvpn-as-2.0.7-Ubuntu12.amd_64.deb
libpam-google-authenticator-1.0-source
I have installed libpam0g-dev libqrencode3 libpam0g
when I compiled google-authenticator I added the following to Makefile
LDFLAGS="-lpam"
I added the following to as.conf
plugin /usr/lib/openvpn/openvpn-auth-pam.so /etc/pam.d/openvpnas
auth requisite pam_google_authenticator.so forward_pass
auth required pam_unix.so use_first_pass (with or without use_first_pass)
#@include common-auth
I have left the rest of the openvpnas pam file unchanged (I did not comment out the other @)
when I put the right password+PIN (on the WebUI admin)
Jun 4 00:38:03 amsterdam python: pam_unix(openvpnas:auth): authentication failure; logname= uid=0 euid=0 tty= ruser=test-aws rhost=127.0.0.1 user=test-aws
when I put the wrong PIN (on the WebUI admin)
Jun 4 00:40:17 amsterdam openvpnas(pam_google_authenticator)[4553]: Invalid verification code
When I use the openVPN client with "static-challenge "Enter Google Authenticator Code" 1" I get
Jun 4 00:54:16 amsterdam openvpnas(pam_google_authenticator)[4943]: Invalid verification code
When I don't use the verification code box
Jun 4 00:56:10 amsterdam openvpnas(pam_google_authenticator)[4943]: Invalid verification code (auth requisite pam_google_authenticator.so)
Jun 4 00:56:51 amsterdam python: pam_unix(openvpnas:auth): authentication failure; logname= uid=0 euid=0 tty= ruser=test-aws rhost=127.0.0.1 user=test-aws (auth requisite pam_google_authenticator.so forward_pass)
I also get some logs in /var/log/openvpnas.log
2014-06-04 00:58:10+0000 [-] VPN Auth Failed: 'PAM auth failed: Cannot make/remove an entry for the specified session' [None]
2014-06-04 00:58:10+0000 [-] OVPN 1 OUT: 'Wed Jun 4 00:58:10 2014 MANAGEMENT: CMD \'client-deny 0 0 "AS auth failed"\''
2014-06-04 00:58:10+0000 [-] OVPN 1 OUT: 'Wed Jun 4 00:58:10 2014 MULTI: connection rejected: AS auth failed, CLI:[NULL]'
2014-06-04 00:58:12+0000 [-] OVPN 1 OUT: 'Wed Jun 4 00:58:12 2014 203.145.33.70:10225 Delayed exit in 5 seconds'
2014-06-04 00:58:12+0000 [-] OVPN 1 OUT: "Wed Jun 4 00:58:12 2014 203.145.33.70:10225 SENT CONTROL [test-aws]: 'AUTH_FAILED' (status=1)"
I am trying to use Google Authenticator with PAM (end goal is LDAP/AD) but it always fails with interaction issues between GA and PAM it seems.
GA alone works fine
auth requisite pam_google_authenticator.so
#auth required pam_unix.so use_first_pass
#@include common-auth
PAM alone works fine
#auth requisite pam_google_authenticator.so
#auth required pam_unix.so use_first_pass
@include common-auth
I'm using the following:
Ubuntu 12.04 LTS (AWS version)
openvpn-as-2.0.7-Ubuntu12.amd_64.deb
libpam-google-authenticator-1.0-source
I have installed libpam0g-dev libqrencode3 libpam0g
when I compiled google-authenticator I added the following to Makefile
LDFLAGS="-lpam"
I added the following to as.conf
plugin /usr/lib/openvpn/openvpn-auth-pam.so /etc/pam.d/openvpnas
auth requisite pam_google_authenticator.so forward_pass
auth required pam_unix.so use_first_pass (with or without use_first_pass)
#@include common-auth
I have left the rest of the openvpnas pam file unchanged (I did not comment out the other @)
when I put the right password+PIN (on the WebUI admin)
Jun 4 00:38:03 amsterdam python: pam_unix(openvpnas:auth): authentication failure; logname= uid=0 euid=0 tty= ruser=test-aws rhost=127.0.0.1 user=test-aws
when I put the wrong PIN (on the WebUI admin)
Jun 4 00:40:17 amsterdam openvpnas(pam_google_authenticator)[4553]: Invalid verification code
When I use the openVPN client with "static-challenge "Enter Google Authenticator Code" 1" I get
Jun 4 00:54:16 amsterdam openvpnas(pam_google_authenticator)[4943]: Invalid verification code
When I don't use the verification code box
Jun 4 00:56:10 amsterdam openvpnas(pam_google_authenticator)[4943]: Invalid verification code (auth requisite pam_google_authenticator.so)
Jun 4 00:56:51 amsterdam python: pam_unix(openvpnas:auth): authentication failure; logname= uid=0 euid=0 tty= ruser=test-aws rhost=127.0.0.1 user=test-aws (auth requisite pam_google_authenticator.so forward_pass)
I also get some logs in /var/log/openvpnas.log
2014-06-04 00:58:10+0000 [-] VPN Auth Failed: 'PAM auth failed: Cannot make/remove an entry for the specified session' [None]
2014-06-04 00:58:10+0000 [-] OVPN 1 OUT: 'Wed Jun 4 00:58:10 2014 MANAGEMENT: CMD \'client-deny 0 0 "AS auth failed"\''
2014-06-04 00:58:10+0000 [-] OVPN 1 OUT: 'Wed Jun 4 00:58:10 2014 MULTI: connection rejected: AS auth failed, CLI:[NULL]'
2014-06-04 00:58:12+0000 [-] OVPN 1 OUT: 'Wed Jun 4 00:58:12 2014 203.145.33.70:10225 Delayed exit in 5 seconds'
2014-06-04 00:58:12+0000 [-] OVPN 1 OUT: "Wed Jun 4 00:58:12 2014 203.145.33.70:10225 SENT CONTROL [test-aws]: 'AUTH_FAILED' (status=1)"