ufw.sh 466 B

12345678910111213141516171819202122232425
  1. #!/bin/sh
  2. echo -e '
  3. _ _ _____ __
  4. | | | | __\ \ / /
  5. | |_| | _| \ \/\/ /
  6. \___/|_| \_/\_/
  7. '
  8. echo -e "Installing ufw and setup firewall (allowing only ssh and http)"
  9. . bin/checkroot.sh
  10. sleep 2
  11. # TODO use awall instead of ufw ?
  12. # ufw
  13. apk add ufw@testing
  14. ufw allow ssh # knockd will open the ssh port
  15. ufw allow http
  16. ufw allow https
  17. # TODO ask for allowing ssh for some ip
  18. ufw enable
  19. ufw status verbose
  20. echo -e "ufw installed and firwall configured"