CentOS 7 安装 SSR

shadowsocks is an open-source encrypted proxy project,
usually use to pass GFA (Great Firewall of China)

shadowsocks 是开源加密代理项目, 一般用于科学上网使用.

Installation 安装

  1. add repo to yum, 添加 repo 源
1
2
3
cd /etc/yum.repos.d/
curl -O https://copr.fedorainfracloud.org/coprs/librehat/shadowsocks/repo/epel-7/librehat-shadowsocks-epel-7.repo
yum install -y shadowsocks-libev
  1. edit config 编辑配置文件
1
2
3
4
5
6
7
8
9
10
$vim /etc/shadowsocks-libev/config.json

{
"server": "0.0.0.0",
"server_port": 3389,
"password": "login_password",
"method":"aes-256-cfb",
"mode": "tcp_and_udp",
"timeout":3600
}
  1. check config workfine 检测配置是否生效
1
ss-server -c /etc/shadowsocks-libev/config.json
  1. start service 开启服务
1
2
systemctl restart shadowsocks-libev
systemctl enable shadowsocks-libev
  1. check log 检查日志
1
2
3
journalctl -u shadowsocks-libev
tail -f /var/log/messages
tail -f /var/log/secure

Errors 可能的报错

  1. Error Message 出现下面错误的解决方法

ss-local: error while loading shared libraries: libmbedcrypto.so.0:
cannot open shared object file: No such file or directory

Solution: install mbedtls-devel

解决方法: 安装 mbedtls-devel 依赖

1
2
3
4
$ yum install mbedtls-devel
$ cd /usr/lib64
$ ls |grep mbed
$ ln -sf libmbedcrypto.so.1 libmbedcrypto.so.0

Reference 参考文档

https://zzz.buzz/zh/gfw/2017/08/14/install-shadowsocks-server-on-CentOS-7/

https://github.com/shadowsocks/shadowsocks-libev/issues/1966

Donate - Support to make this site better.
捐助 - 支持我让我做得更好.