Created
February 14, 2013 07:41
-
-
Save shroukkhan/4951181 to your computer and use it in GitHub Desktop.
#this script will log you in and then add your publip ip to the allowed list in iptables.
#necessary because http is blocked by iptables for security reason
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
#!/bin/bash | |
login="root" | |
pass="PASSWORD" | |
ip="MY_IP_ADDRESS" | |
publicip=$(wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//') | |
sshpass -p $pass ssh $login@$ip "iptables -I INPUT -j ACCEPT -s $publicip" | |
sshpass -p $pass ssh $login@$ip | |
#this script will log you in and then add your publip ip to the allowed list in iptables. | |
#necessary because http is blocked by iptables for security reason | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment