若出现Host key verification failed
ssh-keygen -R 107.191.51.51
CentOS7这个版本的防火墙默认使用的是firewall,与之前的版本使用iptables不一样。按如下方便配置防火墙:
1、关闭防火墙:
sudo systemctl stop firewalld.service
2、关闭开机启动:
sudo systemctl disable firewalld.service
3、安装iptables防火墙 iptables防火墙:
sudo yum install iptables-services
4、配置iptables防火墙,打开指定端口(具体跟以前版本一样,网上介绍很多,这里不多介绍了)
firewall-cmd --zone=public --add-port=80/tcp --permanent
(–permanent永久生效,没有此参数重启后失效)
firewall-cmd --zone=public --add-port=1000-2000/tcp --permanent
5、设置iptables防火墙开机启动:
sudo systemctl enable iptables