firewall.sh 622 B

1234567891011121314151617181920
  1. #!/bin/sh
  2. # TODO check if root
  3. echo '\033[35m
  4. ______________ _______ _____ __ __
  5. / ____/ _/ __ \/ ____/ | / / | / / / /
  6. / /_ / // /_/ / __/ | | /| / / /| | / / / /
  7. / __/ _/ // _, _/ /___ | |/ |/ / ___ |/ /___/ /___
  8. /_/ /___/_/ |_/_____/ |__/|__/_/ |_/_____/_____/
  9. \033[0m'
  10. echo "\033[35;1mInstalling ufw and setup firewall (allowing only ssh and http) \033[0m"
  11. sleep 3
  12. apt-get --yes --force-yes install ufw
  13. # ufw allow ssh # knockd will open the ssh port
  14. ufw allow http
  15. ufw allow https
  16. ufw enable
  17. ufw status verbose
  18. echo "\033[92;1mufw installed and firwall configured\033[Om"