Remote sshd prompt: Server unexpectedly
Server unexpectedly closed network connection
After restarting the server effect is the same, after a period of time after connecting, finally connected to the remote. After creating a new remote connection, the discovery is still prompted:
Server unexpectedly closed network connection
Baidu and Google searched for a while, modified sshd_config, the effect is the same.
And then look at it.
[root@localhost log]# tail -F /var/log/secure //view login log file
Found a problem, a lot of IP has been brute force cracking, login information has been swiping the screen
[root@localhost log]# vim /etc/ssh/sshd_config //modify port to 3330
[root@localhost log]# iptables -I INPUT -p tcp --dport 3330 -j ACCEPT //Add firewall port 3330 Allow
[root@localhost log]# service iptables save //save rules
[root@localhost log]# /etc/init.d/sshd restart //restart sshd
[root@localhost log]# tail -F /var/log/secure //view log again There is no login log and swipe the screen again
Remote login, normal.
Reading journals is important. It's important.