Linux Firewall
Here's a combined explanation of iptables and UFW, including installation, usage, and key concepts.
Introduction to iptables and UFW¶
iptables¶
iptables is a command-line utility that configures the Linux netfilter firewall. It allows filtering, NAT (Network Address Translation), and packet manipulation at the kernel level.
UFW (Uncomplicated Firewall)¶
ufw is a user-friendly front-end for iptables, designed to simplify firewall management.
Installation (if missing)¶
If iptables or ufw are not found, install them:
1️⃣ Using iptables¶
Check Existing Rules¶
Allow SSH (Port 22)¶
Block an IP Address¶
Save iptables Rules¶
To make changes persistent:
2️⃣ Using UFW¶
Enable UFW¶
Check Firewall Status¶
Allow SSH¶
Deny Specific IP¶
Disable UFW¶
3️⃣ Open SSH Port on Parrot OS¶
Enable SSH service:
Allow SSH through UFW:
Or using iptables:
4️⃣ SCP Command to Copy Files Using IP¶
Copy File to VM¶
Example:
Copy File from VM to Local¶
Example:
5️⃣ Closing SSH¶
Stop SSH Service¶
Disable SSH on Boot¶
Block SSH with UFW¶
Block SSH with iptables¶
Now you have a complete guide to managing firewalls and SSH on your Parrot VM. Let me know if you need more details! 🚀