SSR 配置及使用
此文转载 “梅骏逸的博客” 本篇说明仅供交流与学习使用,请勿作出任何违反国家法律的行为!
配置服务端 ShadowsocksR
1. 首先你要有一个 VPS,推荐使用 Vultr 这个 VPS 服务商
2. 使用 ssh 登陆到 root 用户后运行一下命令(这是一位大佬的一键配置文件,他的网站):
wget --no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocksR.sh chmod +x shadowsocksR.sh ./shadowsocksR.sh 2>&1 | tee shadowsocksR.log
3. 接下来设置密码端口,加密方式,协议,混淆(obfs)就可以了。
① 提示选择哪个版本安装,我们输入2后按回车,即选择SSR安装。 1) Shadowsocks-Python 2) ShadowsocksR 3) Shadowsocks-Go 4) Shadowsocks-libev ② 然后会提示设置SSR密码,输入自定义密码后按回车,建议不要使用默认密码。 ③ 接下来选择SSR要使用的服务器端口,随便输入一个,也可以默认回车。 ④ 然后选择加密方式,如果选择chacha20的话,就输入对应序号12,按回车继续。 1) none 2) aes-256-cfb 3) aes-192-cfb 4) aes-128-cfb 5) aes-256-cfb8 6) aes-192-cfb8 7) aes-128-cfb8 8) aes-256-ctr 9) aes-192-ctr 10) aes-128-ctr 11) chacha20-ietf 12) chacha20 13) salsa20 14) xchacha20 15) xsalsa20 16) rc4-md5 ⑤ 接下来选择协议,建议选择自auth_aes128_md5开始以下的几种,输入对应序号按回车。 1) origin 2) verify_deflate 3) auth_sha1_v4 4) auth_sha1_v4_compatible 5) auth_aes128_md5 6) auth_aes128_sha1 7) auth_chain_a 8) auth_chain_b 9) auth_chain_c 10) auth_chain_d 11) auth_chain_e 12) auth_chain_f ⑥ 然后选择混淆方式,一般默认就行,选择好后按回车。 1) plain 2) http_simple 3) http_simple_compatible 4) http_post 5) http_post_compatible 6) tls1.2_ticket_auth 7) tls1.2_ticket_auth_compatible 8) tls1.2_ticket_fastauth 9) tls1.2_ticket_fastauth_compatible ⑦ 以上参数选择完成后,按任意键开始安装。 ⑧ 安装完成后,会有如下图安装成功的提示,记住刚才设置的各项参数,在客户端连接时需要用到。 ⑨ 经过以上几个简单的参数选择后,SSR服务器端已经自动安装成功了。保险起见,输入reboot重启VPS服务器,SSR会自动随系统重启。
4. 安装完成后,会有脚本提示如下:
Congratulations, ShadowsocksR server install completed!
Your Server IP :your_server_ip
Your Server Port :your_server_port
Your Password :your_password
Your Protocol :your_protocol
Your obfs :your_obfs
Your Encryption Method:your_encryption_method
Welcome to visit:https://shadowsocks.be/9.html
Enjoy it!
5. 将你的配置信息输入到客户端中就可以使用了
管理你的 ShadowsocksR
卸载
1 | ./shadowsocksR.sh uninstall |
查看状态
1 | /etc/init.d/shadowsocks status |
启动
1 | /etc/init.d/shadowsocks start |
停止
1 | /etc/init.d/shadowsocks stop |
重启
1 | /etc/init.d/shadowsocks restart |
文件目录
配置文件路径:/etc/shadowsocks.json 日志文件路径:/var/log/shadowsocks.log 代码安装目录:/usr/local/shadowsocks
配置多用户
{ "server":"0.0.0.0", "server_ipv6": "[::]", "local_address":"127.0.0.1", "local_port":1080, "port_password":{ "8989":"password1", "8990":"password2", "8991":"password3" }, "timeout":300, "method":"aes-256-cfb", "protocol": "origin", "protocol_param": "", "obfs": "plain", "obfs_param": "", "redirect": "", "dns_ipv6": false, "fast_open": false, "workers": 1 }
其中把 "server"
替换成自己的地址就可以了,"port_password"
自己设置,其它的视自己情况更改。修改配置文件