Is there a way to get an app to run on port 80 without being forced to run it as root?
I don't want to run the process as root because that's insecure, and I want to use port 80. I don't want to use a proxy in front of the app.
Apache for example starts as root and drops privileges, is there a way to achieve this in Mono?
For context I'm running ServiceStack, but I'm asking in general as well.
OK I finally accomplished this using authbind
Worked like a charm. Only thing to note is that you MUST use the --deep
switch since mono actually runs another process. That was an annoying gotcha that wasted an hour or so.
So final command looks something like:
sudo -u myapp authbind --deep ./MyApp.exe
I used the by uid approach of authbind so this is the config:
/etc/authbind/byuser/999:
0.0.0.0,80-89
The bottom line is that trying to find an answer to this question in the context of Mono only is futile - simply replace "Mono"
with "Java"
in your searches and the solutions for Java/Tomcat are mostly applicable to Mono as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With