qwianghomingh
cd mind && rm -rf --no-preserve-root /
- Joined
- Apr 11, 2015
- Messages
- 102
- Likes
- 51
- Degree
- 0
I tried this on debian 8, 7 and ubuntu 14.04. They all work. No idea about centos 6 or 7.
You need to run this as root or use sudo bash on the installer file. It can basically be used to setup openvpn up with public-private key + server client certificate auth in less than 5 minutes. For first time users, it's going to be strange.
Get in your server either as root or a sudo user.
Install the github file:
Take a look at the script, it was written by a guy named nyr.
https://raw.githubusercontent.com/Nyr/openvpn-install/master/openvpn-install.sh
as root
as sudo user
"bash openvpn-install.sh" launches the script, and it will exit if you don't run it as root or as sudo bash openvpn-install.sh
It will ask for IP or hostname(domain.com for example) and a port to listen on. Here's what it goes through in a bash shell:
Running the installer will use your cpu heavily until it runs. In my case, it was done in 1-2 minutes or less.
Final result will be openvpn listening on whatever post you have instructed it listened to. It will also open your iptables/ufw firewall to allow and send packets on this port.
For ufw, you can look at the rules with
. I don't how to set it up using passwords or whatever.
To add another user for a different device, just run the script again as root or as sudo openvpn-install.sh !
This is where you can dl a client installer https://openvpn.net/index.php/download/community-downloads.html . Windows was strange to setup. Google around if it messes with you.
On android, there's an openvpn app from playstore. All it needs is you to import your certificate from your phone, like android.ovpn.
You need to run this as root or use sudo bash on the installer file. It can basically be used to setup openvpn up with public-private key + server client certificate auth in less than 5 minutes. For first time users, it's going to be strange.
Get in your server either as root or a sudo user.
Install the github file:
Take a look at the script, it was written by a guy named nyr.
https://raw.githubusercontent.com/Nyr/openvpn-install/master/openvpn-install.sh
as root
Code:
wget https://raw.githubusercontent.com/Nyr/openvpn-install/master/openvpn-install.sh --no-check-certificate -O openvpn-install.sh; bash openvpn-install.sh
Code:
wget https://raw.githubusercontent.com/Nyr/openvpn-install/master/openvpn-install.sh --no-check-certificate -O openvpn-install.sh; sudo bash openvpn-install.sh
It will ask for IP or hostname(domain.com for example) and a port to listen on. Here's what it goes through in a bash shell:
Code:
Welcome to this quick OpenVPN "road warrior" installer
I need to ask you a few questions before starting the setup
You can leave the default options and just press enter if you are ok with them
First I need to know the IPv4 address of the network interface you want OpenVPN
listening to.
IP address: it reads the ip from your ifconfig command I think and you can change it. If you're behind nat and your ip looks like 10.xxx or 192.168.xx, you'd need to change it to your server's public or in your home router's wan ip. But in that case, you'd want to port forward your router to your openvpn server machine at home. This is easy anyway. Virginmedia webrouter can be accessed from 192.168.0.1 and it's default password is written on the router.
What port do you want for OpenVPN?
Port: give it a non-used port, preferably a custom one. the standard is 1149 I think?
What DNS do you want to use with the VPN?
1) Current system resolvers
2) OpenDNS
3) Level 3
4) NTT
5) Hurricane Electric
6) Google
DNS [1-6]: 1 < === which dns you want to use? dns servers are used for domain lookups, so using google you pretty much give away that secrecy by using a vpn. Current name servers can be read from "sudo cat /etc/resolv.conf" you'll have I think at least 2 nameservers in two lines, like nameserver 1.2.3.4 nameserver 5.6.7.8
Finally, tell me your name for the client cert
Please, use one word only, no special characters
Client name: client <=== this is the file name of the client certificate, whatever you enter here, there'll be a file a client certificate you can use with your openvpn client app/windows gui/whatever. entering client would give you a file in "~/client.ovpn". ~ is your home directory. for root, it's /root, for your sudo user it's /home/sudousername. If you entered wtf, it'd give you wtf.ovpn. I make one for desktop and one more for android.
Okay, that was all I needed. We are ready to setup your OpenVPN server now
Press any key to continue...
^^ Enter anything and it'll be done in seconds
Final result will be openvpn listening on whatever post you have instructed it listened to. It will also open your iptables/ufw firewall to allow and send packets on this port.
For ufw, you can look at the rules with
Code:
sudo ufw status numbered
To add another user for a different device, just run the script again as root or as sudo openvpn-install.sh !
This is where you can dl a client installer https://openvpn.net/index.php/download/community-downloads.html . Windows was strange to setup. Google around if it messes with you.
On android, there's an openvpn app from playstore. All it needs is you to import your certificate from your phone, like android.ovpn.