#!/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
作者: 东邪西毒
本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文链接,负责保留追究法律责任的权利。