0

How to block ssh port in iptables

Hai.....

I am new for Iptables, i don' t know to block ssh port in iptables....!!!! please guide me block ssh port in iptables.

SSH Iptables Add a comment
isaac
asked Aug 29 2017

Answer

0

I am also very interested in this question.

Add a comment
douglasking
asked Feb 14 2023
edited Aug 18 2023
Post your Answer
0

Hai, First add the iptables rule for trusted ip's like bellow

#  iptables -A INPUT -p tcp -s ipaddress --dport 22 -j ACCEPT

Next add the rule for block other ip's

#  iptables -A INPUT -p tcp --dport 22 -j DROP

and save new iptables rules.

#  iptables -save
Add a comment
piraisudanrajendran
asked Aug 29 2017
edited Oct 05 2018
Post your Answer