Guides tagged “ufw”

Step-by-step MdmHost guides about ufw, sorted A-Z.

16 guides

  • Block an IP address or subnet with UFW

    Block single IP addresses and whole CIDR ranges with ufw deny, place deny rules above your allow rules so they actually work, find attacking IPs in your logs and unblock them later.

    BeginnerLinux server5 min read
  • Configure firewall rules for a Virtualizor VPS

    Protect your VPS with firewall rules: use Virtualizor's firewall where your provider enables it, or configure UFW or firewalld inside the VPS without locking yourself out.

    IntermediateVirtualizor VPS3 min read
  • Delete, insert and reorder UFW rules safely

    List UFW rules by number, delete them by number or by rule text, insert a rule at a set position and reset UFW without cutting off your own SSH session.

    BeginnerLinux server6 min read
  • First steps after your Linux VPS is ready (SSH, updates, firewall)

    Log in over SSH, change the root password, install updates, add a sudo user and switch on a firewall without locking yourself out.

    BeginnerLinux server2 min read
  • How to install MongoDB on Ubuntu and secure it

    Install MongoDB on Ubuntu from the official repository, enable authentication, create an admin user, and restrict access with bindIp and UFW.

    IntermediateLinux server6 min read
  • Locked out by your firewall? How to get back into your VPS

    If a firewall rule blocked SSH, you can still reach your server through the browser console in your VPS provider's control panel. Disable the firewall, fix the rule and turn it back on safely.

    BeginnerLinux server5 min read
  • Open ports with UFW: single ports, ranges and trusted IPs

    Open TCP and UDP ports in UFW, allow port ranges, limit access to one IP or subnet, label rules with comments and confirm everything with ufw status numbered.

    BeginnerLinux server5 min read
  • Port forwarding and NAT with UFW before.rules

    Forward a public port on your VPS to a backend server or VPN client with UFW. Turn on IP forwarding, add a nat table to before.rules, allow routed traffic and test from outside.

    AdvancedLinux server5 min read
  • Rate-limit SSH and other ports with ufw limit

    Use ufw limit to slow down SSH brute-force attempts. Learn how the 6-connections-in-30-seconds rule works, apply it to a custom SSH port, pair it with Fail2ban and test it.

    BeginnerLinux server5 min read
  • Read and tune UFW firewall logs

    Turn on UFW logging at the right level, find [UFW BLOCK] lines in the journal or ufw.log, read the SRC, DPT and PROTO fields and keep log volume under control.

    IntermediateLinux server5 min read
  • Restrict outgoing traffic with UFW egress rules

    Switch UFW to deny outgoing traffic by default, then allow only DNS, NTP, HTTPS and package mirrors. Block outbound SMTP and avoid breaking system updates along the way.

    AdvancedLinux server5 min read
  • Set up a UFW firewall on Ubuntu and Debian

    Set safe defaults, allow SSH before switching UFW on, open only the ports you use, limit sensitive ports to your own IP, and tidy up old rules.

    BeginnerLinux server3 min read
  • Stop Docker from bypassing your UFW firewall

    Docker-published ports skip UFW rules and stay open to the internet. Learn why it happens, how to bind ports to 127.0.0.1, how to filter with the DOCKER-USER chain and how to test from outside.

    AdvancedLinux server6 min read
  • Test firewall changes safely with an automatic rollback

    Schedule an automatic undo before you change firewall rules. If a mistake blocks SSH, the old rules come back by themselves a few minutes later.

    IntermediateLinux server5 min read
  • UFW and IPv6: make sure your rules cover both

    Check that UFW filters IPv6 as well as IPv4. Set IPV6=yes, read the (v6) rules in ufw status, allow or deny IPv6 sources and test your server from outside with nmap -6.

    IntermediateLinux server5 min read
  • UFW vs firewalld vs nftables vs iptables: which Linux firewall to use

    UFW, firewalld, nftables and iptables are not four rival firewalls. Learn how they fit together, what each distro uses by default and how to pick one tool for your VPS.

    BeginnerLinux server5 min read

Browse by topic

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.