[CSDN原文已挂...](https://blog.csdn.net/dsgying/article/details/82588535) - https://github.com/citizen010/shadowsocks ## Debian8 部署shadowsocks ### 安装pip和几个依赖包 ```shell apt-get install python-pip python-gevent python-m2crypto pip install --upgrade setuptools ``` ## 安装shawdowsocks ``` pip install shawdowsocks ``` ## 配置 ```shell mkdir /etc/shadowsocks vim /etc/shadowsocks/config.json { "server":"139.162.121.43", "server_port":8388, "password":"{}", "timeout":600, "method":"aes-256-cfb", "fast_open": false } ``` ## 启动与停止shadowsocks ```shell ssserver -c /etc/shadowsocks/config.json -d start ssserver -c /etc/shadowsocks/config.json -d stop ``` 出现shadowsocks无法启动,首先用``find / -name openssl.py``找到配置文件然后编辑 ``` according to this link you can find any string like: libcrypto.EVP_CIPHER_CTX_cleanup.argtypes = (c_void_p,) and replace with: libcrypto.EVP_CIPHER_CTX_reset.argtypes = (c_void_p,) also, replace this part: libcrypto.EVP_CIPHER_CTX_cleanup with libcrypto.EVP_CIPHER_CTX_reset in the file openssl.py , which is located somewhere like /usr/lib/python2.7/dist-packages/shadowsocks/crypto/openssl.py , you could find it. ... and the problem would be solved. ``` 中文参考: [解决openssl升级到1.1.0后shadowsocks服务报错问题](https://blog.lyz810.com/article/2016/09/shadowsocks-with-openssl-greater-than-110/) ## CentOS7 ## centOS | shadowsocks-libev pip安装的shadowsocks总是报`socket.error`的错。所以改战shadowsock-libev。 ```bash cd /etc/yum.repos.d curl -O https://copr.fedorainfracloud.org/coprs/librehat/shadowsocks/repo/epel-7/librehat-shadowsocks-epel-7.repo yum -y install shadowsocks-libev setcap CAP_NET_BIND_SERVICE=+eip /usr/bin/ss-server sudo vi /etc/shadowsocks/config.json { "server":"0.0.0.0", "server_port":8388, "password":"{}", "timeout":600, "method":"aes-256-cfb", "fast_open": false } systemctl enable shadowsocks-libev --now systemctl enable firewalld --now firewall-cmd --add-port=443/tcp --permanent systemctl restart firewalld sudo ss-server -c /etc/shadowsocks/config.json & ``` `ERROR: Could not bind` `ERROR: bind() error..` 因为这个error需要把 server从VPS ip改为0.0.0.0 ## debug ```bash tail /var/log/shadowsocks.log sudo netstat -tlunap | grep "LISTEN" ``` ## Starting at system boot (optional) ```bash sudo vi /etc/rc.local /usr/bin/python /usr/local/bin/ssserver -c /etc/shadowsocks.json -d start # check sudo shutdown -r now ```