6

利用ssh翻墙和同步dropbox

 3 years ago
source link: https://houye.xyz/2014-07/useSSH/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
利用ssh翻墙和同步dropbox

利用ssh翻墙和同步dropbox

算算dropbox被屏蔽几天了?

openDNS时好时坏,greenvpn(免费试用)在windows7上能正常连接,在debian上试遍了所有的服务器都不行。无意发现dropbox可以设置代理服务器,vpn买不起,买个ssh帐号用用。

连接到ssh服务器

有了ssh帐号后在终端敲入下列命令(自行替换) ssh -qTfnN -D 端口号 用户名@服务器地址 第一次连接会要求确认,yes即可。按提示输入密码,ok。

dropbox上设置代理。

  • 服务器类型为`SOCKS5`
  • 服务器为`127.0.0.1`
  • 端口号就是你刚连接ssh服务器的端口号

firefox

我下了个插件——**AutoProxy**,修改下里面代理服务器**ssh -D**的端口号,设**ssh -D**为默认代理。设置**AutoProxy**为自动模式。

连接ssh服务器脚本

敲入`ssh -qTfnN -D 端口号 用户名@服务器地址`后,要求输入密码,会方便起见,写了个交互的脚本。 需要先安装`expect`和`expect-dev`。 脚本内容如下

#!/usr/bin/expect -f
set PASSWD "你的密码"
spawn ssh -qTfnN -D 端口号 用户名@服务器地址
set timeout 300
expect "password:"
send   "$PASSWD\r"
expect eof

`spawn` 表示启动一个线程执行之后的命令

`expect “password:"` 匹配到`password:`后执行其后的send动作自动输入密码


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK