![]() ![]() Please be mindful that here 192.168.1.150 is the blocked host. Now, try to SSH the server from the blocked host. To take new rules into effect, you need to use the following command. # firewall-cmd -direct -add-rule ipv4 filter INPUT 1 -m tcp -source 192.168.1.100/24 -p tcp -dport 22 -j REJECT # firewall-cmd -direct -add-rule ipv4 filter INPUT 1 -m tcp -source 192.168.1.100 -p tcp -dport 22 -j REJECT # iptables -I INPUT -s 192.168.1.0/24 -p tcp -dport ssh -j REJECT # iptables -I INPUT -s 192.168.1.100 -p tcp -dport ssh -j REJECT Block or Disable SSH Access - On IPtables Firewall. Now let us see how to block SSH and FTP access to a specific IP (for example 192.168.1.100) and/or network range (for example 192.168.1.0/24) using IPtables on RHEL/CentOS/Scientific Linux 6.x versions and FirewallD on CentOS 7.x. Method 1: Block SSH and FTP Access Using IPTables/FirewallD Now you aware about what is IPTables and FirewallD and it’s basics.
0 Comments
Leave a Reply. |