Skip to content

Instantly share code, notes, and snippets.

@retyui
Created August 10, 2023 16:10
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 retyui/94d3d3f0a0baa4533364d5b81dd83cb9 to your computer and use it in GitHub Desktop.
Save retyui/94d3d3f0a0baa4533364d5b81dd83cb9 to your computer and use it in GitHub Desktop.
AnyConnect linux connect vpn script
#!/usr/bin/expect
set USERNAME "<user>"
set PASSWORD [lindex $argv 0]
eval spawn /opt/cisco/anyconnect/bin/vpn connect vpn.mysite.com
expect "Connect Anyway" { send "y\r" }
expect "import the certificate" { send "n\r" }
expect "Username:" { send "$USERNAME\r" }
expect "Password:" { send "$PASSWORD\r" }
set timeout 60
expect "VPN>"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment