UFW Firewall management Ubuntu 22.04 cli ufw settings
Добавлено: Пт ноя 21, 2025 8:24 am
# Check the current status of the firewall
# Enable the firewall
sudo ufw enable
# Disable the firewall (if needed)
# Reset to defaults (use with caution)
# Deny all incoming traffic by default
sudo ufw default deny incoming
# Allow all outgoing traffic by default
# or explicitly:
# Allow from a specific IP address for SSH
sudo ufw allow from 210.10.10.101 to any port 22 proto tcp
Код: Выделить всё
sudo ufw statussudo ufw enable
# Disable the firewall (if needed)
Код: Выделить всё
sudo ufw disableКод: Выделить всё
sudo ufw resetsudo ufw default deny incoming
# Allow all outgoing traffic by default
Код: Выделить всё
sudo ufw default allow outgoingКод: Выделить всё
sudo ufw allow sshКод: Выделить всё
sudo ufw allow 22/tcpsudo ufw allow from 210.10.10.101 to any port 22 proto tcp
Код: Выделить всё
sudo ufw status verboseКод: Выделить всё
sudo ufw status numbered