差别
这里会显示出您选择的修订版和当前版本之间的差别。
后一修订版 | 前一修订版 | ||
tech:op:shadowsocks [2017/05/06 10:01:40] 某喵 创建 |
tech:op:shadowsocks [2018/07/15 18:14:31] (当前版本) 某喵 |
||
---|---|---|---|
行 1: | 行 1: | ||
- | <markdown> | ||
# Shadowsocks Tips | # Shadowsocks Tips | ||
+ | |||
+ | ## [Centos 6] 安装 pip@9.0.3 | ||
+ | ``` | ||
+ | curl https://bootstrap.pypa.io/2.6/get-pip.py -o get-pip.py | ||
+ | python get-pip.py | ||
+ | ``` | ||
+ | |||
+ | ## [Centos 7 + OpenVZ] 安装 pip@10.0.1 + BBR | ||
+ | |||
+ | ``` | ||
+ | curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py | ||
+ | python get-pip.py | ||
+ | |||
+ | # wget --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh | ||
+ | wget --no-check-certificate https://raw.githubusercontent.com/kuoruan/shell-scripts/master/ovz-bbr/ovz-bbr-installer.sh | ||
+ | chmod +x ovz-bbr-installer.sh | ||
+ | ./ovz-bbr-installer.sh | ||
+ | |||
+ | # 关闭 firewalld | ||
+ | systemctl disable firewalld | ||
+ | systemctl stop firewalld | ||
+ | ``` | ||
+ | |||
+ | [参考](https://www.bandwagonhost.net/bandwagonhost-bbr.html) | ||
## Shadowsocks ssserver 搭建 | ## Shadowsocks ssserver 搭建 | ||
- | // TODO | + | |
+ | ``` | ||
+ | sudo pip install shadowsocks | ||
+ | sudo ssserver -c /etc/shadowsocks/config.json -vv # 注意 server IP 需要写为 0.0.0.0 | ||
+ | sudo ssserver -c /etc/shadowsocks/config.json -d start | ||
+ | ``` | ||
+ | |||
+ | ## [CentOS 6] 开机自启 | ||
+ | |||
+ | ``` | ||
+ | vi /etc/rc.local | ||
+ | ``` | ||
+ | |||
+ | ``` | ||
+ | ssserver -c /etc/shadowsocks/config.json -d start | ||
+ | ``` | ||
+ | |||
+ | |||
+ | ## [CentOS 7] 开机自启 | ||
+ | |||
+ | ``` | ||
+ | vi /usr/lib/systemd/system/ss.service | ||
+ | ``` | ||
+ | |||
+ | ``` | ||
+ | [Unit] | ||
+ | Description=Shadowsocks | ||
+ | After=network.target | ||
+ | |||
+ | [Service] | ||
+ | TimeoutStartSec=0 | ||
+ | ExecStart=/usr/bin/ssserver -c /etc/shadowsocks/config.json | ||
+ | ExecReload=/bin/kill -HUP $MAINPID | ||
+ | Restart=on-failure | ||
+ | |||
+ | [Install] | ||
+ | WantedBy=multi-user.target | ||
+ | ``` | ||
+ | |||
+ | ``` | ||
+ | systemctl enable ss.service | ||
+ | systemctl start ss.service | ||
+ | systemctl status ss.service | ||
+ | ``` | ||
+ | |||
+ | ## 配置安全组和 ufw (如果需要 zoe 代理) | ||
## Shadowsocks client | ## Shadowsocks client | ||
- | // TODO | ||
- | </markdown> | + | - 本地建立 config.json 文件 |
+ | ``` | ||
+ | { | ||
+ | "server" : "IP", | ||
+ | "server_port" : port, | ||
+ | "password" : "xxx", | ||
+ | "timeout": 300, | ||
+ | "method": "aes-256-cfb" | ||
+ | } | ||
+ | ``` | ||
+ | |||
+ | - 安装 sslocal & proxychains | ||
+ | - 启动 sslocal | ||
+ | ``` | ||
+ | sslocal -c config.json -vv | ||
+ | ``` | ||
+ | |||
+ | - 通过 proxychains 代理访问 |