I have a openvpn set up with 2 factor authentication via Google Authenticator app.
In connection details I filled User name and Password (User key password empty). When I login for the 1st time I get popup to fill in authentication code from Google app. After I do that though, the passwords gets overriden with this number code from the app. So next time I try to login there is popup for password and after that another popup for the Google app.
Can this be somehow fix to either:
- save the password and show popup only for Google app
- save the password and use some sort of script/app/hack so the authentication code from Google is filled automatically? (So I don't have to deal with popups? :) )
It's fresh installation of Ubuntu 19.10
91 Answer
It's not solution, but workaround
Guide
Expected that VPN successfully configured.
Note: select "Store the password for all users"
Get the list of VPN connections in command line, and find the target connection:
nmcli connection showCreate a post-down script file, which will run every time when connection closed:
sudo touch /etc/network/if-post-down.d/overwrite-vpn-passwordPut next content inside:/etc/network/if-post-down.d/overwrite-vpn-password
#!/bin/sh nmcli connection modify NAME_OR_UUID vpn.secrets password=MY_PASSWORDMake file executable:
sudo chmod +x /etc/network/if-post-down.d/overwrite-vpn-passwordDone!
What's happen?
When you enter 2FA code, and VPN connection succeed, it updates secret password. This script will be executed every time when ANY connection closed (VPN for example), and will modify secrets of connection config using nmcli with hardcoded values.
3