I'm working on running an OpenVPN client on a centos 7 system. If i start openvpn manually like this
sudo openvpn --config configFile
it connects correctly. However when I try to connect as a service it fails saying
Error opening 'Auth' auth file: userpasswordfile: Permission denied (errno=13)
. I've tried a bunch of different permissions on the file but none work as the service. Any recommendations on how to get it working? Here is my config file
dev tun
persist-tun
persist-key
cipher AES-256-CBC
auth SHA512
tls-client
client
resolv-retry infinite
remote ip port udp
lport 0
verify-x509-name "cert" name
auth-user-pass /etc/openvpn/userpasswordfile
pkcs12 cert.p12
tls-auth keys.key 1
ns-cert-type server
comp-lzo adaptive
and here is the service file:
[Unit]
Description=OpenVPN Robust And Highly Flexible Tunneling Application On %I
After=network.target
[Service]
PrivateTmp=true
Type=forking
PIDFile=/var/run/openvpn/%i.pid
ExecStart=/usr/sbin/openvpn --daemon --writepid /var/run/openvpn/%i.pid --cd /etc/openvpn/ --config /etc/openvpn/config.conf
[Install]
WantedBy=multi-user.target