VPN or Virtual Private Network is one way to overcome all that. But the question arises … how to use a VPN by utilizing the VPS that we have?In this tutorial we will learn how to Install OpenVPN on a CentOS6 VPS.The first step we have to do is log in to VPS via SSH.
If you are a Linux or MacOS user, you can do it directly through the terminal with the following command:
if using a special port outside port 22, use the command:
ssh -p 22 root@vpsip
where 22 is your SSH VPS port number.
If you are a Windows user, you can use PuTTY or Bitvize to connect SSH to VPS with the root username.
The second step is to download rpm OpenVPN with the wget command:
The results are as follows:
[root@vps]# wget http://swupdate.openvpn.org/as/openvpn-as-2.5.2-Ubuntu16.amd_64.deb --2018-19-08 11:20:31-- http://swupdate.openvpn.org/as/openvpn-as-2.5.2-Ubuntu16.amd_64.deb Resolving swupdate.openvpn.org (swupdate.openvpn.org)... 22.214.171.124, 126.96.36.199, 188.8.131.52, ... Connecting to swupdate.openvpn.org (swupdate.openvpn.org)|184.108.40.206|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 33289672 (32M) [application/x-www-form-urlencoded] Saving to: 'openvpn-as-2.5.2-Ubuntu16.amd_64.deb' openvpn-as-2.5.2-Ubunt 100%[===========================>] 37.75M 7.8MB/s in 3.1s 2018-12-19 12:11:32 (17.1 MB/s) - 'openvpn-as-2.5.2-Ubuntu16.amd_64.deb' saved [33289672/33289672]
The third step is to install the download with the command dpkg -i as follows:
[root@vps]# dpkg -i openvpn-as-2.5.2-Ubuntu16.amd_64.deb Selecting previously unselected package openvpn-as. (Reading database ... 58668 files and directories currently installed.) Preparing to unpack openvpn-as-2.5.2-Ubuntu16.amd_64.deb ... Unpacking openvpn-as (2.5.2-Ubuntu16) ... Setting up openvpn-as (2.5.2-Ubuntu16) ... The Access Server has been successfully installed in /usr/local/openvpn_as Configuration log file has been written to /usr/local/openvpn_as/init.log Please enter "passwd openvpn" to set the initial administrative password, then login as "openvpn" to continue configuration here: https://220.127.116.11:943/admin To reconfigure manually, use the /usr/local/openvpn_as/bin/ovpn-init tool. +++++++++++++++++++++++++++++++++++++++++++++++ Access Server Web UIs are available here: Admin UI: https://18.104.22.168:943/admin Client UI: https://22.214.171.124:943/ +++++++++++++++++++++++++++++++++++++++++++++++
In the example above, your VPS IP is 126.96.36.199. This IP address will differ according to your IP VPS.
The fourth step Change the VPN login password by typing the passwd command openvpn:
[root@vps]# passwd openvpn Changing password for user openvpn. New password: Retype new password: passwd: all authentication tokens updated successfully. After you have done the four steps above, the VPN server is ready to use. You can log in to the server dashboard via https://188.8.131.52:943/admin by using user: openvpn and Password according to what you input in the fourth step.