Skip to main content

Linux: How to Open, Close, and Manage Ports with UFW Firewall

HardReset.InfoDecember 17, 20254 min33 views
10 connections·12 entities in this video→

Understanding UFW (Uncomplicated Firewall)

  • πŸ’‘ UFW stands for Uncomplicated Firewall, a command-line tool for managing firewall rules on Linux systems.
  • πŸ”‘ Administrative permissions are required to use UFW commands, necessitating the use of sudo.

Enabling and Checking Firewall Status

  • βš™οΈ To activate the firewall, use the command sudo ufw enable. The firewall will also be enabled on system startup.
  • πŸ“Š You can verify the firewall's status by running sudo ufw status. Initially, it might show as inactive by default.

Managing Network Ports with UFW

  • πŸšͺ To open a specific port, use sudo ufw allow followed by the port number (e.g., sudo ufw allow 22 for SSH).
  • 🌐 You can also specify the protocol when allowing ports, such as sudo ufw allow 80/tcp for HTTP.
  • 🚫 To block or deny a port, use sudo ufw deny followed by the port number (e.g., sudo ufw deny 443 for HTTPS).

Advanced UFW Rule Management

  • πŸ”’ To view all configured rules with their corresponding numbers, use sudo ufw status numbered.
  • πŸ—‘οΈ Rules can be deleted by their number (e.g., sudo ufw delete [rule_number]) or by specifying the exact rule (e.g., sudo ufw delete deny 443).

Disabling the Firewall

  • πŸ›‘ If you need to disable the firewall, use the command sudo ufw disable. This will stop the firewall and disable it on system startup.
Knowledge graph12 entities Β· 10 connections

How they connect

An interactive map of every person, idea, and reference from this conversation. Hover to trace connections, click to explore.

Hover Β· drag to explore
12 entities
Chapters2 moments

Key Moments

Transcript17 segments

Full Transcript

Topics13 themes

What’s Discussed

UFWUncomplicated FirewallLinux FirewallPort ManagementNetwork SecuritySSHHTTPHTTPSTCPUDPCommand Line InterfaceUbuntuDebian
Smart Objects12 Β· 10 links
ConceptsΒ· 11
ProductΒ· 1