#!/bin/bash
#liu_dong

sed -i "s/\#Port 22/Port 31961/g" /etc/ssh/sshd_config 
sed -i "s/\#UseDNS yes/UseDNS no/g" /etc/ssh/sshd_config
sed -i "s/GSSAPIAuthentication yes/GSSAPIAuthentication no/g" /etc/ssh/sshd_config
sed -i "s/\#PermitRootLogin yes/PermitRootLogin no/g" /etc/ssh/sshd_config
systemctl restart sshd.service

#install semanage
yum -y install policycoreutils-python
semanage port -a -t ssh_port_t -p tcp 31961
systemctl restart sshd.service

#firewall
firewall-cmd --permanent --zone=public --add-port=80/tcp
firewall-cmd --permanent --zone=public --add-port=31961/tcp
firewall-cmd --permanent --zone=trusted --change-interface=enp7s0f1
firewall-cmd --reload