我在Ubuntu1604上运行的sslocal,但是发现firefox无法链接ss代理,后来用的chromium才成功连接上,
---------------------------- 下面是正文 -------------------
vultr是按使用时长计费的,比较划算
1.注册并付款:www.vultr.com // 这个就不多说了,现在都支持支付宝付款
2.创建服务器
2.1. 选择Server Location,我选的Tokyo
2.2. 选择Server Type,我选的ubuntu
2.3. 选择Server Size,我选的$5/mo的
2.4. 配置SSH Keys(以便远程SSH登录)(我把我做过的关键步骤高亮),配置好了以后点击选中它
Creating an SSH key on Linux
The tools to create and use SSH are standard, and should be present on most Linux distributions. With the following commands, you can generate ssh key.
- Run:
ssh-keygen -t rsa
. For a more secure 4096-bit key, run:ssh-keygen -t rsa -b 4096
- Press enter when asked where you want to save the key (this will use the default location).
- Enter a passphrase for your key.(就是你私钥的密码,你输一个密码就是了,自己记住,其实后面SSH登录也用不着你输这个密码)
- Run
cat ~/.ssh/id_rsa.pub
- this will give you the key in the proper format to paste into the control panel. (注意这里cat输出的内容就是你的公钥,下面有个步骤让你粘贴,就是粘贴这个东西,要全部粘贴过去,一个字符不漏) - Make sure you backup the
~/.ssh/id_rsa
file. This cannot be recovered if it is lost.
Adding an SSH key to your control panel(这个照做就是了,)
- Once you're logged in, go to https://my.vultr.com/sshkeys.
- Click "Add SSH Key".
- Enter a descriptive name for the key.(你随便给它取个名字就是了)
- Paste in your SSH public key. This is a long string beginning with "ssh-rsa". You should have saved this from when you generated your key.
- Click "Add SSH Key".
- Now, when you're deploying servers you will be able to select which SSH keys you want to add to the newly deployed server.
2.5. 点击Deploy Now部署服务器,等待其建好
2.6. 服务器建好之后,点击它,进入服务器Overview页面
在这里你可以看到服务器的:
IP地址(比如说123.123.123.123)
用户名(一般就是`root`,待会你ssh登录就用这里用户名)
密码(ssh登录的时候让你输密码就用这个密码)
2.6. SSH登录服务器、安装*
2.6.1. SSH登录
切换到步骤2.4.中创建id_rsa.pub所在的目录
输入如下命令登录
ssh -i id_rsa root@123.123.123.123
2.6.2. 服务器安装*
输入如下命令安装*
apt install python-pip export LC_ALL=C // 这是为了解决一个pip install的报错,如果没报错可以忽略这一行 pip install setuptools pip install *
创建*配置文件ss.json
touch ss.json // 创建配置文件 vi ss.json // vi编辑配置文件,内容如下,按i键开始编辑,按ESC返回到命令行,输入:wq保存并退出 { "server":"123.123.123.123", // 服务器IP地址 , // 端口号 "local_address": "127.0.0.1", // 绑定本地IP地址,貌似对服务端没用,默认就行 , // 绑定本地端口号 "password":"asdf123456", // 客户端登录要用的密码 , // 默认即可,想了解可以翻文档 "method":"aes-256-cfb", // 默认即可,想了解可以翻文档 "fast_open": false // 默认即可,想了解可以翻文档 }
服务器端启动*
ssserver -c ss.json
2.7. 客户端连接
同样按照2.6的步骤做,唯一不同的就是客户端启动用的是sslocal而不是ssserver命令
2.8. firefox配置socks代理
另外:
ssserver和sslocal可以用-v选项查看DEBUG信息,在没用daemon和log的情况下有助于解决一些连不上的问题
另外如果可以利用本地的192.168.x.x的地址来建立ssserver测试