Skip to content

Instantly share code, notes, and snippets.

@josiahcarlson
Created October 29, 2011 01:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josiahcarlson/1323978 to your computer and use it in GitHub Desktop.
Save josiahcarlson/1323978 to your computer and use it in GitHub Desktop.
Create an OpenVPN key and zip it up with encryption for sending to your users.
#!/bin/bash
# Toss me in your /easy-rsa/2.0 path to have a quick and easy way to generat
# a key for a new machine, automatically zipped with encryption into /tmp.
# Requires that you have the below lines uncommented as part of a pre-configured
# client.conf sitting in keys/ .
# cert CHANGEME.crt
# key CHANGEME.key
source ./vars
./build-key $1
cat keys/client.conf | sed s/CHANGEME/$1/g > keys/$1.conf
cd keys
zip -e /tmp/$1.zip $1.* ca.crt
cd ..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment