Currently I am using the following command for executing authentication request to obtain the server certificate (FINGERPRINT) and OpenConnect
-Cookie:
openconnect --authenticate --user=<username> "VPN host"
Hereby I always have to enter my password in a later appearing user prompt.
Is there an option available to pass-over the password to OpenConnect
already in the upper command?
For example, by extending the command like...
openconnect --authenticate --user=<username> password=<password> "VPN host"
... ?
The challenge is:
The user RuiFRibeiro had the idea just to echo the password within the command. Unfortunately this does not work in our case, because the server provides one more user prompt before reaching the second prompt (= password prompt).
It will happen like that:
First user prompt: Server saying
- "Please choose if you want to tunnel all traffic or only specific one.
- "Type in
Tunnel all
orTunnel company
".
Second user prompt: Server is saying
- "Please enter your password."
As you can see, a simple echo
would give the wrong answer to the wrong question. :-)
For a possible expect
-script the real (exact) server request before inserting text is like followed:
First prompt:
GROUP: [tunnel MyCompany|tunnel all]:
, answer-insertion should betunnel MyCompany
Second prompt:
Password:
, answer-insertion should be123456789