]# grep ".*password changed" /var/log/secure
May 16 14:37:30 wanwz passwd: pam_unix(passwd:chauthtok): password changed for wanwz
示例:lastlog
]# lastlog
用户名 端口 来自 最后登陆时间
root pts/0 192.168.153.140 六 5月 16 14:29:30 +0800 2020
bin **从未登录过**
daemon **从未登录过**
...
postfix **从未登录过**
wanwz pts/0 192.168.153.140 三 5月 6 15:34:46 +0800 2020
]# last
root pts/0 192.168.153.140 Sat May 16 14:29 still logged in
root tty1 Sat May 16 14:25 still logged in
root pts/0 192.168.153.140 Thu May 14 10:14 - 17:57 (07:43)
reboot system boot 3.10.0-1062.el7. Thu May 14 10:12 - 14:40 (2+04:28)
root tty1 Tue May 12 18:11 - 20:59 (02:48)
...
]# last #看到报警,第一时间查看wtmp日志,判断当前或最近登录的用户,基本就是该用户做的修改;速度最快的办法
]# tail /var/log/secure #查看详细信息
日志管理-secure|lastlog|wtmp|messages|boot
原文:https://www.cnblogs.com/wanwz/p/12898490.html