Show Table of Contents
28.3. 在安裝期間將日誌紀錄至遠端系統上
要配置遠端記錄日誌,請附加
syslog 選項。請指定記錄系統的 IP 位址,和該系統上的日誌服務的 UDP 通訊埠號。就預設值,接受遠端訊息的 syslog 服務會在 UDP 通訊埠 514 上進行監聽。
例如,若要連至一部系統
192.168.1.20 上的 syslog 服務,請在boot: 提示符號下輸入下列資訊:
linux syslog=192.168.1.20:51428.3.1. 配置日誌伺服器
Red Hat Enterprise Linux 使用了
rsyslog 來提供一項 syslog 服務。rsyslog 的預設配置會拒絕來自遠端系統的訊息。
警告
下列詳述的
rsyslog 配置並未使用任何 rsyslog 中的安全措施。攻擊者可透過傳送大量的錯誤日誌訊息,來讓允許存取日誌服務的系統減慢或當機。此外,攻擊者亦能透過網路來截取或假造被傳送的訊息。
若要將 Red Hat Enterprise Linux 系統配置為能夠接受來自於網路上其它系統的日誌訊息,請編輯
/etc/rsyslog.conf 這個檔案。您必須使用 root 權限才能編輯 /etc/rsyslog.conf 這個檔案。請藉由移除註釋前的斜線以將它們反註解:
$ModLoad imudp.so$UDPServerRun 514
請重新啟用
syslogd 服務以套用變更:
su -c '/sbin/service rsyslog restart'
當您被提示時,請輸入
root 密碼。
注意
就預設值,syslog 服務會在 UDP 通訊埠 514 上進行監聽。若要允許來自其它系統的連線連至此通訊埠,請選取 → → 。請選取 Other ports(其他通訊埠)和。請在 Port(s)(通訊埠)欄位中輸入
514,然後指定 Protocol(協定)為 udp。

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.