ftl1012

重要的开机自启动的服务


    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

分类:

技术点:

相关文章:

  • 2022-01-18
  • 2022-12-23
  • 2022-02-27
  • 2022-02-07
  • 2021-08-26
  • 2022-02-09
  • 2022-12-23
  • 2022-01-01
猜你喜欢
  • 2021-12-23
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
  • 2021-05-12
  • 2021-11-18
  • 2022-12-23
相关资源
相似解决方案