Openvpn Error opening configuration file:

centos7configurationopenvpn

I just set up openvpn with this script on clean centos 7. And I can't connect to server. I got following error in journalctl -xn

05:18:39 localhost.localdomain openvpn[1433]: Options error: In [CMD-LINE]:1: Error opening configuration file: localhost.conf

My configuration file in /etc/openvpn folder is server.conf. How can I solve this issue?

Best Answer

I was having the same issue here, 3 years later, so I'll post the answer here.

If you're able to run/test using "openvpn --config ", but systemd keeps telling you that there's an error in the first line, it's not. It's SELinux fault.

For a simple way to test this hypothesis you can set selinux in permissive mode instead of enforcing and after a reboot you'll see openvpn up and running.

After that you can fiddle around your selinux rules if you want to/if it's the real deal server or just keep as it is if you don't care about it.