Code Monkey home page Code Monkey logo

vpncrt's Introduction

VPNCRT

Utility for creating a 3 level certificate PKI for OpenVPN.

Central certificates (first level) grants permissions to user certificates (second level) which can grant permission for their devices (third level) to connect to OpenVPN server.

Usage

Create central certificate

./vpncrt create '#CA'

Create Diffie-Hellman parameters file

./vpncrt create '#DH'

Create OpenVPN secret key

openvpn --genkey --secret static.key
./vpncrt import < static.key

Create user certificate

# on user machine:
./vpncrt request username > request.pem

# on CA machine
./vpncrt sign < request.pem
./vpncrt export '#CA' '#TA' username > user-chain.pem

# on user machine
./vpncrt import < user-chain.pem

Create device certificate and OpenVPN client configuration file

  • Generate private key for device on user machine (not good).
# on user machine
./vpncrt create username@device
./vpncrt export username@device:ovpn > myvpn.conf
  • Generate private key for device on that device (good).
# on device
./vpncrt request username@device > request.pem

# on user machine
./vpncrt sign < request.pem
./vpncrt export '#CA' '#TA' username username@device > device-chain.pem

# on device
./vpncrt import < device-chain.pem
./vpncrt export username@device:ovpn > myvpn.conf

Create server certificate and configuration file

User certificate is not required for server. Server certificate is on the second layer

# on server machine
./vpncrt request admin@vpn-server > request.pem

# on CA machine
VPNCRT_SERVER=1 ./vpncrt sign < request.pem
./vpncrt export '#CA' '#TA' admin@vpn-server > server-chain.pem

# on server machine
./vpncrt import < server-chain.pem
# (DH parameters should be created)
./create-server.sh admin@vpn-server > myvpn-server.conf

Revoke certificates

  • Revoke device certificate (can be done by CA or by responsible user)
./vpncrt revoke username@device
  • Revoke user certificate (can be made by CA only)
./vpncrt revoke username
  • Prepare certificate revokation lists. These lists should be merged by CA to single one that will be used by OpenVPN.
./vpncrt make-crl > crl.pem

Print local certificate database status

./vpncrt print

vpncrt's People

Contributors

ktlo avatar

Stargazers

Mark avatar

Watchers

 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.