MENU

Systemd 中绑定特权端口(低位端口)

用户态程序如果要绑定 低位端口 即小于 1024 的端口 ,
Linux 会提示: Permission Denied

解决方法

在目标的 foobar.service 中,加入:

[Service]
AmbientCapabilities=CAP_NET_BIND_SERVICE
Last Modified: March 23, 2022