• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Firewall not generating rules correctly

TheBug

New Pleskian
Hi,

I am using the plesk firewall and trying to set up SSH rule which only allows from my IP but deny from everywhere else.
In previous versions this worked fine by adding an ip selecting Allow from selected sources, deny from others and the icon in the rules would be orange with the lines

allow incoming from xxx.xxx.xxx.xx
Deny incoming from all others

However this no longer works as the deny from all others is not appearing and is not being generated in the iptables by plesk.
How can I fix this?

Thanks
 
You might consider adding these lines over the command prompt:

Code:
iptables -A INPUT -i eth0 -s XXX.XXX.XXX.XXX --dport 22 -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i eth0 -j DROP

With these modifications, you have to add a rule for each allowed IP ( XXX.XXX.XXX.XXX ), the rest will be dropped. Please be carefull with this setting, because a false entry might lock you out completly. Think about adding the server ip(s) as well as 127.0.0.1/32 . Depending on your OS, you might as well consider reading the man pages for iptables.
 
Back
Top