Last active
February 20, 2021 15:48
-
-
Save FreedomBen/0aabe5493ba02d1c9bb33fea2ec5e944 to your computer and use it in GitHub Desktop.
Firewall Cockpit to only Me
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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