Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenVPN Server not working in Arch Linux #788

Open
OnePerson10 opened this issue Jan 17, 2021 · 17 comments
Open

OpenVPN Server not working in Arch Linux #788

OnePerson10 opened this issue Jan 17, 2021 · 17 comments

Comments

@OnePerson10
Copy link

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.

@luntik2012
Copy link

luntik2012 commented Feb 9, 2021

I've installed it just now and it doesn't work (archlinux testing). Worked previously. Service failed to start

@luntik2012
Copy link

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]: openvpn-server@server.service: Main process exited, code=exited, status=1/FAILURE

@angristan
Copy link
Owner

Thanks for the report. PRs appreciated 🙏

@0x000C
Copy link

0x000C commented Mar 16, 2021

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.

@luntik2012
Copy link

luntik2012 commented Mar 16, 2021

sudo  chown -R openvpn.network /var/log/openvpn /etc/openvpn/

worked for me

sansible/openvpn#15

@sokoloowski
Copy link

sokoloowski commented Aug 10, 2021

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

@gatosyperros
Copy link

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/

@mukkumayc
Copy link

mukkumayc commented Jan 21, 2022

I did the same as @gatosyperros but after installation.

chown -R openvpn.network /etc/openvpn/ /var/log/openvpn/
systemctl restart openvpn-server@server

@smamun19
Copy link

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 :)

@kikislater
Copy link

Doesn't work anymore :

$ sudo  chown -R openvpn.network /var/log/openvpn /etc/openvpn/
chown: warning: '.' should be ':': « openvpn.network »

@joshuafhiggins
Copy link

joshuafhiggins commented Jul 7, 2022

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.

@BenMorel
Copy link

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’

@joshuafhiggins
Copy link

joshuafhiggins commented Jul 10, 2022

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.

@BenMorel
Copy link

@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?

@joshuafhiggins
Copy link

@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.

@BenMorel
Copy link

Ah, good point. So I can't be sure whether it would have actually worked on Ubuntu 22. Sorry for the noise.

@y0nei
Copy link

y0nei commented Aug 27, 2022

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

playday3008 added a commit to playday3008/openvpn-install that referenced this issue Sep 23, 2022
Improve: Write client files near the script
Fix: angristan#788
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests