Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

28.3. 在安装过程中记录远程系统

默认情况下,安装进程将其生成的日志信息发送到控制台。可指定将这些信息发送到运行 syslog 服务的远程系统中。
要配置远程日志,请添加 syslog 选项。请指定日志系统的 IP 地址,并在那个系统中添加日志服务的 UDP 端口号。默认情况下,接收远程信息的 syslog 服务在端口 514 中侦听 UDP。
例如:要连接到系统 192.168.1.20 中的 syslog 服务,请在 boot: 提示符后输入以下内容:
linux syslog=192.168.1.20:514

28.3.1. 配置日志服务器

Red Hat Enterprise Linux 使用 syslogd 提供 syslog 服务。默认的 syslogd 配置拒绝来自远程系统的信息。

警告

Only enable remote syslog access on secured networks. The rsyslog configuration detailed below does not make use of any of the security measures available in rsyslog Crackers may slow or crash systems that permit access to the logging service, by sending large quantities of false log messages. In addition, hostile users may intercept or falsify messages sent to the logging service over the network.
要将 Red Hat Enterprise Linux 系统配置为接受来自网络中其他系统的日志信息,请编辑文件 /etc/rsyslog.conf。必须使用 root 特权编辑文件 /etc/rsyslog.conf。去掉以下行前面的井号取消对这些行的注释:
$ModLoad imudp.so
	$UDPServerRun 514
重启 syslogd 服务应用这些更改:
su -c '/sbin/service rsyslog restart'
提示时请输入 root 密码。

注意

By default, the syslog service listens on UDP port 514. The firewall must be configured to permit connections to this port from other systems. Choose SystemAdministration Firewall. Select Other ports, and Add. Enter 514 in the Port(s) field, and specify udp as the Protocol.