⚠️ Do not use this project. It is outdated and archived. Find a propper solution. Consider Wireguard.⚠️
This is a simple and minimalistic Python3 script for User:Password authentication in OpenVPN.
The Users and Passwords are appended manually to a Htaccess formed file. Passwords must be hashed with bcrypt(12).
Upon an incoming Connection, OpenVPN will check the provided credentials with the script and the Htaccess formed file.
- Read Htaccess formed File
- Check Bcrypt hased passwords
- Log events into stdout so they get persisted in the OpenVPN Logs
- Python3
- Bcrypt Library for Python3
sudo yum install python34 python34-pip sudo pip3 install bcrypt sudo dnf install python3 python3-pip sudo pip3 install bcrypt sudo apt-get update sudo apt-get install python3 python3-pip sudo pip3 install bcrypt - Download
auth.pyanduser.datafrom releases - Copy
auth.pyanduser.datain the Folder/etc/openvpn/ - Check file permissions! It should owned by
root,755forauth.pyand644foruser.data
Generate Passwords on http://aspirine.org/htpasswd_en.html , with bcrypt(12)! Append the generated lines to user.data auth-user-pass-verify /etc/openvpn/auth.py via-env script-security 3 auth-user-pass BSD 2-clause "Simplified" License