Last active
April 21, 2019 21:18
-
-
Save imyelo/2f7102907c763fc6213a5ed040b82170 to your computer and use it in GitHub Desktop.
setup shadowsocks server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
## # Howto | |
## 1. write /etc/shadowsocks.json | |
## 2. exec the setup.sh | |
## | |
## ```sh | |
## curl https://gist.githubusercontent.com/imyelo/2f7102907c763fc6213a5ed040b82170/raw/setup.sh | sh | |
## ``` | |
## | |
apt install -y python-pip python-setuptools | |
pip install --upgrade pip | |
pip install shadowsocks | |
## get shadowsocks.sh | |
curl https://gist.githubusercontent.com/imyelo/2f7102907c763fc6213a5ed040b82170/raw/shadowsocks.sh > /etc/init.d/shadowsocks | |
chmod +x /etc/init.d/shadowsocks | |
update-rc.d shadowsocks defaults |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
### BEGIN INIT INFO | |
# Provides: shadowsocks | |
# Required-Start: $remote_fs $syslog | |
# Required-Stop: $remote_fs $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: start shadowsocks | |
# Description: start shadowsocks | |
### END INIT INFO | |
## fork from http://blog.xavierskip.com/2015-02-02-shadowsocks-init/ | |
start(){ | |
ssserver -c /etc/shadowsocks.json -d start | |
} | |
stop(){ | |
ssserver -c /etc/shadowsocks.json -d stop | |
} | |
case "$1" in | |
start) | |
start | |
;; | |
stop) | |
stop | |
;; | |
reload) | |
stop | |
start | |
;; | |
*) | |
echo "Usage: $0 {start|reload|stop}" | |
exit 1 | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Troubleshooting
cannot import name main
Trouble: Get error while
pip install shadowsocks
:Fix up:
Modify
/usr/bin/pip
:That's it! Try again then.
See https://stackoverflow.com/a/49900741 for details.
undefined symbol: EVP_CIPHER_CTX_cleanup
Trouble: Get error while
ssserver -c /etc/shadowsocks.json -d start
Fix up:
vi /usr/local/lib/python2.7/dist-packages/shadowsocks/crypto/openssl.py
:%s/cleanup/reset/g -> enter
(replacingEVP_CIPHER_CTX_cleanup
toEVP_CIPHER_CTX_reset
):wq
-> enter. (save file)See https://blog.csdn.net/blackfrog_unique/article/details/60320737 for details.