遠程 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 //再查看日誌 已經沒有登錄日誌再刷屏幕了

在遠程登錄,正常了。



看日誌很重要。很重要。。




發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章