First, apply for a free domain name from the peanut shell or other dynamic domain names.
1. Write the rules on the server to prevent SSH connection failure.
-A input DROP-A INPUT-p tcp -- dport 80-j ACCEPT-A INPUT-p tcp -- dport 22-s finy. hhks. cc-j ACCEPT
2. Direct the IP address of the domain name to the IP address of your current office
3. the cron task refreshes the IP address of the domain name once every five minutes.
#! /Bin/bashiptable =/etc/init. d/iptablesrestart () {$ iptables restart} restartvi/etc/cron */5 *****/usr/iptables_scripts/iptables. sh
4. Can the domain name be correctly resolved?
Ping finy. hhks. cc
The actual IP address is consistent.
In this way, except that your domain name IP Address can access your server's SSH, it will not work, and it is useful to deal with profiteering cracking.
Refresh the IP record of the dynamic domain name once every 5 minutes.