![]() |
/var/log に空っぽの authlog が存在しているだけで普段は、
何も書き込まれていないこのファイル。なんの為に存在しているのか
疑問を感じた方も多いのでわ?
authlog ってファイル名から察するに、
とお感じになられた方々も多いハヅ。
このファイル、 ssh でログインしようとしてきたユーザの履歴と接続元
などが記載される重要な log なのでつ。
syslog 経由で update されますが、 /etc/syslog.conf で authlog の
エントリ部分がコメントアウトされていてデフォでは何も書き込まれません。
なので、それをきちんと書き出して貰うようにしましょうとゆぅものでつ。
まずわ、root になってもらっておいて、
で、 syslog.conf を開いてもらって・・・・
#ident "@(#)syslog.conf 1.5 98/12/14 SMI" /* SunOS 5.0 */ # # Copyright (c) 1991-1998 by Sun Microsystems, Inc. # All rights reserved. # # syslog configuration file. # # This file is processed by m4 so be careful to quote (`') names # that match m4 reserved words. Also, within ifdef's, arguments # containing commas must be quoted. # *.err;kern.notice;auth.notice /dev/sysmsg *.err;kern.debug;daemon.notice;mail.crit /var/adm/messages *.alert;kern.err;daemon.err operator *.alert root *.emerg * # if a non-loghost machine chooses to have authentication messages # sent to the loghost machine, un-comment out the following line: #auth.notice ifdef(`LOGHOST', /var/log/authlog, @loghost) ↑ここのコメントを削除 mail.debug ifdef(`LOGHOST', /var/log/syslog, @loghost) # # non-loghost machines will use the following lines to cause "user" # log messages to be logged locally. # ifdef(`LOGHOST', , user.err /dev/sysmsg user.err /var/adm/messages user.alert `root, operator' user.emerg * ) |
#auth.notice のとこの行の1カラム目の "#" を削除してくらさい。
んで、 #pkill -HUP syslogd とかしてくらさい。
/etc/log/authlog の中身はテキストファイルなので、 more や less で 見れます。 vi でも良いかもね。
んで、驚くべきことに・・・・
中国や韓国から ssh で繋ごうとしている
がよく接続してきていまつ。
なので、 tcp wapper とかで信用になる接続元のみを接続するよう、
/etc/hosts.deny と /etc/hosts.allow を設定したほうが良いね。