Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to store server key permanently? openconnect

Tags:

bash

terminal

vpn

Is there a way to store the server key after a successful connection, the way ssh does?

No matter how many times I connect, I have to always type "yes" to accept the server key. I wish it would be accepted and stored forever.

###############################
amir@amirpc:~$ sudo openconnect uk.cisadd.com -u myusername
POST https://uk.cisadd.com/
Attempting to connect to server xxx.xxx.xxx.xxx:443
SSL negotiation with uk.cisadd.com
Server certificate verify failed: signer not found

Certificate from VPN server "uk.cisadd.com" failed verification.
Reason: signer not found
Enter 'yes' to accept, 'no' to abort; anything else to view: 

Connected to HTTPS on XXX.XXX.XXX.XXX
###############################

can write bash script to run openconnect and escape yes?

like image 289
Amir Abdollahi Avatar asked Jun 29 '15 10:06

Amir Abdollahi


1 Answers

best way is first time you login into server save your --servercert in clipboard like this

echo "password" | sudo openconnect  -u username  uk2.cisadd.com --servercert sha25:xxxxxxx
like image 189
Behroozam Avatar answered Nov 08 '22 09:11

Behroozam