centos snort安装教程
时间: 2023-11-24 13:07:55 浏览: 165
在Centos 7上安装Snort 2.9.15.1.pdf
好的,以下是 CentOS 上安装 Snort 的步骤:
1. 安装依赖库:
```
sudo yum install -y gcc flex bison zlib libpcap pcre libdnet libdnet-devel tcpdump
```
2. 下载 Snort:
```
wget https://www.snort.org/downloads/snort/snort-2.9.17.tar.gz
```
3. 解压并进入目录:
```
tar -zxvf snort-2.9.17.tar.gz
cd snort-2.9.17
```
4. 配置、编译并安装 Snort:
```
./configure --enable-sourcefire --disable-open-appid
make
sudo make install
```
5. 创建 Snort 用户和组:
```
sudo groupadd snort
sudo useradd snort -r -s /sbin/nologin -c SNORT_IDS -g snort
```
6. 创建 Snort 目录和日志文件:
```
sudo mkdir /etc/snort
sudo mkdir /var/log/snort
sudo touch /var/log/snort/alert
sudo touch /var/log/snort/snort.log
sudo chown -R snort:snort /etc/snort /var/log/snort
```
7. 下载 Snort 规则文件:
```
wget https://www.snort.org/rules/snortrules-snapshot-2975.tar.gz
```
8. 解压规则文件并复制到 Snort 目录:
```
tar -zxvf snortrules-snapshot-2975.tar.gz
sudo cp -R ./snortrules-snapshot-2975/* /etc/snort/
```
9. 修改 Snort 配置文件 `/etc/snort/snort.conf`,将以下两行的注释去掉:
```
var RULE_PATH ../rules
var SO_RULE_PATH ../so_rules
```
10. 启动 Snort:
```
sudo snort -c /etc/snort/snort.conf -i eth0 -u snort -g snort -D
```
其中 `-i` 参数指定网卡,`-u` 和 `-g` 参数指定 Snort 运行的用户和组,`-D` 参数表示以守护进程方式运行。
阅读全文