sshuttle

只能说这个太给力了。对于受限的Shell,不能安装使用VPN,不能修改sshd_config(启用AllowTCPForwarding),这样就不能用VPN或者SSH tunnel翻墙了。sshuttle就避免了这样的问题,即使sshd_config中禁用了AllowTCPForwarding,也可以用于翻墙。不过根据我上Youtube的感受,sshuttle要比SSH tunnel慢。

在0.53和0.54版本里面,--listen和--dns选项似乎有冲突。命令行参数如下,

-vv --dns -r $server --pidfile /tmp/sshuttle.pid 0.0.0.0/0 -x 192.168.0.0/16 --listen 0.0.0.0:0

建立代理后,所有DNS查询皆失败,例如:

$ dig g.cn

;; reply from unexpected source: 192.168.2.6#12300, expected 192.168.2.1#53

;; reply from unexpected source: 192.168.2.6#12300, expected 192.168.2.1#53

Ubuntu下可以直接用sudo apt-get install sshuttle安装。

https://github.com/apenwarr/sshuttle