I got tired of China trying to hack my Linux based Raspberry PI . So I turned off IP forwarding for ssh on my router, but now I couldn’t get into my PI from the internet. So I locked down my PI with iptables, and I still I can’t get from the internet into my PI with ssh. So I wrote a bash script/CGI that if you know the URL and know the remote IP address where you are coming from, you can open a hole with iptables using a web browser and never have to login to the server. Then lock it back down when you are done.
NOTE: CHANGE THE NAME OF THE SCRIPT TO SOMETHING UNIQUE TO YOU! The point is that only YOU know about the URL.
How it works:
Note: Sometimes you may be NAT'd at the source or where you come from isn't what your computer sees and it will not work.