sed -i '/SELINUX/{s/permissive/disabled/}'/etc/selinux/config
关闭防火墙
if egrep "7.[0-9]"/etc/redhat-release &>/dev/null; then
systemctl stop firewalld
systemctl disable firewalld
elif egrep "6.[0-9]"/etc/redhat-release &>/dev/null; then
service iptables stop
chkconfig iptables off
fi
SSH超时间
if! grep "TMOUT=1200"/etc/profile &>/dev/null; then
echo"export TMOUT=1200" >> /etc/profile
fi
禁止root远程登录
sed -i 's/#PermiRootLogin yes/PermiRootLogin no/'/etc/ssh/sshd_config
减少SWAP使用
echo"0" > /proc/sys/vm/swappiness
安装系统性能分析工具及其他
yum install gcc make autoconf vim sysstat numactl nvme-cli net-tools iostat ipmitool -y