Skip to main content


Dear Linux, Privileged Ports Must Die

https://ar.al/2022/08/30/dear-linux-privileged-ports-must-die/

#Linux #PrivilegedPortsMustDie

Aral Balkan reshared this.

in reply to Aral Balkan

my first thought was "uh, what?!"

But starting unprivileged at 80 sounds good.

I would not want unprivileged to start at 22, though: SSH must stay in the domain of root because it is how any other user can log in.

If it gives privilege, it should be a privileged port.
in reply to Arne Babenhauserheide

@ArneBab Yeah, I’m totally fine with that (and that’s probably going to be a sticking point for a lot of folks and isn’t the hill I wish to die on. More than happy with 80.)
in reply to Aral Balkan

The first UNIX TCP/IP implementation was released in 1983.
in reply to Lars Lehtonen

@alrs Thanks, Lars, appreciate the fact checking (it was the one bit I couldn’t find a proper source for and, after your post, some more digging brought up the original implementation). I’ve updated the post accordingly; appreciate it :)

https://ar.al/2022/08/30/dear-linux-privileged-ports-must-die/
Unknown parent

Aral Balkan
@shortwavesurfer2009 That (badly-named setting) works for both 🤷‍♂️
Unknown parent

Aral Balkan
@mxm Yeah, that’s what led me to using sysctl in the first place :) https://source.small-tech.org/site.js/app/-/issues/169
Unknown parent

in reply to Aral Balkan

You can do this for specific executables using "setcap 'cap_net_bind_service=+ep' /path/to/program"

Or (not to get tangled in another discussion about this) but if you launch with a systemd service you can put AmbientCapabilities=CAP_NET_BIND_SERVICE in your [Service] section
in reply to BrightSide

@brightside Yeah, I know :)

https://source.small-tech.org/site.js/app/-/issues/169
in reply to Aral Balkan

Yes to all of this.

I didn't know it was configurable. This is a huge deal. Thank you!
in reply to Aral Balkan

Thanks aral for this food for thought.
I had never considered it.