Currently I am using the following command for executing authentication request to obtain the server certificate (FINGERPRINT) and
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
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:
GROUP: [tunnel MyCompany|tunnel all]:, answer-insertion should be
Password:, answer-insertion should be