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:
ssh root@vpsip
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:
wget http://swupdate.openvpn.org/as/openvpn-as-2.6-CentOS6.x86_64.rpm
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)... 104.18.248.114, 104.18.251.114, 104.18.249.114, ... Connecting to swupdate.openvpn.org (swupdate.openvpn.org)|104.18.248.114|: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://123.123.123.123: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://123.123.123.123:943/admin Client UI: https://123.123.123.123:943/ +++++++++++++++++++++++++++++++++++++++++++++++
In the example above, your VPS IP is 123.123.123.123. 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://123.123.123.123:943/admin by using user: openvpn and Password according to what you input in the fourth step.