根据我对我的基本理解,iptables
我整理了以下旨在运行 Tor 中继的设置......这里大约是 6 小时后。请注意,我不想讨论任何 Tor 操作,所以我不会指向https://tor.stackexchange.com/谢谢。
端口 22 发生了大规模攻击,我醒来时发现了,所以我已经更改了它,密码验证已经被禁用,但是人/机器人无论如何都试图闯入,我有一个 8192 位长的 RSA public/私钥,所以我希望它就足够了。
# iptables -L -v --line-numbers
输出:
Chain INPUT (policy DROP 8242 packets, 735K bytes)
num pkts bytes target prot opt in out source destination
1 0 0 DROP tcp -- any any anywhere anywhere ctstate NEW tcp flags:!FIN,SYN,RST,ACK/SYN /* protection: non-syn packets */
2 10 452 DROP all -- any any anywhere anywhere ctstate INVALID /* protection: malformed packets */
3 20 1000 ACCEPT all -- lo any anywhere anywhere /* loopback: compulsory */
4 3 98 ACCEPT icmp -- any any anywhere anywhere icmp echo-request limit: avg 2/sec burst 5 /* ICMP: ping only */
5 16625 9388K ACCEPT all -- any any anywhere anywhere ctstate RELATED,ESTABLISHED /* traffic */
6 7 420 ACCEPT tcp -- any any anywhere anywhere ctstate NEW,ESTABLISHED tcp dpt:xxyyzz /* SSH: global obfuscated */ <-- CENSORED
7 438 26080 ACCEPT tcp -- any any anywhere anywhere tcp dpt:9001 /* Tor: OR */
8 558 30828 ACCEPT tcp -- any any anywhere anywhere tcp dpt:9030 /* Tor: Dir */
Chain FORWARD (policy DROP 0 packets, 0 bytes)
num pkts bytes target prot opt in out source destination
Chain OUTPUT (policy ACCEPT 16969 packets, 6369K bytes)
num pkts bytes target prot opt in out source destination
我想部署fail2ban
,但我从未使用过它,所以我找到了几个指南来设置它,但我相信我们应该在这个网站上有一些例子,我确实发现了太多的结果,但与初始设置fail2ban
无关?fail2ban
如果由于某种原因无法在此处完成,请发表评论,稍后我将删除此问题。
系统:Debian GNU/Linux 11 (bullseye)openssh-server
用于 ssh 服务。
先感谢您!