You are not logged in.

#1 2015-09-23 08:44:20

simonvik
Member
Registered: 2015-09-23
Posts: 2
Website

Openvpn (2.3.8-1) client, ask for password

I'm having problems with the latest openvpn client when running it as a systemd-unit.
The service fails to ask for password with error :

neither stdin nor stderr are a tty device, can't ask for Private Key password.  If you used --daemon, you need to use --askpass to make passphrase-protected keys work, and y...e --auth-nocache.

The unit-file i run looks like:

[Unit]
Description=OpenVPN connection to %i
After=network.target
Requires=systemd-ask-password-wall.service

[Service]
Type=forking
ExecStart=/usr/bin/openvpn --askpass --cd /etc/openvpn/%i --config /etc/openvpn/%i/openvpn.conf --daemon openvpn@%i
[Install]
WantedBy=multi-user.target

I have also tried the openvpn-upstream unit file openvpn-client@.service at github and that fails too .

Does anyone have a solution to this error, or do you experience this your self?

Offline

#2 2015-09-23 16:03:04

jonlorusso
Member
Registered: 2013-12-29
Posts: 7

Re: Openvpn (2.3.8-1) client, ask for password

Same issue here.

Offline

#3 2015-09-23 17:47:57

brebs
Member
Registered: 2007-04-03
Posts: 3,742

Offline

#4 2015-09-23 18:33:05

simonvik
Member
Registered: 2015-09-23
Posts: 2
Website

Re: Openvpn (2.3.8-1) client, ask for password

Checked a bit more, Im pretty sure that the following code broke it :

+#ifndef WIN32
+         /* did we --daemon'ize before asking for passwords? */
+         if ( !isatty(0) && !isatty(2) )
+           { msg(M_FATAL, "neither stdin nor stderr are a tty device, can't ask for %s password.  If you used --daemon, you need to use --askpass to make passphrase-protected keys work, and you can not use --auth-nocache.", prefix ); }
+#endif

They changed how they daemonize and they added this check to make sure that they ask for password before forking.
Openvpn supports systemd-ask-pass but this code gets executed before that.

Removing the code + setting "--askpass" solves the issue.

Offline

#5 2015-09-24 16:34:23

tomaszc
Member
Registered: 2010-09-11
Posts: 19

Re: Openvpn (2.3.8-1) client, ask for password

Offline

Board footer

Powered by FluxBB