Skip to content

Instantly share code, notes, and snippets.

@FreedomBen
Last active February 20, 2021 15:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FreedomBen/0aabe5493ba02d1c9bb33fea2ec5e944 to your computer and use it in GitHub Desktop.
Save FreedomBen/0aabe5493ba02d1c9bb33fea2ec5e944 to your computer and use it in GitHub Desktop.
Firewall Cockpit to only Me
# Get your IP address from home or work: curl -s 'https://api.ipify.org'
# Replace with your IP. Can get it with the above command if you'd like
# This can also be a CIDR range if you own or trust a block
MY_IP=<ip>
firewall-cmd --zone-public --permanent --remove-service=cockpit
firewall-cmd --zone=public --permanent \
--add-rich-rule="rule family=\"ipv4\" source address=\"${MY_IP}\" port protocol=\"tcp\" port=\"9090\" accept"
firewall-cmd --reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment