0

I installed barnyard2 for snort, but when i run command below this error appear.

[root@localhost snort]# barnyard2 -c /etc/snort/barnyard2.conf -d /var/log/snort/ -f snort.log -w /etc/snort/bylog.waldo /etc/snort/gen-msg.map /etc/snort/sid-msg.map -C /etc/snort/classification.config 
Running in Continuous mode

    --== Initializing Barnyard2 ==--
Initializing Input Plugins!
Initializing Output Plugins!
Parsing config file "/etc/snort/barnyard2.conf"


+[ Signature Suppress list ]+
----------------------------
+[No entry in Signature Suppress List]+
----------------------------
+[ Signature Suppress list ]+

Barnyard2 spooler: Event cache size set to [2048] 
ERROR: Can not get write access to logging directory "/var/log/barnyard2". (directory doesn't exist or permissions are set incorrectly or it is not a directory at all)
Fatal Error, Quitting..
Barnyard2 exiting

and permission is:

[root@localhost snort]# ls -l /var/log/barnyard2 
-rwxrwxrwx. 1 root root 0 Aug 14 16:35 /var/log/barnyard2

in this link this problem was solved but i don't understand how ...
https://forums.freebsd.org/threads/barnyard2-start-service-error.51378/

4

2 回答 2

1

看起来那里缺少目录标志。错误消息说

ERROR: Can not get write access to logging directory "/var/log/barnyard2". (directory doesn't exist or permissions are set incorrectly or it is not a directory at all)

可能最后一个 /var/log/barnyard2 根本不是目录的情况可能适用。

备份文件并尝试创建一个目录 /var/log/barnyard2 ,权限为 640 和相应的所有权。

编辑:只要您不知道 /var/log/barnyard2 的内容,重命名或将文件移动到某个位置(作为 root 'mv /var/log/barnyard2 /var/log/barnyard2.old')。现在重新启动 barnyard2 可能会有所帮助,它可能会自行创建具有适当权限的目录。否则,作为 root 输入“mkdir /var/log/barnyard2”,然后通过输入“chmod 640 /var/log/barnyard2”来设置权限。此外,通过键入“ps -u |”检查正在运行 barnyard2 的用户。grep "barnyard2"'。然后通过键入'groups <user>' 为该用户找到适当的组,然后通过键入'chown <user>:<group> /var/log/barnyard2' 将目录的所有权设置给相应的用户。

于 2015-08-14T13:18:04.100 回答
0

'/var/log/barnyard2' 应该是日志目录。在您的情况下,它是一个文件。因此,请删除该文件并创建一个目录。以下是步骤。以 root 用户身份输入命令。

rm /var/log/barnyard2
mkdir /var/log/barnyard2
于 2015-08-14T14:12:16.770 回答