SSH反向代理翻墙

如果你有一台国外的服务器,你就可以直接通过它来翻墙了.小心为好,还是会被GFW ban掉.

连接前可以先做以下简单配置

在家目录的.ssh中创建config,然后做以下配置

1
2
3
4
Host remote-host
HostName 10.0.0.2 #你的ip
User root
Port 22

生成你的公钥私钥对

1
ssh-keygen

上传你的公钥,需要输入登录密码

1
ssh-copy-id -i ~/.ssh/id_rsa.pub root@remote-host

建立连接

1
ssh -D 7878 -f -C -q -N remote-host

之后你就可以通过浏览器代理使用socks5进行连接了.