Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Run app from unprivileged user #5450

Closed
3 tasks done
ammnt opened this issue Feb 4, 2023 · 6 comments
Closed
3 tasks done

Run app from unprivileged user #5450

ammnt opened this issue Feb 4, 2023 · 6 comments
Labels

Comments

@ammnt
Copy link

ammnt commented Feb 4, 2023

Prerequisites

  • I have checked the Wiki and Discussions and found no answer

  • I have searched other issues and found no duplicates

  • I want to report a bug and not ask a question

Operating system type

Linux, Other (please mention the version in the description)

CPU architecture

AMD64

Installation

GitHub releases or script from README

Setup

On one machine

AdGuard Home version

0.107.23

Description

No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
Linux dns.msftcnsi.com 5.10.0-21-amd64 #1 SMP Debian 5.10.162-1 (2023-01-21) x86_64 GNU/Linux

I'm trying to run the app from unprivileged user. What I exactly do:

  • added system user (Debian) adguard with system group adguard
  • make 'setcap -r 'CAP_NET_BIND_SERVICE=+eip CAP_NET_RAW=+eip' ./AdGuardHome' from root user
  • chown app directory to adguard user: chown -R adguard:adguard /opt/AdGuardHome
  • change user and group fields in the .yaml config file to adguard (also tried UID and GID after that)

Still no success because:
[fatal] listen tcp 0.0.0.0:80: bind: permission denied

The verbose log is attached. Anyone tried it before?

Thank you.
Best regards!

@ammnt
Copy link
Author

ammnt commented Feb 4, 2023

2023-02-04_19-16-57

@ainar-g
Copy link
Contributor

ainar-g commented Feb 5, 2023

make 'setcap -r 'CAP_NET_BIND_SERVICE=+eip CAP_NET_RAW=+eip' ./AdGuardHome' from root user

Perhaps the Debian setcap is different from the Ubuntu one, but doesn't -r remove capabilities? What I do is:

sudo setcap 'cap_net_bind_service+ep cap_net_raw+ep' ./AdGuardHome

@ainar-g ainar-g added the waiting for data Waiting for users to provide more data. label Feb 5, 2023
@ammnt
Copy link
Author

ammnt commented Feb 5, 2023

@ainar-g, unfortunately I have the same result with these flags:
image

@ainar-g
Copy link
Contributor

ainar-g commented Feb 5, 2023

Sorry, I'm not sure what it could be then. Other than if you run it as a service, systemd might interfere with that somehow (systemctl daemon-reload?).

@ammnt
Copy link
Author

ammnt commented Feb 5, 2023

@ainar-g, nope. Nothing changed☹️

@ainar-g
Copy link
Contributor

ainar-g commented Feb 5, 2023

I'll move this to discussions then, if you don't mind, as I don't think that it's an AdGuard Home issue.

@AdguardTeam AdguardTeam locked and limited conversation to collaborators Feb 5, 2023
@ainar-g ainar-g converted this issue into discussion #5452 Feb 5, 2023
@ainar-g ainar-g added question and removed waiting for data Waiting for users to provide more data. labels Aug 25, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

2 participants