SSHの不正アクセス見方メモ。

ぴゃー大量にアクセスされていたお!



/var/log/secure
ここにsshdの認証のログがある。


以下のよーなコマンドで成功のログを見る。


# cd /var/log/
# grep "Accepted" secure*
以下例。

secure-20091025:Oct 24 22:00:00 localhost sshd[24407]:
Accepted password for hogehoge from x.x.x.x port 49408 ssh2
secure-20091025:Oct 24 22:01:00 localhost sshd[24468]:
Accepted publickey for hogehoge from x.x.x.x port 49453 ssh2
x.x.x.xに見慣れないアドレスがあるとやばいかも…。


あと失敗のログも見る。


# grep -E "Failed|Invalid" secure*
以下例。

secure-20091025:Oct 25 01:00:00 localhost sshd[24797]:
Invalid user hogehoge from x.x.x.x
secure-20091025:Oct 25 01:00:01 localhost sshd[24797]:
Failed password for invalid hogehoge test1 from
x.x.x.x port XXXX ssh2
ぎゃー大量にでてきちゃったよお。・゚・(ノ∀`)・゚・。

セキュリティあげるか…。

〜編集中〜