Securing Your VPS with UFW Firewall

Securing Your VPS with UFW Firewall

UFW (Uncomplicated Firewall) helps you manage firewall rules on your VPS and block unauthorized access.

Step 1: Install UFW

sudo apt update && sudo apt install ufw -y

Step 2: Allow SSH

If your SSH is running on port 2222:

sudo ufw allow 2222/tcp

Step 3: Allow Other Services

sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

Step 4: Enable UFW

sudo ufw enable

Step 5: Check Status

sudo ufw status verbose

✅ Now your VPS only allows trusted connections and is protected from unwanted traffic.

  • Firewall, UFW, Server Protection, VPS Security
  • 0 istifadəçi bunu faydalı hesab edir
Bu cavab sizə kömək etdi?

Uyğun məqalələr

How to Set Up a Firewall (UFW) on Your VPS

How to Secure Your VPS with a Firewall A firewall is essential for protecting your VPS from...

Securing SSH Access on Your VPS

Securing SSH Access on Your VPS SSH is the primary way to access your VPS. By hardening SSH,...

Protecting Your VPS with Fail2Ban

Protecting Your VPS with Fail2Ban Fail2Ban helps protect your VPS from brute-force attacks by...

Disable Root Login for Better VPS Security

Disable Root Login for Better VPS Security Allowing direct root login via SSH is risky and...

Change Default SSH Port to Prevent Attacks

Change Default SSH Port to Prevent Attacks By default, SSH runs on port 22, which is the...