Is there a way for non-root processes to bind to “privileged” ports on Linux?

It’s very annoying to have this limitation on my development box, when there won’t ever be any users other than me.

I’m aware of the standard workarounds, but none of them do exactly what I want:

  1. authbind (The version in Debian testing, 1.0, only supports IPv4)
  2. Using the iptables REDIRECT target to redirect a low port to a high port (the “nat” table is not yet implemented for ip6tables, the IPv6 version of iptables)
  3. sudo (Running as root is what I’m trying to avoid)
  4. SELinux (or similar). (This is just my dev box, I don’t want to introduce a lot of extra complexity.)

Is there some simple sysctl variable to allow non-root processes to bind to “privileged” ports (ports less than 1024) on Linux, or am I just out of luck?

EDIT: In some cases, you can use capabilities to do this.

25 Answers
25

Leave a Comment