最後のコマンドは、数日間のログイン数だけを表示します。

最後のコマンドは、数日間のログイン数だけを表示します。

私はしばしばこのlastコマンドを使用して、自分のシステムに不正なログインがあることを確認します。このコマンドは次のとおりです。

last -Fd

IPを表示するリモートログイン情報を含むログイン情報を教えてください。

からman last

-F     Print full login and logout times and dates.
-d     For non-local logins, Linux stores not only the host name of the remote host but its IP number as well. This option  translates  the  IP
              number back into a hostname.

質問:

私のシステムの1つには、数日間だけログインが表示されます。なぜそんなことですか?last数日しか時間がない場合はどうすればいいですか?

問題の出力は次のとおりです。

root ~ # last -Fd
user pts/0        111-111-111-111. Wed Oct  8 20:05:51 2014   still logged in                      
user pts/0        host.lan   Mon Oct  6 09:52:01 2014 - Mon Oct  6 09:53:41 2014  (00:01)    
user pts/0        host.lan   Sat Oct  4 10:11:39 2014 - Sat Oct  4 10:12:13 2014  (00:00)    
user pts/0        host.lan   Sat Oct  4 09:31:07 2014 - Sat Oct  4 10:11:00 2014  (00:39)    
user pts/0        host.lan   Sat Oct  4 09:26:04 2014 - Sat Oct  4 09:28:16 2014  (00:02)    

wtmp begins Sat Oct  4 09:26:04 2014

ベストアンサー1

logrotate興味のあるログがアーカイブされ、新しいログが開かれた可能性があります。古いファイルがある場合は、次のwtmpいずれかを指定してください。例:

last -f /var/log/wtmp-20141001

おすすめ記事