I'm trying to start a client on Linux (NixOS) using systemd:
systemctl start openvpn-myclient.service
My private key has a passphrase, but I'm not being prompted for it.
Running systemctl status shows systemd-ask-password waiting for input:
systemctl status openvpn-myclient.service
● openvpn-myclient.service - OpenVPN instance ‘myclient’
...
CGroup: /system.slice/openvpn-myclient.service
├─11060 openvpn --suppress-timestamps --config /nix/store/...-openvpn-config-myclient
└─11061 /nix/store/...-systemd-238/bin/systemd-ask-password --icon network-vpn Enter Private Key Password:
If I run openvpn directly on the command line, I am prompted for a password and all works as expected.
sudo openvpn --config /nix/store/...-openvpn-config-myclient
I tried adding askpass to my client config, but that didn't make a difference.
So far the only way I've found to successfully start the client using systemctl is by adding askpass /path/to/myprivate.key to the client config, but this means keeping the pass phrase in a plaintext file.
I found an old bug-ticket reporting the same issue, but it's been marked resolved and it sounds like this was fixed in version 2.3.4 (I'm running 2.4.6).
https://community.openvpn.net/openvpn/ticket/437
Though it sounds like the fix requires that openvpn is built using --enable-systemd, mine was built with that option enabled.
I'd be grateful if anyone can point me in the right direction. I'd be happy to post my client config if that helps.