linuxcentos无法远程连接

linuxcentos无法远程连接,第1张

远程练服务器时发现可以ping通,但是22端口无法连接。用

排除防火墙策略后,用systemctl status sshd发现是ssh服务没起,用systemctl start sshd 后报错

'''job for sshd.service failed because the control process exited with error code. see systemctl status sshd.service and journalctl -xe for details'''

用sshd -t查看提示ssh权限太大,用命令更改再次启动ssg

''' chmod 700  /etc/ssh/*

sshd -t'''

首先先查看SELINUX和防火墙,如果没有再来查看iptables

iptables -L查看ip过滤规则(iptables可以做防火墙但是他本身其实是个ip过滤规则系统而已)

如果是设置的话

例如:允许192.168.10.0网段的通过80端口,其他则拒绝的话

iptables -A INPUT -s 192.168.10.0 -p tcp --dport 80 -j ACCEPT

iptables -A INPUT -p tcp --dport 80 -j DROP


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/yw/8796452.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-21
下一篇2023-04-21

发表评论

登录后才能评论

评论列表(0条)

    保存