绑定在Mac OS X 10.6上的特权端口(端口

时间:2022-11-17 01:07:52

Do you know how to remove restriction on binding to ports < 1024 with a user account that is not root on Mac OS X?

您是否知道如何使用非Mac OS X root用户帐户删除对端口<1024的绑定限制?

1 个解决方案

#1


2  

The best way is to leverage launchd. The restriction on binding to ports < 1024 will still be there and is not likely to go anywhere, but if your app requests elevated privileges once in order to add the necessary launchd configuration, then you can let launchd do the actual listening on the privileged port and pass the socket to your app when appropriate.

最好的方法是利用launchd。绑定到端口<1024的限制仍然存在,并且不太可能去任何地方,但如果您的应用程序为了添加必要的launchd配置而请求提升的权限一次,那么您可以让launchd在特权端口上进行实际侦听并在适当时将套接字传递给您的应用程序。

See the section on launchd in this OS X Developer Library reference, and the further references given there for learning more about launchd and how to use it safely.

请参阅此OS X开发人员库参考中有关launchd的部分,以及其中提供的更多参考资料,以了解有关launchd以及如何安全使用它的更多信息。

#1


2  

The best way is to leverage launchd. The restriction on binding to ports < 1024 will still be there and is not likely to go anywhere, but if your app requests elevated privileges once in order to add the necessary launchd configuration, then you can let launchd do the actual listening on the privileged port and pass the socket to your app when appropriate.

最好的方法是利用launchd。绑定到端口<1024的限制仍然存在,并且不太可能去任何地方,但如果您的应用程序为了添加必要的launchd配置而请求提升的权限一次,那么您可以让launchd在特权端口上进行实际侦听并在适当时将套接字传递给您的应用程序。

See the section on launchd in this OS X Developer Library reference, and the further references given there for learning more about launchd and how to use it safely.

请参阅此OS X开发人员库参考中有关launchd的部分,以及其中提供的更多参考资料,以了解有关launchd以及如何安全使用它的更多信息。