VPN Installation on Linux

My school’s IT department implemented two-factor authentication, but neglected to update their instructions for using a VPN with Linux. I called them, but they said they don’t support Linux users. Well….

Below are instructions for Case Western / .edu folks. Please glean from it what you can if you want to install a VPN on your Linuxmachine. There is a program called openconnect that works. Here’s how to use it and how to troubleshoot:

To use this VPN:

1) Install openconnect (see instructions and troubleshooting below)
2) Run sudo openconnect vpn.yourschoolname.edu
3) Add your Linuxmachine password
4) Type “SchoolName” as the group 5) Use your network id as the username
6) Enter your password in the first password field
7) Finally, enter your DUO 2 factor code in the second password field.

Errors Ahoy!

The first suggestion was to run in the terminal: sudo apt-get install openconnect
However, there was no option for the two-factor authentication. Turns out that command uses version 3.15. Its Version 7 that is most current at this time.

Got Version 7?

Great, you downloaded it. Now what? First, review the instructions of dependencies. Its pretty confusing.

Below are the dependencies:
– libxml2
– zlib
– Either OpenSSL or GnuTLS
– pkg-config

In my case, I had all of them except OpenSSL. You can figure this out for yourself with whereis.

Such as:

whereis zlib
whereis OpenSSL
whereis GnuTLS
whereis pkg-config

Get OpenSSL

tar zxf openssl-VERSION.tar.gz
cd openssl-VERSION
sudo apt-get install ia32-libs

Install Openconnect

Lazy blogging alert! I recorded a history of what I did to finally get Openconnect to work:

Make your VPNC folder

cd openconnect-7.06/
mkdir vpnc /etc
cd /etc/
mkdir vpnc
sudo mkdir vpnc
cd ~/Downloads/openconnect-7.06/
mv vpnc-script /etc/vpnc/
sudo mv vpnc-script /etc/vpnc/
sudo ./configure
./configure —with-vpnc-script=/etc/vpnc/vpnc-script —without-gnutls
sudo make install

Almost home stretch

sudo openconnect vpn.case.edu
emacs /etc/ld.so.conf
sudo apt-get update
./configure —with-vpnc-script=/etc/vpnc/vpnc-script —without-gnutls
make test
sudo make install
sudo openconnect vpn.case.edu

D’oh, the VPN still needed help.

Shoot one last step:

cd /etc/vpnc/
ls -al
chmod o+x vpnc-script


Whew. That was fun (big air quotes) Saturday. I’d like to thank the discussion list of the Hacker Society for offering suggestions on getting started with this.