失敗したログイン試行を表示するにはどうすればよいですか?

失敗したログイン試行を表示するにはどうすればよいですか?

特定の時間以降に失敗したユーザーログイン試行を表示しようとしています。しかし、オンライン検索で見つけた方法のどれもうまくいきませんでした。私はオープンスコア13.2を使用しています。

journalctl -a --no-pager --since="2015-02-04 00:00:00"

すべてのシステムイベント(失敗したログイン試行を含む)の長く醜いリストを提供しました。この情報を収集するより良い方法はありますか?

ベストアンサー1

これは私にとって効果的です。

journalctl `which sshd` -a --no-pager --since="2015-02-04 00:00:00" | grep Failed

出力例:

Apr 02 10:18:13 sturm sshd[6068]: Failed password for aboettger from 192.168.2.40 port 4812 ssh2
Apr 02 10:18:18 sturm sshd[6068]: Failed password for aboettger from 192.168.2.40 port 4812 ssh2

または-p- オプションを使用します。たとえば、次のようになります。

journalctl `which sshd` -p 5 -a --no-pager --since="2015-02-04 00:00:00"

Journalctlのマニュアルページ:

   -p, --priority=
       Filter output by message priorities or priority ranges. Takes either a single numeric or textual log level (i.e. between
       0/"emerg" and 7/"debug"), or a range of numeric/text log levels in the form FROM..TO. The log levels are the usual syslog
       log levels as documented in syslog(3), i.e.  "emerg" (0), "alert" (1), "crit" (2), "err" (3), "warning" (4), "notice" (5),
       "info" (6), "debug" (7). If a single log level is specified, all messages with this log level or a lower (hence more
       important) log level are shown. If a range is specified, all messages within the range are shown, including both the start
       and the end value of the range. This will add "PRIORITY=" matches for the specified priorities.

おすすめ記事