I would like to connect to vpn using openconnect. Our company uses Google Authenticator codes.
How to use openconnect to connect to vpn with 2 factor authentication with Google Authenticator
14.1k Views Asked by vozman At
2
There are 2 best solutions below
0

Or you can make it working with oathtool (works fine for macOS users):
alias vpn="echo -e '${YOUR_PWD}\n$(cat ~/.totp_google | xargs oathtool --totp -b)' | \
sudo openconnect {YOUR_VPN_HOST} --user=${YOUR_USERNAME} --passwd-on-stdin"
Your secret shoud be in ~/.totp_google
file.
Use this to create 2 factor codes on your pc https://github.com/arcanericky/ga-cmd
Store your account password in
~/.cisco/pass.txt
Then use this to connect to vpn