linux版本:centos6.10
1.关闭SELinux功能
- 查看当前状态
[root@template6 ~]# getenforce
Enforcing //开启状态- 修改配置文件,使永久关闭
sed -i ‘s/SELINUX=enforcing/SELINUX=disable/’ /etc/selinux/config //sed替换
grep SELINUX=disable /etc/selinux/config //检查是否修改成功- 临时关闭
setenforce 0
2.关闭iptables
/etc/init.d/iptables stop
/etc/init.d/iptables stop
chkconfig iptables off
3.精简开机自启动服务
必要开机启动服务
- sshd 远程连接
- rsyslog 日志相关软件
- network 网络
- crond 定时任务
- sysstat 监控工具
执行:
chkconfig|egrep -v “crond|sshd|network|rsyslog|sysstat”|awk ‘{print “chkconfig”,$1,“off”}’|bash
检查:
chkconfig --list|grep 3:on
可能系统不存在sysstat服务,需要安装:yum install sysstat
4.添加管理员账号
- 添加用户
useradd sil