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

Application runs as root on Linux #887

Open
mstorck opened this issue Mar 25, 2024 · 3 comments
Open

Application runs as root on Linux #887

mstorck opened this issue Mar 25, 2024 · 3 comments

Comments

@mstorck
Copy link

mstorck commented Mar 25, 2024

When installing the app via the install script, the application will run as root user.

If possible make the application run as a non-privileged user.

@Wrong-Code
Copy link

AFAIK you can run Technitium DNS as an unprivileged user of your choice, but you will have to give that user/group permissions on the Technitium DNS directories (/etc/dns and /opt/technitium/dns), plus you will have to change the configuration of the service (systemd or any other way you start it) by specifying the new uid/gid.

However, the above works as long as you open a non-standard DNS port whose value is above 1024. If you need to open the standard DNS port (53) you will have to give the dotnet executable the capability to open privileged ports. Something like:

sudo setcap CAP_NET_BIND_SERVICE=+eip $(realpath $(which dotnet))

Be aware that by doing that you will give the privilege to any .NET application running on the host, not just to Technitium DNS.

@ShreyasZare
Copy link
Member

Thanks for the request. Will get the script updated in later releases.

@mstorck
Copy link
Author

mstorck commented Mar 26, 2024

I can confirm that the tips provided by @Wrong-Code do work when manually applied, @ShreyasZare I'm willing to test pre-release versions of a new install script.

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

3 participants