This might be a duplicate of this question, but I am not proficient enough in networking matters to tell for sure.
I use a VPN service named Cyberghost to stay private on the internet. After facing DNS leaks when using network-manager
I tried using the command line and implement fixes promoted online. Aparantly block-outside-dns
works on windows only. Therefore I followed this tutorial and added the lines
script-security 2
up /etc/resolv.conf
down /etc/resolv.conf
to the .ovpn file provided by cyberghost.
When trying to connect using
sudo openvpn --config /home/username/CG/DE/DE.ovpn
however I get the following error:
Options error: --up script fails with '/etc/resolv.conf': Permission denied
Options error: Please correct this error.
Use --help for more information.
Connecting without the up and down command works fine but causes dns leaks. I do not encounter problems manually editing resolv.conf
using sudo privilleges therefore I am unsure why openvpn should lack the permission to do so.
Thank you for your thoughts and your help,
Alex
System: Kubuntu 17.04
openvpn 2.4.0-4ubuntu1.3
The full .ovpn-file is as follows:
client
remote 1-de.cg-dialup.net 443
dev tun
proto udp
auth-user-pass /home/username/CG/DE/auth.txt
resolv-retry infinite
redirect-gateway def1
persist-key
persist-tun
nobind
cipher AES-256-CBC
auth MD5
ping 5
ping-exit 60
ping-timer-rem
explicit-exit-notify 2
script-security 2
remote-cert-tls server
route-delay 5
tun-mtu 1500
fragment 1300
mssfix 1300
verb 4
comp-lzo
ca /home/username/CG/DE/ca.crt
cert /home/username/CG/DE/client.crt
key /home/username/CG/DE/client.key
script-security 2
up /etc/resolv.conf
down /etc/resolv.conf