When I log in to my computer, I would like to automatically connect to my university’s VPN. This almost works, only thing missing is that Network Manager doesn’t seem to remember my username.
Software in use: openSUSE Tumbleweed, Gnome, Network Manager and the openconnect-vpn plugin for Network Manager
Network connections set up in Network Manager: A Wired Connection and a VPN Connection, I told the Wired Connection to connect automatically and to automatically pull in the VPN Connection as well.
When I try to connect to the VPN the first time, I enter a username and password for the VPN connection in a dialog of the openconnect plugin (nm-openconnect-auth-dialog). Then when I reboot the system, the connection is not re-established and when I hit connect, the dialog comes back up and I see it remembered my password but not my username.
Now here’s what I found out so far:
- Network Manager created configuration files for the two connections, I posted them below.
- The VPN password got stored in my GNOME keyring, I can see it there, but it is only the password
- I found an old VPN connection configuration file on a different account on my computer in which the username was stored. I tried to alter my current VPN connection configuration file so as to remember the username like I saw in that file but that didn’t work: Network Manager removed all lines I manually added. (See below for information on what contents were different)
- I looked into my GNOME keyring if I could add username information to the VPN password similar as described in https://forum.kde.org/viewtopic.php?f=18&t=121409but Seahorse only let me alter the password, nothing else.
Here are the two connection configuration files that Network Manager created (I x’d out my username and the VPN hostname):
[connection] id=Wired uuid=fd0449ea-7d62-441c-a2d7-d176ec772617 type=ethernet permissions=xxxxxxxxx:; secondaries=29ed565d-bf5b-45f8-b64d-e832ca4825d7; timestamp=1556814674 [ethernet] mac-address=2C:41:38:9B:F4:10 mac-address-blacklist= [ipv4] dns-search= method=auto [ipv6] addr-gen-mode=stable-privacy dns-search= ip6-privacy=0 method=auto
[connection] id=VPN Connection uuid=29ed565d-bf5b-45f8-b64d-e832ca4825d7 type=vpn autoconnect=false permissions=xxxxxxxxxx; timestamp=1556814674 [vpn] authtype=password autoconnect-flags=0 certsigs-flags=0 cookie-flags=2 enable_csd_trojan=no gateway=xxxxxxxxxxx gateway-flags=2 gwcert-flags=2 lasthost-flags=0 pem_passphrase_fsid=no protocol=anyconnect stoken_source=disabled xmlconfig-flags=0 service-type=org.freedesktop.NetworkManager.openconnect [vpn-secrets] lasthost=xxxxxxxxxxxx [ipv4] dns-search= method=auto [ipv6] addr-gen-mode=stable-privacy dns-search= method=auto
Here’s an excerpt of the configuration file I found on a different account:
[vpn-secrets] form:main:group_list=SSL form:main:username=xxxxx lasthost=xxxxxxxx save_passwords=yes
The line “form:main:username=xxxxx” looked especially promising, so I copied it into my current VPN connection configuration file (the one posted above), but when I re-connected to the VPN, the line got removed again…
Any suggestions on how I can get Network Manager to remember my username?