Setup openvpn client on centos 6.4

ethrbunny asked:

Attempting to join a new CentOS 6.4 client to an existing OpenVPN network. Running service openvpn start gives the error:

Options error: In [CMD-LINE]:1: Error opening configuration file: client.conf
Use --help for more information

If I use

bash -vx service openvpn start

the service starts successfully.

If I run the cmd-line from the init.d script the service starts successfully.

It just doesn’t want to start like it needs to if this process is going to work at reboot.

I am using SELinux in enforcing mode but I’m not seeing any messages in /var/log/secure or /var/log/messages indicating that SELinux is getting involved.

Suggestions?

My answer:


The SELinux contexts on your OpenVPN configuration and certificate files are incorrect. Most likely this is because you moved them into place instead of copied them.

To resolve the issue, restore their default security contexts (this is safe to do even if they already have the right security context). This command will recursively fix the security contexts on /etc/openvpn and every file and directory under it.

restorecon -r -v /etc/openvpn

View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.