OpenVPN: Read certificate passphrase from file


when you establish a OpenVPN connection with a password protected ceritificate you have enter the passphrase each time when OpenVPN starts.

This isn’t nice if you want to connect at system startup without an user interaction.

It’s possible to store the password in a file and the OpenVPN Service/daemon reads the password from there.

An example. Create a file /etc/openvpn/stdin.txt and write the password in the first line of the file. Append the following directive to the OpenVPN config file:
askpass "/etc/openvpn/stdin.txt"

Similar in Windows. Create a file C:\Program Files\OpenVPN\config\stdin.txt, insert your passphrase and append

askpass "C:\\Program Files\\OpenVPN\\config\\stdin.txt"

to your config.

Note: It’s strongly recommended to set file permissions on the password file that only the OpenVPN daemon respectively service user can read this!


Advertisment to support

One thought on “OpenVPN: Read certificate passphrase from file”

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.