SSH

登录成功

$ grep 'Accepted' /var/log/secure | awk '{print $11}' | sort | uniq -c | sort -nr
# 或者
$ last # 读取 /var/log/wtmp 文件

登录失败

$ grep 'Failed' /var/log/secure | awk '{print $11}' | sort | uniq -c | sort -nr
# 或者
$ lastb # 读取 /var/log/btmp 文件

检查后门

对比ssh版本

$ ssh -V

查看配置文件和/usr/sbin/sshd时间

$ stat /usr/sbin/sshd

查看信息

监控sshd进程读写文件操作

Last updated

Was this helpful?