Skip to content

Instantly share code, notes, and snippets.

@morteza-mori
Created July 3, 2017 07:34
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 morteza-mori/0f52bb356c625ec2a9f451d885dc397a to your computer and use it in GitHub Desktop.
Save morteza-mori/0f52bb356c625ec2a9f451d885dc397a to your computer and use it in GitHub Desktop.
open vpn
OpenVPN Config
apt-get install openvpn easy-rsa
mkdir /etc/openvpn/easy-rsa
cp -rf /usr/share/easy-rsa/* /etc/openvpn/easy-rsa
Edit the vars file in order to create certificates information:
nano /etc/openvpn/easy-rsa/vars
cd /etc/openvpn/easy-rsa
source vars
./clean-all → Cleans everything in keys
./build-ca
./build-key-server MYSERVER-VPN
Client add and configuration:
source ./vars
./build-key CLIENT-NAME
./build-dh
Copy server related files in order to run the server:
cd keys/
cp dh2048.pem ca.crt MYSERVER-VPN.crt MYSERVER-VPN.key /etc/openvpn
Configuring Server:
cp /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz
/etc/openvpn/
gzip -d /etc/openvpn/server.conf.gz
nano server.conf → Edit carefully
Client Config File:
cp /usr/share/doc/openvpn/examples/sample-config-files/client.conf
/etc/openvpn/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment