Linux ssh 查看账户操作记录和日志
- 使用命令
last查看登录历史记录:
last username
其中 username 是你要查看的账户名。
- 使用命令
lastb查看登录失败的历史记录:
lastb
- 查看系统日志文件
/var/log/auth.log,可以使用命令tail查看最近的登录记录:
tail /var/log/auth.log
- 可以使用
grep命令筛选某个用户的登录记录:
grep "username" /var/log/auth.log
其中 username 是你要查看的账户名。
- 如果你的系统使用了
auditd,可以使用命令ausearch查看特定用户的操作记录:
ausearch -ua username
其中 username 是你要查看的账户名。
原文地址: https://www.cveoy.top/t/topic/hrwo 著作权归作者所有。请勿转载和采集!