去掉message日志文件中su命令的记录
发表于:2026-11-03 作者:千家信息网编辑
千家信息网最后更新 2026年11月03日,脚本执行需要root权限,但脚本中使用su命令来执行其他命令或脚本,比如使用nginx用户调用日志统计脚本。在/var/log/message日志中有过多的日志显示Jun 28 10:28:06 lo
千家信息网最后更新 2026年11月03日去掉message日志文件中su命令的记录
脚本执行需要root权限,但脚本中使用su命令来执行其他命令或脚本,比如使用nginx用户调用日志统计脚本。
在/var/log/message日志中有过多的日志显示
Jun 28 10:28:06 localhost su: (to nginx) chuangyw on noneJun 28 10:28:06 localhost su: (to nginx) chuangyw on noneJun 28 10:28:06 localhost su: (to nginx) chuangyw on noneJun 28 10:28:07 localhost su: (to nginx) chuangyw on noneJun 28 10:28:07 localhost su: (to nginx) chuangyw on noneJun 28 10:28:07 localhost su: (to nginx) chuangyw on noneJun 28 10:28:07 localhost su: (to nginx) chuangyw on noneJun 28 10:28:07 localhost su: (to nginx) chuangyw on noneJun 28 10:28:07 localhost su: (to nginx) chuangyw on noneJun 28 10:28:07 localhost su: (to nginx) chuangyw on noneJun 28 10:28:07 localhost su: (to nginx) chuangyw on noneJun 28 10:28:07 localhost su: (to nginx) chuangyw on noneJun 28 10:28:07 localhost su: (to nginx) chuangyw on noneJun 28 10:28:08 localhost su: (to nginx) chuangyw on noneJun 28 10:28:08 localhost su: (to nginx) chuangyw on noneJun 28 10:28:08 localhost su: (to nginx) chuangyw on noneJun 28 10:28:08 localhost su: (to nginx) chuangyw on noneJun 28 10:28:08 localhost su: (to nginx) chuangyw on noneJun 28 10:28:08 localhost su: (to nginx) chuangyw on noneJun 28 10:28:08 localhost su: (to nginx) chuangyw on none
严重影响message的阅读和过滤;
计划将信息重新建立一个文件保存比如/var/log/su
修改/etc/rsyslog.conf
在message条目中添加:
auth.none
增加条目:
auth.* /var/log/su
# Log anything (except mail) of level info or higher.# Don't log private authentication messages!*.info;mail.none;authpriv.none;cron.none;auth.none /var/log/messages# The authpriv file has restricted access.authpriv.* /var/log/secureauth.* /var/log/su# Log all the mail messages in one place.mail.* -/var/log/maillog
记得重启rsyslog生效
systemctl restart rsyslog.service
脚本
日志
命令
条目
文件
信息
权限
用户
过多
影响
统计
数据库的安全要保护哪些东西
数据库安全各自的含义是什么
生产安全数据库录入
数据库的安全性及管理
数据库安全策略包含哪些
海淀数据库安全审计系统
建立农村房屋安全信息数据库
易用的数据库客户端支持安全管理
连接数据库失败ssl安全错误
数据库的锁怎样保障安全
互联网最新的科技
互联网扶贫科技
互联网金融 金融科技
善班互联网科技
杭州互联网科技公司
凡科互联网科技
苏州互联网科技贷款公司
兼蜜互联网科技
一五八零互联网科技
海南科技产业互联网平台
互联网科技热点资讯
中国航天科技大学国际工业互联网
苏州铭阳互联网科技有限公司
中国新注册互联网科技
唐山双旺合互联网科技产业园
互联网对科技影响
陕西彩京云互联网科技有限公司
互联网企业和网络科技有限公司
知域互联网科技有限公司官网
广州全民伙伴互联网科技有限公司
有格互联网科技
远拓互联网科技
互联网科技logo
随着互联网科技发展
互联网企业和科技型企业
互联网科技创新的路径
高科技互联网套路
吉林省码上互联网科技电话
米泉互联网科技专业怎么样
互联网科技对化妆品行业