openvpn-install
openvpn-install copied to clipboard
OpenVPN Server not working in Arch Linux
Hi. I installed OpenVPN 3 months ago and today has stopped working (Arch Linux). I don´t touch nothing so I don´t know why OVPN not work. I tried to reinstall but doesn´t work. Ports opened.
I've installed it just now and it doesn't work (archlinux testing). Worked previously. Service failed to start
Feb 16 15:54:56 myhostname openvpn[464347]: Consider setting groups/curves preference with tls-groups instead of forcing a specific curve with ecdh-curve.
Feb 16 15:54:56 myhostname openvpn[464347]: Note: Treating option '--ncp-ciphers' as '--data-ciphers' (renamed in OpenVPN 2.5).
Feb 16 15:54:56 myhostname openvpn[464347]: Options error: --ca fails with 'ca.crt': Permission denied (errno=13)
Feb 16 15:54:56 myhostname openvpn[464347]: Options error: --cert fails with 'server_mJmlYr4kjNbKQ3WE.crt': Permission denied (errno=13)
Feb 16 15:54:56 myhostname openvpn[464347]: Options error: --key fails with 'server_mJmlYr4kjNbKQ3WE.key': Permission denied (errno=13)
Feb 16 15:54:56 myhostname openvpn[464347]: Options error: --status fails with '/var/log/openvpn/status.log': Permission denied (errno=13)
Feb 16 15:54:56 myhostname openvpn[464347]: Options error: Please correct these errors.
Feb 16 15:54:56 myhostname openvpn[464347]: Use --help for more information.
Feb 16 15:54:56 myhostname systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
Thanks for the report. PRs appreciated 🙏
It seems to be related to new permissions in OpenVPN 2.5.0-3.
Changing ownership of the relevant directories seems to fix this problem:
chown -R openvpn.network /etc/openvpn/client /etc/openvpn/server /var/log/openvpn
My reference: https://bbs.archlinux.org/viewtopic.php?id=262317
I have no idea if this is safe to do or permanent, but it does solve the errors at least.
sudo chown -R openvpn.network /var/log/openvpn /etc/openvpn/
worked for me
https://github.com/sansible/openvpn/issues/15
sudo chown -R openvpn.network /etc/openvpn/client /etc/openvpn/server /var/log/openvpn /etc/openvpn/ca.crt /etc/openvpn/server_*
My reference: journalctl -xeu openvpn-server@server
Yeah it fixed it for me putting the line in 925 right before it tries to install openvpn. I used: chown -R openvpn.network /etc/openvpn/ /var/log/openvpn/
I did the same as @gatosyperros but after installation.
chown -R openvpn.network /etc/openvpn/ /var/log/openvpn/
systemctl restart openvpn-server@server
I did the same as @gatosyperros but after installation.
chown -R openvpn.network /etc/openvpn/ /var/log/openvpn/ systemctl restart openvpn-server@server
Thanks. This worked for me :)
Doesn't work anymore :
$ sudo chown -R openvpn.network /var/log/openvpn /etc/openvpn/
chown: warning: '.' should be ':': « openvpn.network »
~~Same, has anyone found a fix for this new error? Changing as it says doesn't work either.~~ One of the other commands in here fixed it.
Same issue on Ubuntu 22 Server, and I can't use the fix above:
$ sudo chown -R openvpn.network /etc/openvpn/ /var/log/openvpn/
chown: invalid user: ‘openvpn.network’
Same issue on Ubuntu 22 Server, and I can't use the fix above:
$ sudo chown -R openvpn.network /etc/openvpn/ /var/log/openvpn/ chown: invalid user: ‘openvpn.network’
Your issue looks different than ours. Try enabling the OpenVPN service and see if you can connect without this fix. I'm not sure how to on Ubuntu.
@higgy999 Sorry, I have deleted the Ubuntu 22 instance since. I then tried on an Ubuntu 20 Server instance, and it worked.
Now that you say it though, I had to manually start the openvpn@server
service on Ubuntu 20, maybe I forgot this step on Ubuntu 22 :/ Doesn't it start automatically?
@higgy999 Sorry, I have deleted the Ubuntu 22 instance since. I then tried on an Ubuntu 20 Server instance, and it worked. Now that you say it though, I had to manually start the
openvpn@server
service on Ubuntu 20, maybe I forgot this step on Ubuntu 22 :/ Doesn't it start automatically?
It will once you enable it. The package may not have been set up to auto enable because there may be files you should edit first before it starts.
Ah, good point. So I can't be sure whether it would have actually worked on Ubuntu 22. Sorry for the noise.
I did the same as @gatosyperros but after installation.
chown -R openvpn.network /etc/openvpn/ /var/log/openvpn/ systemctl restart openvpn-server@server
worked for me on Arch ARM but instead of openvpn.network i just used openvpn