Created
June 4, 2019 19:06
-
-
Save chreniuc/6c5d5a35ecc001a9a331674965e5c69d to your computer and use it in GitHub Desktop.
Install and configure ufw on debian server
This file contains 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
# Install ufw: | |
apt install ufw | |
# Set rules back to default: | |
ufw default deny incoming | |
ufw default allow outgoing | |
# Allow ssh: | |
ufw allow ssh | |
# or | |
ufw allow 22 | |
# Enable ufw: | |
ufw enable | |
# Disable: | |
ufw disable | |
# See rules: | |
ufw status verbose | |
# Allow multiple ports: from 6000-6007 | |
ufw allow 6000:6007/tcp | |
ufw allow 6000:6007/udp | |
# Allow incoming traffic on a public interface on a specific port: | |
ufw allow in on eth0 to any port 80 | |
# List rules by number: | |
ufw status numbered | |
# Delete rule: | |
ufw delete 2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment