2013-05-21 202 views

回答

3

你需要一个root权限运行使用80端口的服务,或低于1024

这是Linux内核安全特性任何端口。

更详细的信息:

"Why can only root listen to ports below 1024?" at Mikael Ståldal’s blog


解决方案1:

如果你不想输入root密码,每次或通过脚本自动执行的任务类型 - 学会使用sudoers

HowTO: Sudoers Configuration at ubuntuforums.org


解决方案2:

端口限制是在内核源代码中定义,在include/net/sock.h文件。

/* Sockets 0-1023 can't be bound to unless you are superuser */ 
#define PROT_SOCK  1024 

要改变这种桌面(不推荐服务器)上 - 你可以编译新的内核,与PORT_SOCK设置为79解锁80端口,用于非root用户,或将其设置为0解锁所有端口。

1

它启动服务器端口80443需要root权限才能这样做。

相关问题