[ssh] 用ssh作为socks 服务代理上网

    在 DreamHost 上申请了空间之后,因为 DreamHost 上的帐号支持shell,并且允许ssh登录。有了ssh,我们就可以做很多事了。

    在 irc://irc.debian.org/#debian-zh 上看到 mikelish 写到通过在DreamHost 上架设 tinyproxy 上某些网站: [ 回国第一件事,保证网络畅通] ,照着上面写的做了一下,发现果然很爽,比起 tor 的方式要快多了。

    今天便收到DreamHost 的来信,告知我的tinyproxy 已经被关掉了,而且希望我不要再使用这种服务。于是又跑到 irc://irc.debian.org/#debian-zh 上说了说, Chaos`Eternal 马上提示说,ssh本身就支持作为socks 服务的,
mikelish 提到可以搭配privoxy 使用。

    privoxy 是我早就安装了搭配tor 使用,于是看了看 ssh 的手册,修改了一下 privoxy 的配置文件,搞定了这件事,如下:

    privoxy 的配置文件 (/etc/privoxy/config) 中添加如下一行:
forward-socks4 / localhost:3128 .
然后重新启动下 privoxy.
    将ssh 作为socks 服务连接到DreamHost:
$ ssh -D localhost:3128 your_user@your_site
    其中端口 3128 可以自己随便定义,只要大于1024,便不需root 的权限来执行。

    剩下的事情就是在浏览器里面指定将privoxy 作为代理服务来上某些网站了。

    通过 tor + privoxy 来上某些网站,可以参考我很久以前的一篇文章 Debian: tor + privoxy

评论

此博客中的热门博文

激活华为光猫的小宇宙-openwrt

[Google Maps] Where are you from?

Debian: tor + privoxy