Code Monkey home page Code Monkey logo

openvpn-account-manager's Introduction

Openvpn User Manager with 2FA

This is a php program to manage openvpn accounts (login/password) with 2FA / TOTP management.

License: GPL-v3+ Copyright: 2018-2020 Benjamin Sonntag for Octopuce

Installation

  • install a php7.2+ with sqlite3 and imagick (on debian use apt install php7.2-cli php7.2-fpm php7.2-sqlite3 php7.2-imagick )
  • point an HTTPS vhost of your webserver into pub/ folder (using apache & mod-php or nginx & fpm)
  • fill config.php if needed (use config.sample.php as a template, the configuration directory MUST be writable by the PHP Unix user)
  • launch composer update at the root of the repository to download the dependencies
  • launch php init.php to initialize an administrator account
  • your interface is now available, use the check.php php script into your openvpn configuration to check a username/password
  • for openvpn conf, see server.conf, server.up.sh and client.conf sample, use easy-rsa to manage your own pki)
  • launch cron-update.php regularly (every 5 minutes minimum recommended) to update the configuration file for OpenVPN (useful for big installations)

easy-rsa setup

apt install easy-rsa
make-cadir /etc/openvpn/pki
cd /etc/openvpn/pki

edit vars :

set_var EASYRSA_KEY_SIZE 3072 set_var EASYRSA_CA_EXPIRE 7200 set_var EASYRSA_CERT_EXPIRE 3650

initialize the CA:

  • ./easyrsa init-pki
  • ./easyrsa build-ca (type a password for your CA, 2 times)
  • ./easyrsa gen-dh
  • ./easyrsa build-client-full client
  • (type a new client password 2 times then the CA password)
  • openssl rsa -in pki/private/client.key -out pki/private/client.unprotected.key
  • (retype previous client password)
  • ./easyrsa build-server-full server
  • (type a new server password 2 times then the CA password)
  • openssl rsa -in pki/private/server.key -out pki/private/server.unprotected.key
  • (retype previous server password)
  • openvpn --genkey --secret /etc/openvpn/pki/ta.key

Now you can fill your openvpn client.ovpn and server.conf configuration files as stated inside them. search for --- or {}

openvpn-account-manager's People

Contributors

vincib avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.