I have used differen approached, although in production plugin /usr/lib64/openvpn/plugin/lib/openvpn-auth-pam.so login is recommended way, but I have taken one shell script and got authentication, but remember it is dangerous.

add following lines in your /etc/openvpn/server.conf file

--verify-cline-cert none script-security 2 auth-user-pass-verify /etc/openvpn/example.sh via-file

Now create a file in /etc/openvpn/example.sh with following content

!/bin/bash echo "started" username=`head -1 $1` password=`tail -1 $1` if grep "$username:$password" $0.passwd > /dev/null 2>&1 then exit 0 else if grep "$username" $0.passwd > /dev/null 2>&1 then echo "auth-user-pass-verify: Wrong password entered for user '$username'" else echo "auth-user-pass-verify: Unknown user '$username'" fi exit 1 fi

Now create username and password in /etc/openvpn/example.sh.passwd with following content

userone:securepassworduserone usertwo:securepasswordusertwo

Now create a client file and import and connect using your password, but this where I am stack as I don't want to provide client file.