去掉message日志文件中su命令的记录
发表于:2025-12-02 作者:千家信息网编辑
千家信息网最后更新 2025年12月02日,脚本执行需要root权限,但脚本中使用su命令来执行其他命令或脚本,比如使用nginx用户调用日志统计脚本。在/var/log/message日志中有过多的日志显示Jun 28 10:28:06 lo
千家信息网最后更新 2025年12月02日去掉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安全错误
数据库的锁怎样保障安全
ajax请求服务器
律师匹配 软件开发
结婚视频软件开发
网络安全两会期间
关闭IBM服务器远程管理
如何让台式电脑变成服务器
软件开发工资发放数据流程图
美国网络安全判例法
米奇软件开发客户怎么样
惠州自主可控软件开发零售价
浪潮服务器配置snmp的v3
工业领域网络安全保障方案
服务器UID按钮 系统故障分析
ppoe的拨号服务器
网络安全 创业公司
深圳学软件开发读什么学校
网络安全专题内容
win 服务器版
广州惠普服务器维修
版本火车 软件开发
网络安全专业入门本科书籍
2050国家网络安全周
龙源数据库职称
手机版神武老是服务器超时
发卡服务器自动关闭怎么解决
飞腾arm架构软件开发
代理服务器 pac
服务器租用双线
供电公司网络安全自查报告
迅雷挖矿服务器