#介紹
https://zh.wikipedia.org/wiki/Shadowsocks
#git位置 shadowsock python
https://github.com/dgkang/shadowsocks-python
1.先安裝 python2 or python3皆可
2.安裝 python套件包 pip (ubuntu:apt-get install python-pip)
wget https://bootstrap.pypa.io/get-pip.py
python get-pip.py
https://bootstrap.pypa.io/
3.pip 安裝 shadowsocks
pip install shadowsocks
4.
vi /etc/shadowsocks.json
{
"local_address": "127.0.0.1",
"local_port":1080,
"port_password":{
"6655":"nguguest",
"8080":"nguguest"
},
"timeout":600,
"method":"aes-256-cfb",
"fast_open":false
}
其中
"port_password":{
"6655":"nguguest",
"8080":"nguguest"
},
是設定server port 對應的 password
這邊沒有設定serverIP 因為不需要
5.
*ssserver -c /etc/shadowsocks.json遇到error
RuntimeError: can not find library crypto
自行修改/usr/lib/python2.7/ctypes/util.py
拿個發行版的來取代
*遇到Exception: libcrypto(OpenSSL) not found
參考https://ningselect.com/2018/05/01/synologyshadowsocks
修改 註解掉以下紅色四行
sudo vi /usr/lib/python2.7/site-packages/shadowsocks/crypto/util.py
56 for name in lib_names:
57 if os.name == "nt":
58 paths.extend(find_library_nt(name))
59 # else:
60 # path = ctypes.util.find_library(name)
61 # if path:
62 # paths.append(path)
*
2020 update
最近重裝遇到另一個新error
TypeError: find_library() takes exactly 1 argument (3 given)
sudo -i 後進入root即可
ssserver -c /etc/shadowsocks.json -d start
(我直接sudo 不能,應該是lib path 的問題,沒有繼續trace)
最近重裝遇到另一個新error
TypeError: find_library() takes exactly 1 argument (3 given)
File "/usr/lib/python2.7/site-packages/shadowsocks/crypto/openssl.py", line 41, in load_openssl
raise Exception('libcrypto(OpenSSL) not found')
Exception: libcrypto(OpenSSL) not found
sudo -i 後進入root即可
ssserver -c /etc/shadowsocks.json -d start
(我直接sudo 不能,應該是lib path 的問題,沒有繼續trace)
6.連線試試 後臺啟動
ssserver -c /etc/shadowsocks.json -d start
ssserver -c /etc/shadowsocks.json -d stop
ssserver -c /etc/shadowsocks.json -d restart
ssserver -c /etc/shadowsocks.json -d restart
沒有留言:
張貼留言
有敘述錯誤或者是觀念有問題歡迎指正