Linux系统重要的开机自启动的服务

重要的开机自启动的服务


    1.sshd  连接Linux服务器是需要用到的服务程序
    2.rsyslog 操作日志的一种机制
                系统日志:/var/log/message
                硬件日志:dmesg
    3.network 系统启动时,若想激活/关闭各个网络解耦必须开启
    4.crond:定时任务   周期性的执行任务
    5.sysstat:观察CPU,进程,IO等信息

关闭我们不常用的服务【Linux服务最小原则】

关闭不常用的服务

chkconfig |grep 3:on | awk '{print $1}' | grep -Ev "sshd|network|crond|sysstat|rsyslog" | xargs -I{} chkconfig {} off
    ==>for name in `chkconfig | grep 3:on |awk '{print $1}'` ; do chkconfig $name off; done;
                 ==命令用反引号 tab键上
    ==>chkconfig | awk '{print $1}' | grep -Ev "sshd|network|crond|sysstat|rsyslog" | sed -r 's#(.*)#chkconfig /1 off#g' | bash
                 |bash 之前输出的只是字符串
                 |bash 之后是将内容交给bash处理
     ==>chkconfig | awk '{print $1}' | grep -Ev "sshd|network|crond|sysstat|rsyslog" | awk '{print "chkconfig " $1 " off" }' | bash

image

查看当前服务

chkconfig |grep 3:on 

image

猜你喜欢

转载自www.cnblogs.com/ftl1012/p/9277602.html
今日推荐