Code:
ufw deny from 192.187.100.58 to any;
ufw deny from 112.137.167.30 to any;
ufw deny from 82.117.194.229 to any;
ufw deny from 91.121.45.246 to any;
deny an ip in UFW
Code:
root@ds12-ams-2gb:/home/work# ufw status numbered
Status: active
To Action From
-- ------ ----
[ 1] 22 ALLOW IN 99.30.xxx.xx/29
[ 2] 80 ALLOW IN Anywhere
[ 3] 443 ALLOW IN Anywhere
[ 4] xxxx ALLOW IN 99.30.xxx.xx/29
[ 5] 80,443/tcp ALLOW IN Anywhere
[ 6] Nginx Full ALLOW IN Anywhere
[ 7] Anywhere DENY IN 69.30.222.130
[ 8] Anywhere DENY IN 155.133.82.122
[ 9] Anywhere DENY IN 54.196.30.74
[10] Anywhere DENY IN 66.240.205.0/26
[11] Anywhere DENY IN 188.165.2.183
[12] Anywhere DENY IN 71.6.146.130
[13] Anywhere DENY IN 89.163.146.57
[14] Anywhere DENY IN 139.162.199.176
[15] Anywhere DENY IN 180.97.106.37
[16] Anywhere DENY IN 104.193.252.165
[17] Anywhere DENY IN 190.248.153.234
[18] Anywhere DENY IN 142.54.183.226
[19] Anywhere DENY IN 158.106.67.0/24
[20] Anywhere DENY IN 170.210.156.91
[21] Anywhere DENY IN 81.4.125.125
[22] Anywhere DENY IN 66.240.192.128/26
[23] Anywhere DENY IN 35.188.194.96
[24] Anywhere DENY IN 149.202.207.121
[25] Anywhere DENY IN 158.106.64.0/18
[26] Anywhere DENY IN 142.54.161.10
[27] Anywhere ALLOW IN 99.30.xx.xx/29 21
[28] Anywhere DENY IN 66.240.192.0/18
[29] Anywhere DENY IN 192.187.100.58
[30] Anywhere DENY IN 112.137.167.30
[31] Anywhere DENY IN 82.117.194.229
[32] Anywhere DENY IN 91.121.45.246
[33] 80 (v6) ALLOW IN Anywhere (v6)
[34] 443 (v6) ALLOW IN Anywhere (v6)
[35] 80,443/tcp (v6) ALLOW IN Anywhere (v6)
[36] Nginx Full (v6) ALLOW IN Anywhere (v6)
Code:
root@ds12-ams-2gb:/home/work# ufw delete 37
Deleting:
allow 21/tcp
Proceed with operation (y|n)? y
Rule deleted
you have to run ufw status numbered each time you delete as the numbered order will change if you delete any number other than the last (end) number -- the rule chain will change.
Mapping the rules is a better idea but I haven't seen a good solution for ufw only for iptables and now nftables
ufw is an acronym for Uncomplicated FireWall
UFW: The Linux Uncomplicated Firewall <uncomplicated tutorial
iptables is sort of hard to understand and has been superseded by
https://linux-audit.com/nftables-beg...fic-filtering/ <nftables
Baidu doesn't play by the rules regarding robits.txt
and will use IP to spider you without any user-agent sig that says 'baidu' making you .htaccess code useless.
get the ip CIDRs and block them in the ufw firewall.