Created
April 3, 2016 22:29
-
-
Save christopher-baek/1adaefb71cafecb25e0e0c9306198713 to your computer and use it in GitHub Desktop.
OpenVPN Management Examples
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# do this as root | |
# install open vpn | |
apt-get install openvpn | |
# install easy rsa | |
apt-get install easy-rsa | |
# copy easy-rsa | |
cp -R /usr/share/easy-rsa /etc/openvpn/. | |
# set up | |
cd /etc/openvpn/easy-rsa | |
ln -s openssl-1.0.0.cnf openssl.cnf | |
. ./vars | |
./clean-all |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /etc/openvpn/easy-rsa | |
./build-ca |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /etc/openvpn/easy-rsa | |
./build-key-server ${VPN_NAME} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /etc/openvpn/easy-rsa | |
for CLIENT in ${CLIENTS[@]} | |
do | |
./build-key ${CLIENT} | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /etc/openvpn/easy-rsa | |
./build-dh |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd /etc/openvpn/easy-rsa/keys | |
cp ca.crt ca.key dh2048.pem ${SERVER}.crt ${SERVER}.key /etc/openvpn | |
for CLIENT in ${CLIENTS[@]} | |
do | |
cp ${CLIENT}.crt ${CLIENT}.key /etc/openvpn | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cp /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz /etc/openvpn | |
cd /etc/openvpn | |
gunzip server.conf.gz |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Update this example file: | |
# /usr/share/doc/openvpn/examples/sample-config-flies/client.conf | |
# And send with keys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# revoke | |
cd /etc/openvpn/easy-rsa | |
. ./vars | |
./revoke-full ${CLIENT} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment