ログ(実行記録)
ログの記録方法
アプリケーションやデーモンプログラムで発生したエラーなどの実行記録がログに記録される。
ログはプログラムが直接ログファイルに書き出すのではなく,syslogdというデーモンプログラムを通して,ログファイルに書き出される。
syslogdは他のマシンのsyslogdと連携して,ログを別のマシンに転送することができる。
侵入者は侵入を隠すためにログから侵入の記録を消すことがあるが,別のマシンに転送すればそうした改ざんがやりにくくなる。

syslogの設定
syslogは/etc/syslog.confファイルによって動作を設定する。
syslog.confの形式
<facility>.<priority>;<facility>.<level>;..... <action>
facilityの種類
- auth
- auth-priv
- cron
- daemon
- kern
- lpr
- mail
- mark
- news
- syslog
- user
- uucp
- local0からlocal7
priorityの種類(主要なもの)
- debug
- info
- notice
- warning
- err
- crit
- alert
- emerg
actionの種類
- 通常のファイル
- 名前付きパイプ
- ターミナルとコンソール
- リモートコンピュータ
- ユーザ名のリスト
- ログインしている誰でも
/etc/syslog.confの例
# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.* /dev/console
# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none /var/log/messages
# The authpriv file has restricted access.
authpriv.* /var/log/secure
# Log all the mail messages in one place.
mail.* /var/log/maillog
# Everybody gets emergency messages, plus log them on another
# machine.
*.emerg *
# Save mail and news errors of level err and higher in a
# special file.
uucp,news.crit /var/log/spooler
|
|