1- #OpenVPN-Auth-Python-Htaccess
1+ # OpenVPN-Auth-Python-Htaccess
22
3- This is a Python script for
3+ This is a simple and minimalistic Python3 script for User : Password authentication in OpenVPN.
44
5- ###Features
5+ The Users and Passwords are appended manually to a Htaccess formed file.
6+ Passwords must be hashed with bcrypt(12).
7+
8+ Upon an incoming Connection, OpenVPN will check the provided credentials with the script and the Htaccess formed file.
9+
10+ ### Features
611
712- Read Htaccess formed File
813- Check Bcrypt hased passwords
9- - Log events into a Logfile
14+ - Log events into stdout so they get persisted in the OpenVPN Logs
15+
16+ ### Install dependencies
1017
11- ###Install dependencies
1218- Python3
1319- Bcrypt Library for Python3
1420
15- ######CentOS
21+ ###### CentOS
1622 sudo yum install python34 python34-pip
17- ######Fedora
23+ sudo pip3 install bcrypt
24+ ###### Fedora
1825 sudo dnf install python3 python3-pip
19- ######Ubuntu/Debian Based
26+ sudo pip3 install bcrypt
27+ ###### Ubuntu/Debian Based
2028 sudo apt-get update
2129 sudo apt-get install python3 python3-pip
22-
23- ###### Python Packages
2430 sudo pip3 install bcrypt
2531
2632### Installation
2733
28- Copy auth.py and user.data in the Folder /etc/openvpn/.
34+ 1 . Copy ` auth.py ` and ` user.data ` in the Folder ` /etc/openvpn/ `
35+ 2 . Check file permissions! It should owned by ` root ` , ` 755 ` for ` auth.py ` and ` 644 ` for ` user.data `
2936
3037### Configuration
3138###### Add Users and Passwords
@@ -35,9 +42,11 @@ Copy auth.py and user.data in the Folder /etc/openvpn/.
3542###### Add this to you OpenVPN Server Config:
3643
3744 auth-user-pass-verify /etc/openvpn/auth.py via-env
38- script-security 3 system
45+ script-security 3
3946
4047###### Add this to you OpenVPN Client Config:
4148 auth-user-pass
42- ###### Optional: Adapt Logging Filepath, Change following line in auth.py
43- logFilePath = '/var/log/myvpn/OpenVPN-Auth.log'
49+
50+ # License
51+
52+ BSD 2-clause "Simplified" License
0 commit comments