Skip to content

Bind Priviledged Prots

setcap

setcap 'cap_net_bind_service=+ep' /path/to/program

autobind

see man 1 autobind

sysctl

sysctl net.ipv4.ip_unprivileged_port_start=80

or persistent

sysctl -w net.ipv4.ip_unprivileged_port_start=80.

Danger

Not a good idea; it allows binding of all ports starting at 80 as non-privileged. Instead, consider making exceptions for an app or for container binding.