firewall-configuration

Configure a deny-by-default UFW firewall on Ubuntu/Debian VPS servers.

6|1|Updated Jan 31, 2026
One-click install
npx skills add https://github.com/mikr13/secure-server-setup-skills --skill firewall-configuration
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: firewall-configuration
Source: https://github.com/mikr13/secure-server-setup-skills/tree/main/secure-server-setup/firewall-configuration
Command: npx skills add https://github.com/mikr13/secure-server-setup-skills --skill firewall-configuration

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Insecure VPS setups expose services and ports to the internet; this Skill guides you to deploy and configure a focused UFW firewall to restrict unwanted access.

Core Features & Use Cases

  • Install and enable the UFW firewall on Ubuntu/Debian systems
  • Set secure default policies (deny incoming, allow outgoing)
  • Open necessary ports for services (SSH, web, database as required)
  • Create and manage application-specific rules
  • Verify firewall status and support IPv4/IPv6 traffic
  • Use during initial hardening, ongoing security maintenance, and audits

Quick Start

Install and configure the UFW firewall on your Ubuntu/Debian VPS with a secure default-deny posture.

Frequently Asked Questions about firewall-configuration

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure a UFW firewall to harden my VPS?

Configure a UFW firewall on your VPS by installing UFW, setting default policies to deny incoming traffic, explicitly permitting SSH, and verifying rules to prevent lockouts. This restricts unwanted network access on Ubuntu/Debian servers.

Do I need to allow SSH before enabling UFW default deny rules?

Yes, you must allow SSH before enabling UFW default deny rules. Configuring a deny-by-default firewall without explicitly permitting SSH traffic will lock you out of your VPS server immediately upon firewall activation.

What is the best way to open specific ports for web services using UFW?

The best way to open ports for web services using UFW is to create application-specific rules after establishing default deny policies. This ensures only necessary services are exposed while maintaining server security during ongoing maintenance and audits.

Does this UFW configuration work with both IPv4 and IPv6 traffic?

Yes, UFW configuration supports both IPv4 and IPv6 traffic. Setting up default policies and application-specific rules applies the deny-by-default security posture across both protocols to fully restrict network access on your VPS.

Can I use UFW for server hardening during security audits?

Yes, you can use UFW for server hardening during security audits. It allows you to verify firewall status, validate active port rules, and ensure a strict deny-by-default posture is maintained across your VPS environment.

Why is my SSH connection dropping after setting UFW default deny?

Your SSH connection drops after setting UFW default deny because the firewall blocks all incoming traffic by default. You must create an explicit rule to permit SSH before enabling UFW to prevent server lockouts.