您的位置:首页 > 运维架构 > Linux

linux系统服务优化--关闭无用的服务

2014-05-31 22:13 471 查看
1.查看系统所有的服务
#chkconfig --list |
cat -n

2.先关闭系统所有的服务
(说明:由于基于xinetd的服务都是有xinetd管理,所以这里只关闭xinetd以上行的服务,head
-112
根据实际情况来指定其数值)
#for s in `chkconfig
--list | head -112 | awk '{print $1}'` ;do chkconfig $s off ; done
或者
#for s in `chkconfig --list | awk 'NR==1,NR==112{print $1}'` ;do
chkconfig $s off ; done
3.开启系统必需启动的服务(根据自己的实际情况而定)
#for s in crond
iptables irqbalance messagebus network syslog sshd  ;do chkconfig $s on ; done
4.查看开启的服务
#chkconfig --list | awk  '/5:启用/{print NR ,$0 }'


本文出自 “遗失的足迹” 博客,请务必保留此出处http://kitsnail.blog.51cto.com/4052186/1420527
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: