Howto: Painless OpenVPN setup on Cloud/VPS servers

in #howto7 years ago (edited)

SSH


is pretty cool for managing remote servers, but with OpenVPN you can have connections to your remote servers that function much like a local area network connection. Most people pay providers for this, but if you have a cloud or VPS or other type of rented server, you can use OpenVPN to make connecting to it much simpler.

Setting it up manually is incredibly complicated, so after trying twice to follow some insctructions, I found a script that does all that legwork for you:

https://www.cyberciti.biz/faq/howto-setup-openvpn-server-on-ubuntu-linux-14-04-or-16-04-lts/

The last step is to import the necessary files to the client machine it generates during the script, which you can find a good guide here: here, and basically you need to copy these files:

/etc/openvpn/ca.crt
/etc/openvpn/ta.key
/etc/openvpn/easy-rsa/keys/hostname.crt (Where hostname is the hostname of the client).
/etc/openvpn/easy-rsa/keys/hostname.key (Where hostname is the hostname of the client).

to your client machine's /etc/openvpn/ folder. (There is a procedure for windows also using an .ovpn file but I will not cover that since this is mostly for the information of existing and aspiring witnesses and application developers).

The last two you might find difficult to spot because they could end up slightly different places, here is the tree of mine:

/etc/openvpn
├── ca.crt
├── ca.key
├── client-common.txt
├── crl.pem
├── dh.pem
├── easy-rsa
│   ├── ChangeLog
│   ├── COPYING
│   ├── doc
│   │   ├── EasyRSA-Advanced.md
│   │   ├── EasyRSA-Readme.md
│   │   ├── EasyRSA-Upgrade-Notes.md
│   │   ├── Hacking.md
│   │   └── Intro-To-PKI.md
│   ├── easyrsa
│   ├── gpl-2.0.txt
│   ├── openssl-1.0.cnf
│   ├── pki
│   │   ├── ca.crt
│   │   ├── certs_by_serial
│   │   │   ├── 01.pem
│   │   │   └── 02.pem
│   │   ├── crl.pem
│   │   ├── dh.pem
│   │   ├── index.txt
│   │   ├── index.txt.attr
│   │   ├── index.txt.attr.old
│   │   ├── index.txt.old
│   │   ├── issued
│   │   │   ├── loki.crt
│   │   │   └── server.crt
│   │   ├── private
│   │   │   ├── ca.key
│   │   │   ├── loki.key
│   │   │   └── server.key
│   │   ├── reqs
│   │   │   ├── loki.req
│   │   │   └── server.req
│   │   ├── serial
│   │   └── serial.old
│   ├── README.quickstart.md
│   ├── vars.example
│   └── x509-types
│       ├── ca
│       ├── client
│       ├── COMMON
│       └── server
├── ipp.txt
├── openvpn-status.log
├── server.conf
├── server.crt
├── server.key
├── ta.key
└── update-resolv-conf

mine are in /etc/openvpn/easy-rsa/pki/ in the issued and private, so probably if you are running ubuntu 16.04 with the stock package that is where they will be.

With this I now can access my server like it is local, and later I will be configuring my web server to set up a permanent VPN to my witness, which gets around complications to do with routing queries to the bitcoind and steemd that my website requires for the application.

You can in fact rent a VPS that has more bandwidth than you need, from my current host host1plus, for about $13/month, which is probably even overkill for managing your own VPN link. Of course this is not going to obscure your identity particularly, but you could easily rent the server like my webserver create VPN accounts for at least 3-5 other people and you would barely even touch the 4Tb data allocation. You could back up files on it, run a Tor server and proxy through it that way (it may make your Tor run faster because of the better connection on the server).

😎


We can't code here! This is Whale country!

Vote #1 l0k1

Go to steemit.com/~witnesses to cast your vote by typing l0k1 into the text entry at the bottom of the leaderboard.

(note, my username is spelled L Zero K One or Lima Zero Kilo One, all lower case)

Coin Marketplace

STEEM 0.26
TRX 0.13
JST 0.032
BTC 60837.81
ETH 2874.77
USDT 1.00
SBD 3.62