Connecting to OpenVPN 2 factor via network manager

I have been trying to figure out if there is a way to connect to an openvpn network using 2FA through the network manager in ubuntu.

Using the console I can connect and get the request for the 2FA code, but when trying to configure via the GUI it never asks for the 2FA code.

Grepping /var/syslog just shows the vpn asking for the google authenticator code, but I never receive the popup.


Solution 1:

It looks like support for two-factor authentication has been added to the network-manager-openvpn plugin as of version 1.2.10, released on May 17, 2017. (mentioned as support for dynamic challenge-response protocol in the NEWS file and the corresponding commit, and tracked by this issue)

However, it doesn't look like that version is available on any Ubuntu release currently, and I can't seem to find an up-to-date PPA for it, so you'll likely have to build it yourself in order to get it working.

In the meantime, you can use the openvpn command-line client; it will actually ask you for the 2FA code interactively, if your .ovpn file is set up correctly.