Connect Remote Server using OpenVPN with Username/Password Authentication
Connect Remote Server using OpenVPN with Username/Password Authentication
Connect Remote Server using OpenVPN with Username/Password Authentication
- For Window OS user
- Download and install OpenVPN from https://openvpn.net/index.php/open-source/downloads.html for Window: choose installer openvpn-install*.exe.
- Prepare openvpn config file (*.ovpn) e.g. openvpn-rangsiman.ovpn.
- Copy file from (2) to C:\Program Files\OpenVPN\config\ (or where you installed OpenVPN) or click at OpenVPN icon at taskbar. Then select Import file... and nevigate to openvpn config file.
- Open OpenVPN by double click its icon on desktop or search on Start Menu --> OpenVPN GUI.
- Activate OpenVPN by selecting Connect to connect access Linux server.
- Enter your username and password.
- Wait untill connection completed. Notice that the icon of OpenVPN at taskbar would be changed color from white to orange and to green, recpectively.
- Connection done
- Caveat: you should disconnect OpenVPN when you have finished SSH.
- For non-Window OS user
- Open terminal.
- Install OpenVPN using command
sudo apt-get install openvpn
for Ubuntu or Debian-based Linux distribution andsudo yum install openvpn
for Fedora or CentOS Linux distribution. - Prepare your config file (*.ovpn) e.g. openvpn-rangsiman.ovpn. Save it in your home directory e.g. /home/rangsiman/vpn/.
- Create passwd authentication file e.g. passwd.txt. Then put your username and passwd to this file.
- Connect VPN using command
sudo openvpn --config /home/rangsiman/vpn/openvpn-rangsiman.ovpn --auth-user-pass /home/rangsiman/vpn/passwd.txt --auth-nocache
- Enter your sudo password.
- Wait untill you see status message "Initialization Sequence Completed".
- Now you are ready to connect access Linux server.
*You can watch this video for step-by-step using OpenVPN on Linux.
- Error and Solution
If you face an error like this
Fri May 25 13:54:07 2018 failed to find GID for group nogroup
Fri May 25 13:54:07 2018 Exiting due to fatal error
This can be solve by change the group name in OpenVPN configuration file. For example,
user nobody
group nogroup
change to
user nobody
group nobody
Rangsiman Ketkaew