khalequzzaman17

Open Specific Ports - SSH

Dec 5th, 2021 (edited)
1,049
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. systemctl status iptables.service
  2.  
  3. systemctl stop iptables.service
  4.  
  5. systemctl restart iptables.service
  6.  
  7. cat /etc/sysconfig/iptables
  8.  
  9. sudo sh -c "iptables -I INPUT -p tcp -m tcp --dport 443 -j ACCEPT && iptables -I INPUT -p tcp -m tcp --dport 2082 -j ACCEPT && iptables -I INPUT -p tcp -m tcp --dport 2083 -j ACCEPT && iptables -I INPUT -p tcp -m tcp --dport 2086 -j ACCEPT && iptables -I INPUT -p tcp -m tcp --dport 2087 -j ACCEPT && iptables -I INPUT -p tcp -m tcp --dport 2095 -j ACCEPT && iptables -I INPUT -p tcp -m tcp --dport 2096 -j ACCEPT && service iptables save"
  10.  
  11. sudo sh -c "iptables -I INPUT -p tcp -m tcp --dport 80 -j ACCEPT && iptables -I INPUT -p tcp -m tcp --dport 443 -j ACCEPT && iptables -I INPUT -p tcp -m tcp --dport 21 -j ACCEPT && iptables -I INPUT -p tcp -m tcp --dport 22 -j ACCEPT && iptables -I INPUT -p tcp -m tcp --dport 3306 -j ACCEPT && iptables -I INPUT -p tcp -m tcp --dport 22 -j ACCEPT && service iptables save"
  12.  
  13. sudo sh -c "iptables -I INPUT -p tcp -m tcp --dport 110 -j ACCEPT && iptables -I INPUT -p tcp -m tcp --dport 995 -j ACCEPT && iptables -I INPUT -p tcp -m tcp --dport 143 -j ACCEPT && iptables -I INPUT -p tcp -m tcp --dport 993 -j ACCEPT && iptables -I INPUT -p tcp -m tcp --dport 25 -j ACCEPT && iptables -I INPUT -p tcp -m tcp --dport 465 -j ACCEPT && service iptables save"
RAW Paste Data