om/前置配置/3.关闭强化(根据需要设置).md

700 B
Raw Blame History

防火墙

# 关闭防火墙
systemctl stop firewalld
# 关闭开机启动
systemctl disable firewalld
# 校验状态
firewall-cmd --state

关闭selinux Security-Enhanced Linux

# 临时关闭
setenforce 0
# 修改配置文件关闭
sed -ri 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
# 校验状态
sestatus

交换分区设置

# 临时关闭
swapoff -a
# 修改配置文件
sed -ri 's/.*swap.*/#&/' /etc/fstab
# 修改配置文件
echo "vm.swappiness=0" >> /etc/sysctl.conf
# 更新
sysctl -p

同步时间

# 安装
yum -y install ntpdate
# 同步阿里云时间
crontab -e
0 */1 * * * ntpdate time1.aliyun.com