script内容
synflood.sh
#!/bin/bash tcpdump -i ens33 port 443 -n > /home/userid/synflood.txt
/etc/systemd/system/synflood.service
[Unit] Description = synflood log After=network.service [Service] ExecStart = /root/synflood.sh Restart = always Type = simple [Install] WantedBy = multi-user.target
#systemctl enabel synflood
#systemctl start synflood
#systemctl status synflood
● synflood.service - synflood log
Loaded: loaded (/etc/systemd/system/synflood.service; enabled; vendor preset: disabled)
Active: active (running) since 土 2020-09-26 18:46:52 JST; 3s ago
Main PID: 2257 (synflood.sh)
CGroup: /system.slice/synflood.service
├─2257 /bin/bash /root/synflood.sh
└─2258 tcpdump -i ens33 port 443 -n
9月 26 18:46:52 localhost.localdomain systemd[1]: Started synflood log.
9月 26 18:46:52 localhost.localdomain synflood.sh[2257]: tcpdump: verbose o...
9月 26 18:46:52 localhost.localdomain synflood.sh[2257]: listening on ens33...
しかし、/home/userid/synflood.txt
はゼロバイトのまま。
単純に
#./syflood.sh
なら、ダウンプ結果を出力してくれます。
回答2件
あなたの回答
tips
プレビュー