Skip to content

Instantly share code, notes, and snippets.

@titenkov
Last active March 12, 2019 07:39
Show Gist options
  • Save titenkov/391f3d24ab687abce5f5ccae03637048 to your computer and use it in GitHub Desktop.
Save titenkov/391f3d24ab687abce5f5ccae03637048 to your computer and use it in GitHub Desktop.
Openconnect setup

OpenConnect can be installed via homebrew:

  brew update
  brew install openconnect

Running openconnect requires sudo, presumably because it affects resolution of DNS, but you can add password-less sudo ability for the openconnect command.

Open:

  sudo visudo -f /etc/sudoers

Add this line:

  %admin  ALL=(ALL) NOPASSWD: /usr/local/bin/openconnect

Entering password each time, when you connect to VPN, can be annoying, so you can store it in the keychain.

Open "Keychain Access" app, click "File -> New password item". Once it's created, you can access it from the command line usingsecurity find-generic-password -s <keychain_item_name> -w.

  security find-generic-password -s vpn -w | sudo openconnect --user <username> <host>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment