Search code examples
vpnopenconnect

How to use openconnect to connect to vpn with 2 factor authentication with Google Authenticator


I would like to connect to vpn using openconnect. Our company uses Google Authenticator codes.


Solution

  • 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

    echo -e "$(sudo cat ~/.cisco/pass.txt)\n$(./ga-cmd <your-ga-site-name>)" | sudo openconnect --user=<username> --passwd-on-stdin <your-vpn.com>