Skip to content

Instantly share code, notes, and snippets.

@jnyryan
Last active December 19, 2015 11:59
Show Gist options
  • Select an option

  • Save jnyryan/5951807 to your computer and use it in GitHub Desktop.

Select an option

Save jnyryan/5951807 to your computer and use it in GitHub Desktop.
Set up the basics for OpenVPN on an Ubuntu 12.04 desktop.
#!/bin/sh
###################################################
# Install OpenVPN
###################################################
sudo apt-get install -y openvpn bridge-utils network-manager-openvpn
# This allows you to import settings into network-manager
# http://askubuntu.com/questions/187511/how-can-i-use-a-ovpn-file-with-network-manager
sudo apt-get install network-manager-openvpn-gnome
###################################################
# Set up the certs for Open VPN
###################################################
echo "Cleanup"
sudo rm -rf /etc/openvpn/certs
sudo rm -rf /etc/openvpn/keys
sudo rm -rf /etc/openvpn/*
echo "Creating Folders"
sudo mkdir -p /etc/openvpn/certs
sudo mkdir -p /etc/openvpn/keys
# Download and extract you keys and certs
echo "Copying certs and keys"
sudo cp ./*.crt /etc/openvpn/certs
sudo cp ./*.key /etc/openvpn/keys
sudo cp ./FullyRouted-UK.opvn /etc/openvpn/FullyRouted-UK.config
echo "Setting permissions"
sudo chmod 644 /etc/openvpn/certs/*.crt
sudo chmod 644 /etc/openvpn/keys/*.key
sudo chmod 644 /etc/openvpn/*.config
ls -l /etc/openvpn/certs
ls -l /etc/openvpn/keys
ls -l /etc/openvpn
echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment