I recently have upgraded to Ubuntu 20.04. Everything works fine except that every time I want to connect to a VPN network with openconnect I have to enter My username and It asks me to validate the certificate. I connect to VPN network using a gnome plugin for openconnect: "network-manager-openconnect-gnome". This can be very frustrating since I have to switch between VPN connection and normal Internet connection frequently.
-
similar problem here after upgrade to 20.04. Openconnect never connect automatically even when it has username and password. "Contacting host, please wait..." probably timeouts after few seconds and I need to click "Login" button to connect. No need to enter password as it is remembered and pre-populated in field.– mirecMay 3, 2020 at 11:54
Add a comment
|
3 Answers
I found a solution by modifying manually the vpn configuration file in the /etc/NetworkManager/system-connections/
folder.
- First close any active VPN connection
- Close the VPN GUI
- Open with root privilege the file corresponding your VPN settings in the
/etc/NetworkManager/system-connections/
folder, - Then find the vpn-secrets section and add your credentials
[vpn-secrets]
form:main:group_list=FOO
form:main:[email protected]
lasthost=vpn.bar.net
save_passwords=yes
- Save, close (don't open VPN GUI before reboot) and reboot
Enjoy your automatic VPN login..
-
Similar problem here after upgrade to 20.04. Username and password are saved, however it doesn't connect automatically. "Contnacting host, please wait..." is shown for few seconds, then "Please enter your username and password" with only Password: field with pre-filled password is shown. I do not need to change anything but have to click [Login] to connect finally.– mirecJul 1, 2020 at 19:47
-
That's the situation I had before modifying the file representing the vpn connection in the "system-connections" folder. Are you sure that you have modified the correct file? Because in that folder you can find many files and if you changed the wrong one, of course it wont work. Jul 4, 2020 at 5:11
-
1FYI - if you open VPN GUI in step 4 after save but before reboot, the changes to the configuration file will be overwritten.– jwsMar 30, 2021 at 16:11
-
-
1If you don't want to reboot,
sudo service network-manager restart
also did the trick for me.– hifeMar 16, 2022 at 9:23
For some reason I could not get this to work by editing the file. However the workaround by Etienne CHAMPETIER
, from https://bugzilla.redhat.com/show_bug.cgi?id=1332491#c24 works:
nmcli con mod VPNNAME vpn.secrets 'form:main:group_list=GROUPNAME','form:main:username=USERNAME','save_passwords=yes'
I had to setup group_list, username and save_passwords.
-
1I did not need the group_list part so my command was
sudo nmcli con mod MYVPN vpn.secrets 'form:main:username=MYUSER','save_passwords=yes'
Replacing MYVPN and MYUSER with my details– flurdyNov 9, 2020 at 12:06 -
Gnome bug: gitlab.gnome.org/GNOME/gnome-shell/-/issues/2105 Networkmanager bug: gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/…– flurdyNov 9, 2020 at 12:09
-
thnx,
save_passwords=yes
was not needed in my case... also: you can addpassword=<xxx>
...– ntgMar 10, 2022 at 20:19 -
-
IDK, but I am prompted to choose a group, see also the screenshots here answers.uillinois.edu/page.php?id=47507 May 20, 2022 at 4:40
I managed to make it without rebooting
killall -9 NetworkManager
nano whatever_openconnect.nmconnection
systemctl start NetworkManager