Guidance on usage: OpenVPN Server on Linux 7.9

Connection to the OpenVPN Server on Linux 7.9 

  1. Run the VM through Azure Portal. To customize the OpenVPN, first, you need to know the server IP address. You can find it in the personal account of Azure. (You need to select the virtual machine from the list. By clicking the item “Overview”, your IP is displayed in the line “Public IP Address”).
  1. First, to connect to VPN Server, you should open port 1194 UDP in the network properties on Azure Firewall
  1. To manage with an OpenVPN, you should connect to a VM.
    1. With OpenSSH

In the Windows 10 operating system (starting with version 1809), an OpenSSH client is available, with which you can connect to Linux servers via SSH. If Windows 10 is suitable and the OpenSSH client is installed, you can start connecting via SSH. To do this, launch a normal Windows command prompt and enter the command “ssh user@*vm_ip*” (1), where “user” is the username that was specified while creating the virtual machine and “*vm_ip*” is the VM IP address.

Then type “Yes” (2) and enter a password (3) that was specified while creating the virtual machine.

  1. With the PuTTY application 

To do this, you need the PuTTY application to connect via ssh. You can download it at the following link – Download

Run PuTTY, enter the VM address in the “Host” field, and click “Open” to connect.

In the opened console, you will need to enter a username (1) and password (2) that were specified while the VM was being created (you’ll not see the password in the console while entering it). 

  1. Next, you should enter the following commands:

> sudo vpnusers

  1. To create a new user, type “1” and press Enter
  1. Write a username and press Enter
  1. The last line will tell you where the config file is available (exampleuser.ovpn in this case) 
  1. You need to copy the contents of this file. To do this, display the contents of the file on the screen with the following command:

> cat /etc/openvpn/clientconfigs/”exampleuser”.ovpn 

Don’t forget to replace “exampleuser” with the username that was created in step 5

  1. Copy the entire contents of the file by selecting it and pressing Ctrl + C
  1. Open Notepad or any other text editor and paste the contents of the file into a blank document
  1. Save the file with the extension .ovpn
  1. Then restart the VM
  1. Run OpenVPN Connect. If you don’t have OpenVPN installed, you can download it here
  1. In the window that is open, specify the path to the file that you unpacked from the archive and click “OK”.
  1. Click Connect
  1. If the connection is successful, the following window is displayed

You can check the change in your IP on What Is My IP by going to it before connecting to OpenVPN and after connecting.