配置 rsyslog,使得可以通过 rsyslog 服务来在远程主机间传输日志

见 https://www.thegeekdiary.com/configuring-remote-logging-using-rsyslog-in-centos-rhel/

Once the central log host is configured to accept remote logging, the rsyslog service can be configured on remote systems to send logs to the central log host. To configure a machine to send logs to a remote rsyslog server, add a line to the rules section in the /etc/rsyslog.conf file. In place of the file name, use the IP address of the remote rsyslog server. To use UDP, prefix the IP address with a single @ sign. To use TCP, prefix it with two @ signs (@@).

For instance, to have all messages with info or higher priority sent to loghost.example.com via UDP, use the following line:

*.info @loghost.example.com

To have all messages sent to loghost.example.com via TCP, use the following line:

*.*     @@loghost.example.com

Optionally, the log hostname can be appended with :PORT, where PORT is the port that the remote rsyslog server is using. If no port is given, it assumes the default port 514.

After adding the rule(s), restart the rsyslog service and send a test message using the logger command:

[root@logclient ~]# logger "Test from logclient"

Check the logs on the remote server to ensure the message was received.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Ubuntu 16.04 安全加固列表。 Table of Contents Terms of Use ........................................................................................................................................................... 1 Overview ............................................................................................................................................................... 12 Intended Audience ........................................................................................................................................ 12 Consensus Guidance ..................................................................................................................................... 12 Typographical Conventions ...................................................................................................................... 14 Scoring Information ..................................................................................................................................... 14 Profile Definitions ......................................................................................................................................... 15 Acknowledgements ...................................................................................................................................... 17 Recommendations ............................................................................................................................................. 19 1 Initial Setup .................................................................................................................................................. 19 1.1 Filesystem Configuration ............................................................................................................... 19 1.1.1.1 Ensure mounting of cramfs filesystems is disabled (Scored) .............................. 20 1.1.1.2 Ensure mounting of freevxfs filesystems is disabled (Scored)............................ 22 1.1.1.3 Ensure mounting of jffs2 filesystems is disabled (Scored) ................................... 23 1.1.1.4 Ensure mounting of hfs filesystems is disabled (Scored) ...................................... 24 1.1.1.5 Ensure mounting of hfsplus filesystems is disabled (Scored) ............................. 25 1.1.1.6 Ensure mounting of udf filesystems is disabled (Scored) ..................................... 26 1.1.2 Ensure separate partition exists for /tmp (Scored) .................................................... 27 1.1.3 Ensure nodev option set on /tmp partition (Scored) ................................................. 29 1.1.4 Ensure nosuid option set on /tmp partition (Scored) ................................................ 30 1.1.5 Ensure separate partition exists for /var (Scored) ..................................................... 31 1.1.6 Ensure separate partition exists for /var/tmp (Scored) ........................................... 32 1.1.7 Ensure nodev option set on /var/tmp partition (Scored) ........................................ 34 1.1.8 Ensure nosuid option set on /var/tmp partition (Scored) ....................................... 35 1.1.9 Ensure noexec option set on /var/tmp partition (Scored) ...................................... 36 1.1.10 Ensure separate partition exists for /var/log (Scored) .......................................... 37 1.1.11 Ensure separate partition exists for /var/log/audit (Scored) ............................. 39 1.1.12 Ensure separate partition exists for /home (Scored) .............................................. 41 1.1.13 Ensure nodev option set on /home partition (Scored) ........................................... 42

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值