System info:

Distributor ID: Ubuntu | Ubuntu 14.04.5 LTS | Release: 14.04 | Codename: trusty


I am having trouble. I am trying to get openVPN and I am following this guide here: Link to guide.

I have successfully done the first two commands, but when I do this code:

gunzip -c /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz > /etc/openvpn/server.conf

I get an error: `bash: /etc/openvpn/server.conf: Permission Denied.

Can anybody help? Feel free to ask for additional information.


You can't write into the /etc/ directory without using sudo. The guide omits this little fact in many cases. Notice the first command apt-get update which also won't work without sudo. I think the guide assumes you are logged in as root.

Modify the command as follows:

gunzip -c /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz | sudo tee /etc/openvpn/server.conf

  • I did instead of gunzip, I did sudo sh and still got the same error but I haven't done it with gunzip. Thanks, i'll try it. – Caleb H Jun 19 '17 at 0:57
  • 1
  • The redirection (>/etc/openvpn/server.conf) is done while parsing the sudo ..., and is owned by the non-root user. gunzip -c /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz | sudo tee /etc/openvpn/server.conf >/dev/null – waltinator Jun 19 '17 at 1:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.