Answer the question
In order to leave comments, you need to log in
How to give a user access to port 80 in Linux?
A program that tries to occupy port 80 (for example, apache) can be run as root.
But it can't be run as a different user. Error No privileges for this operation.
How to give the user access to these privileges?
Don't suggest the sudo command as I need to get rid of the need to enter any passwords.
Answer the question
In order to leave comments, you need to log in
➜ ~ sudo cat /etc/sudoers | grep miraage
miraage ALL=(ALL) NOPASSWD: ALL
Well, the answer is googled.
Now for the caveats:
- You will need at least a 2.6.24 kernel
- This won't work if your file is a script. (ie, uses a #! line to launch an interpreter). In this case, as far I as understand, you'd have to apply the capability to the interpreter executable itself, which of course is a security nightmare, since any program using that interpreter will have the capability. I wasn't able to find any clean, easy way to work around this problem.
- Linux will disable LD_LIBRARY_PATH on any program that has elevated privileges like setcap or suid. So if your program uses its own .../lib/, you might have to look into another option like port forwarding.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question