Dec 16 21:21:57 server sshd[1219]: [ID 800047 auth.info] Failed none for user from ::1 port 55486 ssh2
Dec 16 21:21:57 server sshd[1219]: [ID 800047 auth.info] Found matching DSA key: b6:ff:ff:ff:ff:72:f5:18:1b:f6:d0:f8:6f:1c:40:6f
Dec 16 21:21:57 server last message repeated 1 time
Dec 16 21:21:57 server sshd[1219]: [ID 800047 auth.info] Accepted publickey for user from ::1 port 55486 ssh2
Dec 16 21:21:57 server sshd[1219]: [ID 800047 auth.info] Connection closed by ::1
Dec 16 21:21:57 server sshd[1219]: [ID 800047 auth.info] Closing connection to ::1 作者: 可可火山 时间: 2011-12-16 21:34
目前下面的awk脚本基本满足了我的需求
ssh登录log里可能会存在同时登录导致日志是相互叠加的。
还有就是 sshd[xxxxx]的session id (我自己叫的)在一天的log里可能会重复。
{
if( $0 ~ /Found matching/ ) {
if ( FINGERPRINT[$5] != $13 && USER[$5]!="" && USER[$5]!="root" )