# OpenVPN authenticating against PAM

## mindseyex2

After many stuggles, I managed to get OpenVPN to work properly for my needs.  Today though, I noticed that it can do PAM authentication, and I would like to give that a try.  In my server config, I added the following line:

```

plugin /usr/lib/openvpn/openvpn-auth-pam.so login
```

In my client there is: 

```

auth-user-pass
```

When I try to connect, it requests my password, but the server rejects it, with the following error log:

```

May 10 17:53:18 bobafett openvpn[10310]: 24.xxx.xxx.xxx:2243 Re-using SSL/TLS context

May 10 17:53:18 bobafett openvpn[10310]: 24.xxx.xxx.xxx:2243 LZO compression initialized

May 10 17:53:19 bobafett openvpn[10310]: 24.xxx.xxx.xxx:2243 PLUGIN_CALL: plugin function PLUGIN_AUTH_USER_PASS_VERIFY failed with status 1: /usr/lib/openvpn/openvpn-auth-pam.so

May 10 17:53:19 bobafett openvpn[10310]: 24.xxx.xxx.xxx:2243 TLS Auth Error: Auth Username/Password verification failed for peer

May 10 17:53:19 bobafett openvpn[10310]: 24.xxx.xxx.xxx:2243 [client1] Peer Connection Initiated with 24.xxx.xxx.xxx:2243

```

I know that the user and passwd I am using is correct...

----------

## gsurbey

Yep I just went through the same thing, changing login to system-auth fixed it for me:

```

plugin /usr/lib/openvpn/openvpn-auth-pam.so system-auth
```

----------

## hanj

 *gsurbey wrote:*   

> Yep I just went through the same thing, changing login to system-auth fixed it for me:
> 
> ```
> 
> plugin /usr/lib/openvpn/openvpn-auth-pam.so system-auth
> ...

 

Dude! Thanks for the fix!!! Was struggling with it this morning.

Thanks!

hanji

----------

