Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ssh CentOS 6.3。嘘。绑定到0.0.0.0上的端口xxx失败:权限被拒绝_Ssh_Centos - Fatal编程技术网

Ssh CentOS 6.3。嘘。绑定到0.0.0.0上的端口xxx失败:权限被拒绝

Ssh CentOS 6.3。嘘。绑定到0.0.0.0上的端口xxx失败:权限被拒绝,ssh,centos,Ssh,Centos,CentOS 6.3最低配置。已安装SSH服务器,端口22。一切正常。 我在777上更改端口22并重新启动sshd,并在日志中查看: Jul 26 01:01:07 myserver sshd[1590]: error: Bind to port 777 on 0.0.0.0 failed: Permission denied. Jul 26 01:01:07 myserver sshd[1590]: error: Bind to port 777 on :: failed: Permissio

CentOS 6.3最低配置。已安装SSH服务器,端口22。一切正常。 我在777上更改端口22并重新启动sshd,并在日志中查看:

Jul 26 01:01:07 myserver sshd[1590]: error: Bind to port 777 on 0.0.0.0 failed: Permission denied.
Jul 26 01:01:07 myserver sshd[1590]: error: Bind to port 777 on :: failed: Permission denied.
Jul 26 01:01:07 myserver sshd[1590]: fatal: Cannot bind any address.
/etc/sysconfig/iptables包含:

-A INPUT -m state --state NEW -m tcp -p tcp --dport 777 -j ACCEPT

netstat-tulpn | grep:22和netstat-tulpn | grep:777不返回任何内容

端口777专用于多行HTTP,即使未使用,也无法绑定到它。例如,如果您尝试绑定到端口8777,它将正常工作

Centos默认使用SELinux,我认为Ubuntu不会(至少我没见过)。还可以在日志中查找SElinux权限错误。

SElinux不允许在默认安装的CentOS 6.3上的另一个端口上运行sshd。跟随->:

  • 在防火墙上挖一个洞(你已经这么做了)
  • 为SELinux添加允许在端口777上运行sshd的规则:
    sudo semanage port-a-t ssh\u port\u t-p tcp 777

谢谢,我不知道。这个端口从去年开始在Ubuntu中成功运行。问题是SELinux不允许ssh在另一个端口上运行。在启用SELinux的CentOS上,它也不会在端口8777上运行。