I use Cisco anyconnect in Windows machine at office laptop. I also do office work from home with my personal Ubuntu laptop. Normally to connect I use openconnect
which works perfectly. Installing openconnect
is quite easy but to connect I follow below steps:
sudo openconnect https://xxxxx.xxxx.com.bd
I provide sudo password. Then I get below messages:
POST https://xxxxx.xxxx.com.bd/ Attempting to connect to server xxx.xxx.xxx.xx:443 SSL negotiation with xxxxx.xxxx.com.bd Server certificate verify failed: signer not found Certificate from VPN server "xxxxx.xxxx.com.bd" failed verification. Reason: signer not found Enter 'yes' to accept, 'no' to abort; anything else to view:
I type yes. Then I get below messages:
Connected to HTTPS on xxxxx.xxxx.com.bd Got HTTP response: HTTP/1.0 302 Object Moved GET https://xxxxx.xxxx.com.bd/ Attempting to connect to server xxx.xxx.xxx.xx:443 SSL negotiation with xxxxx.xxxx.com.bd Server certificate verify failed: signer not found Connected to HTTPS on xxxxx.xxxx.com.bd Got HTTP response: HTTP/1.0 302 Object Moved GET https://xxxxx.xxxx.com.bd/+webvpn+/index.html SSL negotiation with xxxxx.xxxx.com.bd Server certificate verify failed: signer not found Connected to HTTPS on xxxxx.xxxx.com.bd Please enter your username and password. GROUP: [GroupX1|GroupX2|GroupX3]:
Then I input group name. Then It prompts for username and password. I provide both and it gets connected perfectly and works fine.
Now what I want is I want to add some kind profile if possible (which is possible in Cisco anyconnect in Windows machine) so I'll provide just password and it'll automatically connect.
So how can I convert my anyconnect profile to openconnect compatible profile and how can I use it?
Another question is, how can I create and run a shell script with a hardcoded password so that I'll just run the script and it'll connect to VPN?
I searched a lot but I've not been able to automate this.