Created
March 18, 2022 19:40
-
-
Save ph00lt0/9b574e03d96315b915f9c8b8544e4720 to your computer and use it in GitHub Desktop.
Add your ip to allow ssh from your current IP address to hetzner cloud through the Hetzner cli
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
ip=$(curl http://icanhazip.com) | |
hcloud firewall list | |
read -p "Enter the Firewall ID you want to add your IP to:" firewallID | |
hcloud firewall add-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