zoukankan      html  css  js  c++  java
  • ssh代理登陆脚本

    ssh代理是很多人都会用到的翻x手段

    优点:这个可以通过浏览器的插件来定义规则选择哪些网站需要通过代理访问,哪些不需要。

    缺点:只可以通过浏览器进行访问,手机等移动设备还是得借助VPN才可以。

    下面是一个我用的登陆脚本,不用每次开代理前都要敲行命令进去直接在本机配置一个crontab就可以了,可以断线重连,很方便的。

    PID=$(ps aux|grep ssh|grep fgnTN|grep -v grep |awk '{print $2}')
    echo $PID
    if [ $? -eq 0 -a ! -z "$PID" ]
    then
     echo "SSH Proxy server is on..."
    else
     echo "SSH Proxy server is death..."
     ssh -fgnTN -D 7079 xxxx@linode
     if [ $? -eq 0 ]
     then
     echo "SSH Proxy Service restart successd."
     else
     echo "SSH Proxy Service restart failed."
     fi
    fi

    个人博客地址:http://www.yancey.info/?p=39

  • 相关阅读:
    第五章4
    第五章3
    第五章2
    第五章1
    第四章14
    第四章13
    第四章12
    第四章11
    第五章例5-6
    第五章例5-4
  • 原文地址:https://www.cnblogs.com/yancey/p/3383498.html
Copyright © 2011-2022 走看看