CAP_NET_BIND_SERVICE
Bind a socket to a privileged port (below 1024).
- Bit number
- 10
- Mask in /proc/PID/status
- 0000000000000400
- Added in Linux
- Original 2.2 set
- Group
- Network
The classic "do not run the web server as root" capability. Grant it on the binary with setcap, or as an ambient capability under a supervisor. Since Linux 4.11 there is also the net.ipv4.ip_unprivileged_port_start sysctl, which lowers the threshold for everyone in the network namespace instead of granting a capability to one process.
Narrower option: sysctl net.ipv4.ip_unprivileged_port_start (Linux 4.11) lowers the privileged-port threshold without any capability.
Check a running process with grep Cap /proc/PID/status, or paste the hex into the mask decoder.
Rod on this
Sources
Bit numbers are from linux/capability.h. The list of syscall cards is matched by name from the card text on this site, not from the kernel source. Spot one that's wrong? Tell Rod.