49

Is there any easy solution for OpenVPN being executed from Desktop for non technician people so they only push a button and get connected to a external VPN? Most of my colleagues are non Linux proficients. So, their interaction with CL is very limited.

0

7 Answers 7

48

I know this is not the GUI method but openvpn couldn't be any more simple or elementary as far as the commandline goes and really does not need a GUI. The command to start an openvpn session is as follows:

sudo openvpn --config

and then drag and drop the ".ovpn" file into the terminal to complete the command so it should look something like this example:

sudo openvpn --config '/home/jglerner/Desktop/vpnbook-us1-tcp443.ovpn'

press enter, enter your password for sudo, enter your vpn username, then your vpn password and you're good to go.

Users can minimize the open terminal if they don't want to look at it while it's running. Plus, it might give your "non linux pals" a bit of commandline confidence when they see how easy something like this can be.

Example .ovpn file used in this example can be downloaded from here http://www.vpnbook.com/ if you want to check it out and see how it works. Just download the certificate bundle and extract the zip file. There are two TCP and two UDP servers to choose from. The username is "freevpnme" and the password is listed on the download page, however, the password changes day to day to prevent abuse and spam but the cert. files stay the same.

9
  • Thanks, I´ll give it a try. My VPN provider provides a XXX.ovpn file. I have already installed it under a rooter (dd-wrt messed and stuff :-) )so, I think, it will do the trick. Not as difficult as I may see. I´ll keep you informed. Now I´ll need to clean some *.conf files I have already started to garble.
    – jglerner
    Aug 7, 2014 at 21:23
  • Just for starters I tried OPenVPN on my Windows box and it works. I think that your solution will work as well in Linux.I´ll try it tomorrow morning. \o/
    – jglerner
    Aug 7, 2014 at 22:14
  • if you have a vpn provider with more than 500 servers, good luck for adding all of them
    – Mehdi
    Nov 11, 2016 at 16:26
  • @Mehdi Good luck using more than one vpn at a time, let alone 500; your connection would be soooo slow. However, it shouldn't be too hard to batch download all 500 ovpn files to a single directory where the user can select which one to use each time. No luck needed :) Just drag and drop the file into the terminal; it's super easy.
    – mchid
    Nov 14, 2016 at 7:54
  • I was talking about adding all 500 servers manually to the network manager to be able to switch from one to another at any time. There is more than drag and drop there as you need three files for each server (Nordvpn) plus writing your username and password. But I found a script to make this automatic blog.sleeplessbeastie.eu/2016/05/05/…
    – Mehdi
    Nov 14, 2016 at 13:19
34

Here's how I did this in ubuntu 16.04.

I used Network Manager -- access this via right-click on the little "networking icon" in the system tray, e.g.:

enter image description here

I already had Network Manager, but I needed to install OpenVPN and two extensions for Network Manager:

sudo apt-get install openvpn  
sudo apt-get install network-manager-openvpn  
sudo apt-get install network-manager-openvpn-gnome  

Even if you're not running Gnome, you can install the Gnome extension for OpenVPN -- it will run just fine inside Unity, for example, and it's needed for the following setup:

Right-click Network Manager in the System Tray, select Edit:

edit connection

click Add:

add new connection

In the dropdown, select to import the vpn config:

import saved vpn config

Select the .ovpn config file from your file system:

choose vpn config

Once this is setup, right-click on Network Manager > VPN Connections and select the connection to connect. To disconnect, do the same:

connect to vpn

6
  • 1
    This worked beautifully - for me the closest thing to OpenVPN GUI on Windows or TunnelBlick on Mac, which is what I was after. Sep 4, 2018 at 20:54
  • 1
    This should be the accepted answer ! Mar 11, 2020 at 12:35
  • 3
    This is by far the best solution Mar 17, 2020 at 5:28
  • Unable to import open.config for 2.8.4 version using this methodology Sep 9, 2020 at 5:51
  • 1
    Works perferctly on Ubuntu 22.04.2. I don't know why I missed this before. I've been using the command line for years!
    – DAB
    Aug 11, 2023 at 8:57
21

Adding an OpenVPN connection via the Network preferences with network-manager-openvpn-gnome installed, defaults to using UDP instead of TCP. If you want to connect via TCP, it is under the Advanced settings you can get to by clicking that button on the VPN tab of the configuration GUI.

1
  • 3
    Open the .ovpn file and you'll find some hints on what to set for the vpn. Hover over each setting and you'll see what config line to check. For example where it says config: ca choose the ca.crt file if the ovpn file has the line ca ca.crt. If the ovpn file has cipher AES-256-CBC choose it under the cipher tab of Advanced - Security where the tooltip says config:cipher. If you have dev tap in file check the "Use a Tap device", etc.
    – NoBugs
    Aug 8, 2015 at 4:39
7

You can install the network-manager-openvpn-gnome package to enable OpenVpn GUI in Ubuntu or other linuxes that have network-manager:

sudo apt-get install network-manager-openvpn-gnome
3

You could try free and open source Pritunl client

https://client.pritunl.com/

To install it on Ubuntu 16.04:

sudo tee /etc/apt/sources.list.d/pritunl.list << EOF
deb http://repo.pritunl.com/stable/apt xenial main
EOF

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv 7568D9BB55FF9E5287D586017AE645C0CF8E292A
sudo apt-get update
sudo apt-get install pritunl-client-electron

enter image description here

1
  • 1
    wow! an electron-based VPN client! :D (mind-blown)
    – ccpizza
    Oct 4, 2019 at 7:08
2

Easiest way (Desktop environment GUI) :

As Hawkeye Parker told, You can simply use this built-in option for it by following this:

  1. setting -> network -> VPN
  2. click on + and select import from file... Add VPN
  3. now select .ovpn file Select .opvn file
  4. configure it (username/ password) VPN configuration

Feel free to change name field to whatever you want.

I tried it on 20.04 LTS version

5
  • Hello. This may be an answer but what about later when all the links are no longer valid?
    – David
    Mar 26, 2022 at 12:01
  • hey @David, it can not happen, links are images, and images are hosted by askubuntu servers just like other images. As a New contributor, I could not post images until I made some reputation
    – daway0
    Mar 26, 2022 at 18:25
  • You are mistaken. Imgur keep images for ever as long as they are receiving at least 1 view every six months. If they are not they may be deleted to save space.
    – David
    Mar 27, 2022 at 7:18
  • @David, I didn't know. I will change the links as soon as I can. Thank you for saying that :)
    – daway0
    Mar 27, 2022 at 12:08
  • @daway0 How to configure Google (OAuth) based authentication?
    – diman82
    Apr 23, 2023 at 9:36
0

Just create a .desktop file and insert the terminal string or call a bash script after the "exec" in the file

1
  • This is not managebale (how to check status of connection, disconnect and etc..)!
    – diman82
    Apr 23, 2023 at 9:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .