ShadowsocksR 单用户版安装教程

9,912 views次阅读
没有评论

ShadowsocksR 单用户版安装教程

Shadowsocks原作者被喝茶 放弃此项目,由ShadowsocksR作者接手,所以以后只能转成SSR的服务端和客户端了。

本教程转自github,由ShadowsocksR作者编写!

 

基本安装

以下命令均以root用户执行,或sudo方式执行

centos:

yum update

yum install git -y

 

ubuntu/debian:

apt-get update

apt-get install git -y

 

Chacha20

如果要使用Chacha20 chacha20-ietf 等加密方式,请安装 libsodium

 

获取源码

git clone -b manyuser https://github.com/shadowsocksr/shadowsocksr.git

 

执行完毕后此目录会新建一个shadowsocksr目录

子目录中的是单用户版(即shadowsocksr/shadowsocks)

 

根目录即 shadowsocksr

子目录即 shadowsocksr/shadowsocks

 

配置ShadowsocksR

进入 ShadowsocksR根目录:

cd shadowsocksr

 

初始化配置:

bash initcfg.sh

 

使用配置文件运行ShadowsocksR

打开根目录的 user-config.json 文件,修改配置内容。

默认配置如下:

{
"server": "0.0.0.0",
"server_ipv6": "::",
"server_port": 8388,
"local_address": "127.0.0.1",
"local_port": 1080,

"password": "m",
"method": "aes-128-ctr",
"protocol": "auth_aes128_md5",
"protocol_param": "",
"obfs": "tls1.2_ticket_auth_compatible",
"obfs_param": "",
"speed_limit_per_con": 0,
"speed_limit_per_user": 0,

"additional_ports" : {}, // only works under multi-user mode
"additional_ports_only" : false, // only works under multi-user mode
"timeout": 120,
"udp_timeout": 60,
"dns_ipv6": false,
"connect_verbose_info": 0,
"redirect": "",
"fast_open": false
}

 

参数说明:

[code]"server_port":8388, //端口
"password":"password", //密码
"protocol":"origin", //协议插件
"obfs":"http_simple", //混淆插件
"method":"aes-128-ctr", //加密方式[/code]

按照自己需要的配置一下就可以了,至于使用什么方法去打开这个文件,修改这个文件不在本文讨论范围。

 

赋予脚本运行权限

进入子目录即 shadowsocksr/shadowsocks

chmod +x *.sh

 

启动服务测试ShadowsocksR

./logrun.sh

 

使用客户端测一下是否已经正常可以使用,如果不行查看上面的配置文件,修改相应项目。

 

ShadowsocksR开机启动

通过上面的配置,ShadowsocksR已经可以正常使用,但服务器重启后,ShadowsocksR将不会自动开启,所以需要设置开机启动。

Cent OS 系统:

/etc/rc.d/rc.local

在上面配置文件的最后加入:

/bin/bash /root/shadowsocksr/shadowsocks/logrun.sh

 

Ubuntu/Debian 系统:

/etc/rc.local

在上面配置文件最后的 exit 0 前面加入:

/bin/bash /root/shadowsocksr/shadowsocks/logrun.sh

 

配置多用户端口

修改根目录即 shadowsocksr 下的 user-config.json文件:

{
"server": "0.0.0.0",
"server_ipv6": "::",
"local_address": "127.0.0.1",
"local_port": 1080,
"port_password":{
"8888":"password1",
"9999":"password2",
"2333":"password3"
},
"timeout": 120,
"udp_timeout": 60,
"method": "aes-128-ctr",
"protocol": "auth_aes128_md5",
"protocol_param": "",
"obfs": "tls1.2_ticket_auth_compatible",
"obfs_param": "",
"speed_limit_per_con": 0,
"speed_limit_per_user": 0,
"dns_ipv6": false,
"connect_verbose_info": 0,
"redirect": "",
"fast_open": false
}

 

更新ShadowsocksR源代码

进入根目录即 shadowsocksr

git pull

成功后重启SS服务就可以了

 

备注

如果你的服务端python版本在2.6以下,那么必须更新python到 2.7.x 版本

正文完
 0
HopoL
版权声明:本站原创文章,由 HopoL 于2017-06-23发表,共计2256字。
转载说明:除特殊说明外本站文章皆由CC-4.0协议发布,转载请注明出处。
评论(没有评论)

HopoL's Blog

文章搜索
最新评论
Metaldololity Metaldololity Whoa, that's really simple. You just save my time a lot. Thankyou!
HopoL HopoL Since you’ve got the backup, it’s actually pretty simple. Just restore the backup files to your new flash drive, then head over to the /config directory and edit the go file. Look for export UNRAID_GUID=xxxxxxxxxxxxxx and swap it with your new drive's GUID. That should do the trick!
Metaldololity Metaldololity Really apreciate for your fast respond, mate. I actually have the backup of the flashdrive (from regular unraid backup). The problem is, when i search on youtube tutorial about changing the failed flashdrive, the process need some sort of confirmation with an account in unraid (blacklist the old one -> whitelist the new one). Since i have a cracked unraid, i don't know how to register my new flashdrive as the correct one (and the system not asking me for the old failed flashdrive). Thanks in advance
HopoL HopoL Man, that's a tough spot to be in. Regularly backing up your /boot folder is super important for exactly this reason. If you don't have a backup and your flash drive is completely fried, your best bet is to Google some specific recovery guides or check the Unraid forums. There are ways to rebuild your config by identifying your parity and data drives, but it can be a bit of a process. Hope you can get it sorted!
Metaldololity Metaldololity Hi! Huge thanks for the update on 7.2.0. I have question here, my flashdrive corrupted. how do i install it on the new flashdrive without losing all my configuration?