The reason behind developing this project was to ease the process of connecting to VPN. In my daily work I constantly required a VPN connection, Cisco AnyConnect client was the obvious choice but because I was facing some issues installing the same in ubuntu so instead I choose openconnect. After following below mentioned step, I am now able to get connected to a vpn using few mouse clicks.
Currently I have tested this only on ubuntu 16.04, hopefully, in coming days I will be adding installation instruction for other OS too.
-
Install expect using this command:
sudo apt-get install expect
-
Steps for installing openconnect:
- First run command below to active th TUN module:
sudo /sbin/modprobe tun
- Install OpenConnect:
sudo apt-get install openconnect
- First run command below to active th TUN module:
-
Download the module and make openconnect script executable like this:
chmod +x /path/to/openconnect.sh
-
Change these variables: GATEWAY, UBUNTUPASSWORD, USERNAME, PASSWORD present in the script (openconnect.sh) as per your environment.
-
Run the script like this:
./openconnect.sh
, this is when you are in the root directory of the module otherwise add the path to your module. -
Now we have to install Nautilus-Actions Configuration Tool, type this in the terminal:
sudo apt-get install nautilus-actions
-
Launch the Nautilus-Actions Configuration Tool from the Dash after installing it.
-
First, click the New Action button on the toolbar and type the name of your action into the Context Label box, maybe something like this: Connect to VPN
-
Click the Command tab and in Label box enter any suitable name like VPN and in Path box this: /usr/local/bin/vpn
-
Since we would need terminal for executing our newly created vpn command, in nautilus-actions tool, go to Edit > Preferences > Runtime Execution. In the "command pattern" field, enter: gnome-terminal -x sh -c COMMAND
-
Now we need to restart nautilus typing this command in the terminal:
nautilus -q
-
After this, you can access your newly created VPN command on right clicking under Nautilus-Actions actions.
Link to blog. Happy browsing 😃