Setup a OpenVPN proxy with Pritunl

User privacy is nothing to ISPs these days, we need to stay safe by encrypting our connection.
Firstly, you need a server with big bandwidth. We suggest SysKiller VPS, and you need a domain which you can consider SysKiller Hosting.
Now, get your server and ssh into it.
We recommend Debian or CentOS for the proxy server.
If you are using CentOS, execute these commands:

Show code

sudo tee -a /etc/yum.repos.d/mongodb-org-3.6.repo << EOF
[mongodb-org-3.6]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.6/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.6.asc
EOF
sudo tee -a /etc/yum.repos.d/pritunl.repo << EOF [pritunl] name=Pritunl Repository baseurl=https://repo.pritunl.com/stable/yum/centos/7/ gpgcheck=1 enabled=1 EOF sudo rpm -Uvh https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys 7568D9BB55FF9E5287D586017AE645C0CF8E292A gpg --armor --export 7568D9BB55FF9E5287D586017AE645C0CF8E292A > key.tmp; sudo rpm --import key.tmp; rm -f key.tmp
sudo yum -y install pritunl mongodb-org
sudo systemctl start mongod pritunl
sudo systemctl enable mongod pritunl

[collapse]

For Debian use:
Show code

sudo tee -a /etc/apt/sources.list.d/mongodb-org-3.6.list << EOF deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.6 main EOF sudo tee -a /etc/apt/sources.list.d/pritunl.list << EOF deb http://repo.pritunl.com/stable/apt jessie main EOF sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5 sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 7568D9BB55FF9E5287D586017AE645C0CF8E292A sudo apt-get update sudo apt-get --assume-yes install pritunl mongodb-org sudo systemctl start mongod pritunl sudo systemctl enable mongod pritunl

[collapse]

Now you need to configure your server for proxying.
First, increase open file limit:
Show code

sudo sh -c 'echo "* hard nofile 64000" >> /etc/security/limits.conf'
sudo sh -c 'echo "* soft nofile 64000" >> /etc/security/limits.conf'
sudo sh -c 'echo "root hard nofile 64000" >> /etc/security/limits.conf'
sudo sh -c 'echo "root soft nofile 64000" >> /etc/security/limits.conf'

[collapse]

Now run pritunl setup-key and copy what you see.
Then point your domain to the server's IP and visit your domain.
You will need to confirm the security exception on first visit.
Now configure pritunl as prompted.
When first configured, the login credentials are username pritunl and password pritunl, you must change that.
Now configure the Let's Encrypt domain name as your domain and reload the page.
Now everything is easy, add a user, add an organization containing that user, add a server and attach the organization.
Get the configuration, add it to OpenVPN, and you're ready to rock.

Leave a Reply

Your email address will not be published. Required fields are marked *