Skip to content

Instantly share code, notes, and snippets.

@elmariofredo
Forked from padde/openvpn.md
Last active December 26, 2015 18:29
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 elmariofredo/7194935 to your computer and use it in GitHub Desktop.
Save elmariofredo/7194935 to your computer and use it in GitHub Desktop.

OpenVPN

Generate Server Certificates

wget https://github.com/OpenVPN/easy-rsa/archive/master.zip
unzip master.zip
cd easy-rsa-master/easyrsa3
cp vars.example vars

edit variables

cat >> vars << EOF
export KEY_COUNTRY="XX"
export KEY_PROVINCE="YY"
export KEY_CITY="City"
export KEY_ORG="Company"
export KEY_OU="VPN"
export KEY_EMAIL="mail@example.com"
export KEY_CN="vpn.example.com"
EOF

now generate certificates

mkdir keys

source ./vars
./clean-all
./build-ca
./build-key-server server
./build-dh

Generate Client Certificates

source ./vars
./build-key user1

Copy these files to your client over asecure channel (SSH, USB Stick):

ca.crt
user1.crt
user1.key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment