Created
January 5, 2019 04:24
-
-
Save rcherara/edec8a137c9c9220435b23013d2d1e93 to your computer and use it in GitHub Desktop.
Setup a basic configuration to allow SSH, HTTPS and HTTP incoming
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Install ufw | |
sudo apt install ufw | |
# Create setup_firewall.sh and run | |
chmod +x ./setup_firewall.sh | |
# Then run the script: | |
sudo ./setup_firewall.sh. | |
# You can check the config at any time with | |
sudo ufw status verbose | |
# You can disable the ufw configuration at any time with: sudo ufw disable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ufw default deny incoming | |
ufw default allow outgoing | |
ufw allow ssh | |
ufw allow 80/tcp | |
ufw allow 443/tcp | |
ufw enable |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment