OpenVPN: An error has occured whilst trying to connect to OpenVPN

Don’t forget also to ‘sudo chmod 400 login.conf’.

Also you may want to look at my thread on how to defeat DNS leaks:

If you do that, in order to edit all the ovpn files in one go, I’ve found the following command useful. Change to your /etc/openvpn directory and type

sudo sh -c 'for filename in *.ovpn; do  echo "script-security 2\nup /etc/openvpn/update-resolv-conf\ndown /etc/openvpn/update-resolv-conf" >> $filename; done'

Don’t forget to edit your /etc/openvpn/update-resolve-conf file and add the two lines shown in the last post in that thread, that way when you disconnect OpenVPN your DNS will go back to your default setting.