Rangsiman Ketkaew

Ph.D. Student in Computational Chemistry and Machine Learning at UZH

Posted by on

Category : Linux   server

Table of Content


For Windows users

  1. Download and install OpenVPN from https://openvpn.net/index.php/open-source/downloads.html for Window: choose installer openvpn-install*.exe.
  2. Prepare OpenVpn config file (*.ovpn) e.g. openvpn-rangsiman.ovpn.
  3. 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 navigate to openvpn config file.
  4. Open OpenVPN by double click its icon on desktop or search on Start Menu –> OpenVPN GUI.
  5. Activate OpenVPN by selecting Connect to connect access Linux server.
  6. Enter your username and password.
  7. Wait until connection completed. Notice that the icon of OpenVPN at taskbar would be changed color from white to orange and to green, respectively.
  8. Connection done
  9. Caveat: you should disconnect OpenVPN when you have finished SSH.


For non-Windows users

  1. Open terminal.
  2. Install OpenVPN using command sudo apt-get install openvpn for Ubuntu or Debian-based Linux distribution and sudo yum install openvpn for Fedora or CentOS Linux distribution.
  3. Prepare your config file (*.ovpn) e.g. openvpn-rangsiman.ovpn and save it at your home directory:
/home/rangsiman/vpn/
  1. Create passwd authentication file e.g. passwd.txt. Then put your username and passwd to this file.
  2. Connect VPN using command
sudo openvpn --config /home/rangsiman/vpn/openvpn-rangsiman.ovpn --auth-user-pass /home/rangsiman/vpn/passwd.txt --auth-nocache
  1. Enter your sudo password.
  2. Wait until you see status message “Initialization Sequence Completed”.
  3. 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