Username and Password Manager for OpenVPN
A simple SQLite-backed username and password manager and challenge verificator for auth-user-pass
OpenVPN.
- Linux/Unix-based server
- OpenVPN Server with
auth-user-pass
set - Python 3.6+
This script is designed without extra packages required, so a standard Python 3.6+ installation should be able to run this script.
-
Clone this repository.
$ git clone https://github.com/miguelforsetti/upmov
-
Install
python3
, either from your distro's repository or compiling it manually.$ yum install python36
-
chmod
required scripts.$ cd upmov $ chmod a+x upmov.py verify-auth.py
-
Initialize upmov data directory
$ ./upmov.py initialize
Note: if you encounter this error:
Cannot create data directory for upmov.py
create upmov data directory on your own and assign permissions to it, then re-initialize upmov data directory again.
$ mkdir -p /var/lib/upmov $ chown $USER /var/lib/upmov $ chmod 755 /var/lib/upmov $ ./upmov.py initialize
-
Start adding your users
$ ./upmov.py register --user user1 $ ./upmov.py register --user user2
-
To get more information about this script, run it with
--help
.$ ./upmov.py --help
-
Enable OpenVPN Password authentication in OpenVPN server configuration.
# in server.conf ... auth-user-pass-verify /path/to/upmov/verify-auth.py via-file script-security 2 username-as-common-name # note that client-cert-not-required is deprecated in OpenVPN 2.4 and will be removed in 2.5 client-cert-not-required verify-client-cert none ...
/path/to/upmov/verify-auth.py
obviously points to the location ofverify-auth.py
in upmov directory. -
Make sure you already have registered users in your upmov database.
-
Restart your OpenVPN server.
$ sudo systemctl [email protected] restart
-
Try to login from your client with username and password.
- This script uses SQLite as database backend, therefore it'll suffer some problems with scalability and maybe performance.
- If you're using
user
andgroup
options, make sureuser
andgroup
option values had sufficient permissions to access both data directory (default/var/lib/upmov
, seecommon.DATA_DIR
) and data file (default/var/lib/upmov/auth.db
, seecommon.DB_FILE
) - Always check if your distro already has user dedicated to run OpenVPN services. Previous caveat point also applies here.
upmov is licensed under the terms of the Apache license version 2.0. Full text of the license can be read under LICENSE file in project root directory.
All trademarks, copyrights, product names and logos mentioned are property of their respective owners. All rights reserved.
- OpenVPN - Using Alternative Authentication Methods
- OpenVPN - Reference manual for OpenVPN 2.4 see
auth-user-pass
,auth-user-pass-verify
,username-as-common-name
,client-cert-not-required
, andverify-client-cert