Contents
  1. 1. Mac
  2. 2. Ubuntu

This document describes how to setup openconnect on your system.

Mac

  • Install requisite

    1
    2
    brew cask install tuntap
    brew install gcc lz4 gnutls pkg-config autoconf automake(including aclocal-1.15) stoken(including libstoken)
    • No need to install vpnc, which is used for cisco connection
  • Install vpnc-script

    • Copy the contents from the page vpnc-script to the default file as below
      1
      2
      vi /etc/vpnc/vpnc-script
      sudo chmod +x /etc/vpnc/vpnc-script
  • Import your stdid file

    1
    stoken import --file /path/to/yourname.stdid
  • Install openconnect

    1
    2
    3
    4
    5
    6
    wget ftp://ftp.infradead.org/pub/openconnect/openconnect-7.07.tar.gz
    tar xvf openconnect-7.07.tar.gz
    cd openconnect-7.07
    ./configure --with-stoken --disable-nls
    make
    make install
  • Connect to the vpn server

    1
    sudo openconnect --token-mode=rsa -u <username> <vpn-server>
  • Reference

  • If you upgrade the system to sierra 10.12, need to re-install all above things

    • tuntap: only supports package installation for Yosemite 10.10 now.
    • others: brew install

Ubuntu

  • Get the stdid file

  • Install stoken (https://sourceforge.net/p/stoken/wiki/Home/)

    • Ubuntu16.04(apt-get)
    • Ubuntu14.04(the stoken at 14.04 is too old, so install it from ppa)
      1
      2
      3
      4
      5
      sudo -s
      apt-get install python-software-properties
      add-apt-repository ppa:cernekee/ppa
      apt-get update
      apt-get install stoken libstoken-dev
  • Import previous token ID

    1
    stoken import --file mytoken.sdtid
  • Input init password or PIN and new PIN

  • Cache PIN in ~/.stokenrc

    1
    stoken setpin
  • Show code with either

    1
    2
    3
    stoken tokencode
    stoken-gui
    stoken-gui --small
  • Install VPN client

    1
    apt-get install network-manager-openconnect-gnome
  • Configure VPN in NetworkManager

    1
    2
    Gateway: sha-vpn.abc.com
    Token Mode: RSA SecurID - read from ~/.stokenrc
Contents
  1. 1. Mac
  2. 2. Ubuntu