标签:local update bsp nat upd 主机 amp log 命令
SSH tunneling 相关
参考資料:http://www.ibm.com/developerworks/cn/linux/l-cn-sshforward/
本地端口转发:
远程端口转发:
目标主机:
#!/bin/bash #dynamic domain name: fanhui.f3322.net #URL: http://www.pubyun.com http://www.3322.net Keep_Alive() { while : do count=$(ps ax | grep -c "ssh -gNTR 9527:localhost:22 fh@fanhui.f3322.net") if [[ $count -lt 2 ]] then su fh -c "ssh -gNTR 9527:localhost:22 fh@fanhui.f3322.net" fi sleep 300s done } Keep_Alive >/dev/null 2>&1 &
云端( SSH 中转站):
#!/bin/bash while : do lynx -mime_header -auth=kitex:aibbigql"http://members.3322.net/dyndns/update?system=dyndns&hostname=fanhui.f3322.net" 2>/dev/null Ip_0=$(curl http://members.3322.org/dyndns/getip) sleep 600s Ip_1=$(curl http://members.3322.org/dyndns/getip) while [[ $Ip_1 -eq $Ip_0 ]] do sleep 600s Ip_1=$(curl http://members.3322.org/dyndns/getip) done done
Linux基本功杂记——[023]——「OpenSSH tunneling」
标签:local update bsp nat upd 主机 amp log 命令
原文地址:http://www.cnblogs.com/hadex/p/6008084.html