Starting openvpn error: "Please enter password with the systemd-tty-ask-password-agent"

I've just upgraded to 15.10 (and yes I plan to go to 16.04 next time I have a little free time). I've been using openvpn to connect to a work VPN for years and years via a .ovpn config file that's always worked.

Now, however, something having to do with systemd seems to have changed the way things work. When I try to start it, I get a message broadcast out via wall:

Broadcast message from root@turandot (Sun 2016-05-01 10:25:50 CDT):

Password entry required for 'Enter Auth Username:' (PID 17284). Please enter password with the systemd-tty-ask-password-agent tool!

I've googled around for it and found nothing that seems like a solution to the problem. What's the new way to open a VPN connection?


This happens since Ubuntu 15.10 uses systemd to start openvpn. Following seems to work me for me. After you start openvpn and get the error message from the terminal do the following

sudo systemd-tty-ask-password-agent

You will be prompted to enter your username. Now type in the same command again

sudo systemd-tty-ask-password-agent

This time you will be prompted to enter your password. After entering the password start the vpn connection again. For me I do it with the following command

sudo service openvpn start

Now it should connect successfully.


I know is old but, it may help someone... The way that I did to fix it (unfortunately I don't remember where I got the information) You can do this:

sudo systemctl disable systemd-ask-password-wall.service
sudo systemctl disable systemd-ask-password-wall.path
sudo systemctl stop systemd-ask-password-wall.service
sudo systemctl stop systemd-ask-password-wall.path
sudo systemctl enable systemd-ask-password-console.service
sudo systemctl start systemd-ask-password-console.service

create a file: /etc/openvpn/pass(or wherever you want) put the passphrase and in the server.conf add, don't forget to secure pass file (sudo chmod 400 pass)

askpass pass

Every time on startup, I was asked to "Enter Auth Username" and "Enter Auth Password" and I periodically got the same messages in the terminal as OP did. I can just hit Enter or type in whatever I want, it makes no difference. (Ubuntu 17.10 and 18.04)

So instead of "reinstalling the whole OS", I just commented out the line auth-user-pass in /etc/openvpn/client.conf

Now, the messages both on startup and in the terminal don't bother me anymore.