Skip to content

Instantly share code, notes, and snippets.

@seelengut
Last active March 6, 2019 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seelengut/d2cda530896b05b3750ef8403f316ae9 to your computer and use it in GitHub Desktop.
Save seelengut/d2cda530896b05b3750ef8403f316ae9 to your computer and use it in GitHub Desktop.
Openconnect Config

Install Openconnect and stoken

  1. Install Homebrew from http://brew.sh and make sure it works

  2. Install openconnect with stoken support

    brew install openconnect --with-stoken

  3. Install stoken

    brew install stoken

Configure stoken so you don't need to enter your RSA token pin before connecting

  1. Import your RSA token provisioning string, URL, or file with one of:

    stoken import --file filename.stdid

    stoken import --token token_string_or_url

  2. Enter the token's password if prompted; when asked for a new one leave it blank.

  3. If prompted for a PIN, use the provisioning PIN; if you don't have one, it's probably 0000

  4. Check to see that ~/.stokenrc was created

  5. Store your pin locally to avoid having to type it again:

    stoken setpin

Connect to the VPN

  1. Execute the following command to connect to the VPN:

    stoken | sudo openconnect --juniper --passwd-on-stdin --user=<core_id> access.motorola.com

  2. Have fun!


Troubleshooting

  1. In case you get the issue below, you may be running openconnect on a Mac OSX version that is too old:

    grep: /etc/nsswitch.conf: No such file or directory
    Failed to open tun device: Invalid argument
    Set up tun device failed
    
    1. Check if the openconnect version running is greater than 7.08

      openconnect --version

    2. If so, download the 7.08 version by running the command below:

      brew install https://raw.githubusercontent.com/Homebrew/homebrew-core/0601bb706f3e218dd55a4656f2c9f42c51d1f360/Formula/openconnect.rb
      
    3. After installing, check that the version is now 7.08 and try the "Connect to the VPN" command again.

    4. References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment