华域联盟 Linux SSH修改端口报错 error: Bind to port xxx on 0.0.0.0 failed: Permission denied.解决方法

SSH修改端口报错 error: Bind to port xxx on 0.0.0.0 failed: Permission denied.解决方法

 

Linux修改ssh Port端口后,无法启动ssh访问。

具体修改  /etc/ssh/sshd_config 里的 Port 端口,然后查日志后出现:

error: Bind to port 77 on 0.0.0.0 failed: Permission denied.

最后发现是SELinux的问题,关闭SELinux。

关闭SELinux方法:https://www.landui.com/help/show-8381

1 永久方法 – 需要重启服务器

修改/etc/selinux/config文件中设置

Bash

SELINUX=disabled

 

2 临时方法 – 设置系统参数然后重启服务器。

使用命令setenforce 0

附:

setenforce 1 设置SELinux 成为enforcing模式

setenforce 0 设置SELinux 成为permissive模式

然后重启ssh访问即可。

 

 

2

CentOS 6.3 Minimal Configuration. Installed SSH Server, port 22. All works correctly. I change port 22 on 777 and restart sshd and see in logs:

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 contains:

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

netstat -tulpn | grep :22 and netstat -tulpn | grep :777 return nothing

本文由 华域联盟 原创撰写:华域联盟 » SSH修改端口报错 error: Bind to port xxx on 0.0.0.0 failed: Permission denied.解决方法

转载请保留出处和原文链接:https://www.cnhackhy.com/157230.htm

本文来自网络,不代表华域联盟立场,转载请注明出处。

作者: sterben

发表回复

联系我们

联系我们

2551209778

在线咨询: QQ交谈

邮箱: [email protected]

工作时间:周一至周五,9:00-17:30,节假日休息

关注微信
微信扫一扫关注我们

微信扫一扫关注我们

关注微博
返回顶部