Last active
April 10, 2022 03:41
-
-
Save nhthai2005/ebb097d20f056d7c3f866b6127b4c646 to your computer and use it in GitHub Desktop.
Howto enable ufw firewall on Ubuntu
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/bash | |
# Check ufw status | |
sudo ufw status | |
# Enable ufw | |
sudo ufw enable | |
# Check ufw status again | |
sudo ufw status | |
# To set the default UFW incoming policy to deny | |
sudo ufw default deny incoming | |
# To set the default UFW outgoing policy to allow | |
sudo ufw default allow outgoing | |
# Check configuration again | |
sudo ufw status verbose | |
" Output: | |
" Status: active | |
" Logging: on (low) | |
" Default: deny (incoming), allow (outgoing), deny (routed) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment