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

后端 未结 24 1263
予麋鹿
予麋鹿 2020-11-22 02:04

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 non

24条回答
  •  一向
    一向 (楼主)
    2020-11-22 02:53

    Or patch your kernel and remove the check.

    (Option of last resort, not recommended).

    In net/ipv4/af_inet.c, remove the two lines that read

          if (snum && snum < PROT_SOCK && !capable(CAP_NET_BIND_SERVICE))
                  goto out;
    

    and the kernel won't check privileged ports anymore.

提交回复
热议问题