Skip to content

Instantly share code, notes, and snippets.

@jfeilbach
Created January 29, 2020 13:29
Show Gist options
  • Save jfeilbach/546cb88dd1d4f67c70889ade385acf53 to your computer and use it in GitHub Desktop.
Save jfeilbach/546cb88dd1d4f67c70889ade385acf53 to your computer and use it in GitHub Desktop.
bash script to start cisco anyconnect vpn client via cli and use 2fa
#!/bin/bash
STTY=$(stty -g)
stty -echo
echo -e "connect <vpn server>/<path>\n<vpn user>"
/usr/bin/security find-generic-password -wl vpnpass.extadmin
oathtool --totp -b "$(/usr/bin/security find-generic-password -wl oathkey.extadmin)"
echo -e "y\n"
#stty "${STTY}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment