BASH   68

caslab setup iptables ssh

Guest on 25th April 2022 12:11:13 PM

  1. #!/bin/bash
  2.  
  3. sudo iptables -A INPUT -s 82.21.170.51/32 -p tcp -m tcp --dport 22 -j ACCEPT
  4. sudo iptables -A INPUT -s 172.0.0.0/8 -p tcp -m tcp --dport 22 -j ACCEPT
  5. sudo iptables -A INPUT -s 128.36.0.0/16 -p tcp -m tcp --dport 22 -j ACCEPT
  6. sudo iptables -A INPUT -s 130.132.0.0/16 -p tcp -m tcp --dport 22 -j ACCEPT
  7. sudo iptables -A INPUT -s 192.31.2.0/24 -p tcp -m tcp --dport 22 -j ACCEPT
  8. sudo iptables -A INPUT -s 192.31.236.0/24 -p tcp -m tcp --dport 22 -j ACCEPT
  9. sudo iptables -A INPUT -s 10.0.0.0/8 -p tcp -m tcp --dport 22 -j ACCEPT
  10. sudo iptables -A INPUT -s 127.0.0.1/32 -p tcp -m tcp --dport 22 -j ACCEPT
  11. sudo iptables -A INPUT -p tcp -m tcp --dport 22 -j DROP

Raw Paste


Login or Register to edit or fork this paste. It's free.