![]() |
|
[VPN] [TUTORIAL] OpenVPN Server Setup (Debian 8 Jessie) - Printable Version +- Hack Forums (https://hackforums.net) +-- Forum: Hacks, Exploits, and Various Discussions (https://hackforums.net/forumdisplay.php?fid=45) +--- Forum: Grayhat • Purple Team • Hybrid Security (https://hackforums.net/forumdisplay.php?fid=449) +---- Forum: VPN, Proxies, and Socks (https://hackforums.net/forumdisplay.php?fid=91) +---- Thread: [VPN] [TUTORIAL] OpenVPN Server Setup (Debian 8 Jessie) (/showthread.php?tid=5838690) |
[TUTORIAL] OpenVPN Server Setup (Debian 8 Jessie) - Qismon - May 19, 2018 Hello all, I did not see too many tutorials about setting up OpenVPN Server side so hopefully this helps anyone looking for that. I am installing on Linux Debian 8 Jessie 64Bit (KVM Virtualization). # STEP 1: Install OpenVPN Server & EasyRSA. Code apt-get update# STEP 2: Copy needed EasyRSA files for generating Server-Client keys to OpenVPN folder. Code cp -R /usr/share/easy-rsa /etc/openvpn/# STEP 3: Edit VARS file Location & Export Keysize. Code nano /etc/openvpn/easy-rsa/varsexport KEY_COUNTRY="US" export KEY_PROVINCE="CA" export KEY_CITY="SanFrancisco" export KEY_ORG="Fort-Funston" export KEY_EMAIL="[email protected]" export KEY_OU=ChangeMe Now find another line that looks like this >> export KEY_SIZE=2048 And we will change the keysize so the line now looks like this >> export KEY_SIZE=4096 After making all needed changes you can save the file and exit. Using nano this can be done by pressing Ctrl+o...You will be prompted to confirm the change, just press enter. Then Ctrl+x to exit nano. # STEP 4: Build ca.key Code cd /etc/openvpn/easy-rsa/Just press enter for each prompt to use the default settings. # STEP 5: Build server.key Code ./build-key-server serverNow you will see 2 prompts to confirm the signing of the certificate. Press "y" for both prompts and you should see the following message if all went fine :: Write out database with 1 new entries Data Base Updated. # STEP 6: Generate DH Parameters. (Go for a coffee after this step...this will take a while.) Code ./build-dh# STEP 7: Copy all certs and keys to OpenVPN folder. Code cd /etc/openvpn/easy-rsa/keys# STEP 8: Configure OpenVPN server.conf Code cd /etc/openvpn/https://www.ungefiltert-surfen.de https://blog.cloudflare.com/announcing-1111 # STEP 9: Configure Network and IPTables to allow VPN Passthrough. Note: This step is different if you are using a VPS with KVM or OpenVZ Virtualization. KVM is my preference. ! ONLY RUN THE CODE FOR YOUR VPS VIRTUALIZATION VERSION ! # KVM VERSION BELOW Code iptables -A INPUT -p udp -m state --state NEW -m udp --dport 1194 -j ACCEPT# OPENVZ VERSION BELOW (Change the WAN IP on line 5 to your VPS IP) Code iptables -FOk now we need to add our IPTables rules to startup incase we reboot the server. Code iptables --listThis will open the new blank file we created called "iptables". Copy the code below to "iptables" then save and exit by pressing Ctrl+o then Enter to confirm changes, then Ctrl+x to exit nano. Code #!/bin/shMake our new "iptables" file executable. Code chmod +x /etc/network/if-up.d/iptables# STEP 10: Start OpenVPN Service and check status. Code systemctl enable openvpn@serverWhen you run "service openvpn status" you should see a terminal output similar to the following. Code root@binn:/etc/openvpn/easy-rsa/keys# service openvpn statusIf OpenVPN Service is running fine then we can move on to the final step. # STEP 11: Generate OpenVPN Client File with In-Line CA, Cert and Key. Code cd /etc/openvpn/easy-rsa/Do not add a password while generating the client key. Now you will see 2 prompts to confirm the signing of the certificate. Press "y" for both prompts and you should see the following message if all went fine :: Write out database with 1 new entries Data Base Updated. Change the WAN IP on line 4 to your VPS IP, then copy and paste all the code below to make your client.ovpn file. Code echo 'clientDrop the client.ovpn file in your OpenVPN client config folder and you should be able to connect just fine. Later on I will add another tutorial of how to create a MySQL Database to manage user/pass with auth-pam module. Hopefully this will be helpful for some. 🤝 RE: [TUTORIAL] OpenVPN Server Setup (Debian 8 Jessie) - inkbird - May 20, 2018 Wow dude. Thank you for this. RE: [TUTORIAL] OpenVPN Server Setup (Debian 8 Jessie) - Qismon - May 21, 2018 (May 20, 2018 11:26 AM)inkbird Wrote: Wow dude. Thank you for this. You are welcome! If you need any help setting it up let me know. 🤝 |