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.
    – mirec
    May 3, 2020 at 11:54

3 Answers 3


I found a solution by modifying manually the vpn configuration file in the /etc/NetworkManager/system-connections/ folder.

  1. First close any active VPN connection
  2. Close the VPN GUI
  3. Open with root privilege the file corresponding your VPN settings in the /etc/NetworkManager/system-connections/ folder,
  4. Then find the vpn-secrets section and add your credentials
  1. 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.
    – mirec
    Jul 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.
    – mantonovic
    Jul 4, 2020 at 5:11
  • 1
    FYI - if you open VPN GUI in step 4 after save but before reboot, the changes to the configuration file will be overwritten.
    – jws
    Mar 30, 2021 at 16:11
  • Thanks @jws I edited my aswer according to your suggestion
    – mantonovic
    Apr 1, 2021 at 9:35
  • 1
    If you don't want to reboot, sudo service network-manager restart also did the trick for me.
    – hife
    Mar 16 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.


I managed to make it without rebooting

killall -9 NetworkManager
nano whatever_openconnect.nmconnection
systemctl start NetworkManager

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.