远程sshd提示: Server unexpectedly closed network connection

回复 收藏

远程sshd提示: Server unexpectedly closed network connection

重启后服务器效果也一样,经过一段时间连接后,终于连上远程了。之后新建一个远程连接,发现还是提示:

Server unexpectedly closed network connection 

百度和谷歌搜了一会,修改后sshd_config,效果也一样。

之后看下

[root@localhost log]# tail -F /var/log/secure  //查看登录日志文件 

发现了问题,好多IP一直暴力破解,登录信息一直在刷屏幕

[root@localhost log]# vim /etc/ssh/sshd_config  //修改端口为3330

[root@localhost log]# iptables -I INPUT -p tcp --dport 3330 -j ACCEPT  //添加防火墙3330端口 允许

[root@localhost log]# service iptables save //保存规则

[root@localhost log]# /etc/init.d/sshd restart  //重启sshd

[root@localhost log]# tail -F /var/log/secure //再查看日志 已经没有登录日志再刷屏幕了

在远程登录,正常了。

看日志很重要。很重要。。

远程sshd提示: Server unexpectedly closed network connection

重启后服务器效果也一样,经过一段时间连接后,终于连上远程了。之后新建一个远程连接,发现还是提示:

Server unexpectedly closed network connection 

百度和谷歌搜了一会,修改后sshd_config,效果也一样。

之后看下

[root@localhost log]# tail -F /var/log/secure  //查看登录日志文件 

发现了问题,好多IP一直暴力破解,登录信息一直在刷屏幕

[root@localhost log]# vim /etc/ssh/sshd_config  //修改端口为3330

[root@localhost log]# iptables -I INPUT -p tcp --dport 3330 -j ACCEPT  //添加防火墙3330端口 允许

[root@localhost log]# service iptables save //保存规则

[root@localhost log]# /etc/init.d/sshd restart  //重启sshd

[root@localhost log]# tail -F /var/log/secure //再查看日志 已经没有登录日志再刷屏幕了

在远程登录,正常了。

看日志很重要。很重要。。

2017-04-19 18:18 举报
已邀请:

回复帖子,请先登录注册

退出全屏模式 全屏模式 回复
评分
可选评分理由: