19
18

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Linuxサーバーへ不正ログインを試みたユーザー一覧を出すワンライナー

Posted at

lastbコマンドを使えば、SSHのログイン失敗のログが参照できるので後は、awkでログイン失敗回数をカウントし、uniqコマンドでユーザー名を取り出して、sortコマンドでソートして、headコマンドでトップ10を出すというような感じ。

# lastb | awk '{print $1}' | sort | uniq -c | sort -nr | head -10

19
18
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
18

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?