Skip to content

Instantly share code, notes, and snippets.

@ph00lt0
Last active March 18, 2022 19:47
Show Gist options
  • Save ph00lt0/cf47f5b12ba2ab9e72aa81bce733f86f to your computer and use it in GitHub Desktop.
Save ph00lt0/cf47f5b12ba2ab9e72aa81bce733f86f to your computer and use it in GitHub Desktop.
Delete an ip to revoke ssh access from the IP address to hetzner cloud through the Hetzner cli. This is useful when ip address changed.
hcloud firewall list
read -p "Enter the Firewall ID you want to remove a IP to:" firewallID
hcloud firewall describe $firewallID
read -p "Enter the IP you want to remove your IP to:" ip
hcloud firewall delete-rule --direction in --protocol tcp --port 22 --source-ips $ip/32 $firewallID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment