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

Is it possible to run as non root? #142

Open
gudata opened this issue Jan 25, 2023 · 1 comment
Open

Is it possible to run as non root? #142

gudata opened this issue Jan 25, 2023 · 1 comment

Comments

@gudata
Copy link

gudata commented Jan 25, 2023

Is there any chance that you don't run this service as root?
Managing the wg0.conf files could be done via dedicated user.
restarting the interface could be done via systemd.path file.
and for accessing the wireguard api - probably it would work as normal user.

@gudata gudata changed the title Running as root is not good practice Is it possible to run as non root? Jan 25, 2023
Repository owner deleted a comment from Masgalor Feb 14, 2024
@h44z
Copy link
Owner

h44z commented Feb 14, 2024

Sorry, accidentally deleted a commen from Masgalor:

I don't know if this issue is still relevant today.
But for everyone looking for an answer to this question, there is no problem running with an unprivileged user.

You need to:

  • change the permissions of /etc/wireguard to write the config files there
    OR
  • write them to some other location and link them there
    AND
  • Give your user or process CAP_NET_ADMIN and CAP_NET_RAW capabilities.

At least thats what I do, maybe I am missing something but everything works as expected for me.
I use the binary in a systemd-service, no idea how this translates to docker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants