Interview Prep/Linux/Firewalls, MAC & Compliance

How do you avoid locking yourself out when changing remote firewall rules?

IntermediateProductionFirewalls, MAC & Compliance
Answer
  • Schedule an automatic rollback first: echo "nft -f /etc/nftables.conf.bak" | sudo at now + 5 minutes, then cancel with atrm once you confirm access.
  • Use firewall-cmd runtime changes (lost on reload) before making them permanent.
  • Keep an established SSH session open (ct state established accept keeps it alive).
  • Have console access (cloud serial console, iLO/iDRAC) ready.
All Linux questions Roadmap: Linux

More on Firewalls, MAC & Compliance