Cheug's Blog

当前位置:网站首页 / Server / 正文

Linux用户登录日志查看与清理

2024-08-21 / Server / 443 次围观 / 0 次吐槽 /

查看登陆成功日志

last
last -f /var/log/wtmp

清空日志

> /var/log/wtmp


查看登陆失败日志

lastb
last -f /var/log/btmp
grep -i failed /var/log/secure
grep failed /var/log/secure | cut -d' ' -f12 | uniq -c


清空日志

> /var/log/btmp


Powered By Cheug's Blog

Copyright Cheug Rights Reserved.