运维开发网

linux简单优化

运维开发网 https://www.qedev.com 2020-07-11 16:53 出处:网络
  1.关闭 selinux #关闭selinux sed -i ‘s#SELINUX=enforcing#SELINUX=disabled#g‘ /etc/selinux/config

 

1.关闭 seLinux #关闭seLinux sed -i ‘s#SELinux=enforcing#SELinux=disabled#g‘ /etc/seLinux/config 检查是在闭 grep SELinux=disabled /etc/seLinux/config 临时关闭 setenforce 0 检查 getenforce   2.关闭iptables /etc/init.d/iptables stop /etc/init.d/iptables stop chkconfig iptables off     3.精简开机自启动服务 chkconfig |egrep -v "crond|sshd|network|rsyslog|sysstat|irqbalance"|awk ‘{print "chkconfig",$1,"off"}‘|bash   检查 chkconfig --list|grep 3:on   4.提权oldboy可以sudo useradd oldboy \cp /etc/sudoers /etc/sudoers.ori echo "oldboy ALL=(ALL) NOPASSWD:ALL" >>/etc/sudoers tail -l /etc/sudoers visudo -c   5.中文字符集 cp /etc/sysconfig/i18n /etc/sysconfig/i18n.ori echo "LANG="zh_CH.UTF-8"‘ >/etc/sysconfig/i18n 相当于用vi /etc/sysconfig/i18n 添加LANG="zh_CN.UTF-8"内容 source /etc/sysconfig/i18n 使上文修改生效   6.时间同步 echo ‘#time sync by oldboy at 2010-2-1‘ >>/var/spool/cron/root echo ‘*/5 * * * * /usr/sbin/ntpdat time.nist.gov >dev/null 2>&1‘ >>/var/spool/cron/root
0

精彩评论

暂无评论...
验证码 换一张
取 消