1
1
# Linux 下 Shadowsocks 設置方法
2
2
3
- ## 1、GUI 客戶端
3
+ ## 1、GUI 客戶端 ( 尚不支持 chacha20-ietf-poly1305 加密方式,請使用命令行客戶端 )
4
4
5
5
這裏我們推薦使用 [ shadowsocks-qt5] ( https://github.com/shadowsocks/shadowsocks-qt5 )
6
6
10
10
11
11
12
12
## 2、命令行客戶端
13
+ 使用最新的 Python 版本或是 Shadowsocks-libev
13
14
14
- 下面我們以 [ Python 版] ( https://pypi.python.org/pypi/shadowsocks ) 的 Shadowsocks 為例
15
-
16
- ### 1、更新系統
17
-
18
- Debian / Ubuntu
19
-
20
- ```
21
- sudo apt-get update
22
- ```
23
-
24
- CentOS / RHEL / Fedroa
25
-
26
- ```
27
- sudo yum update
28
- ```
29
-
30
- ### 2、根據自己的發行版安裝 PIP
15
+ ### 1. 安裝:
16
+ Python : https://github.com/shadowsocks/shadowsocks/tree/master#install
17
+ Shadowsocks-libev: https://github.com/shadowsocks/shadowsocks-libev#installation
31
18
32
- Debian
33
-
34
- ```
35
- sudo apt-get install python-dev build-essential python-pip
36
- ```
37
-
38
- Ubuntu
39
-
40
- ```
41
- sudo apt-get install python-pip
42
- ```
43
-
44
- CentOS / RHEL / Fedora
45
-
46
- ```
47
- sudo yum install python-pip
48
- ```
49
-
50
- Archlinux
51
-
52
- ```
53
- sudo pacman -S python-pip
54
- ```
55
-
56
- ### 3、升級 PIP
57
- ` pip install --upgrade pip `
58
-
59
- ### 4、用 pip 安裝 Shadowsocks 和相關依賴
19
+ 下面我們以 [ Python 版] ( https://pypi.python.org/pypi/shadowsocks ) 的 Shadowsocks 為例
60
20
61
- ```
62
- pip install shadowsocks
63
- ```
64
21
65
- ### 5 . 設置 Shadowsocks 配置文件
22
+ ### 2 . 設置 Shadowsocks 配置文件
66
23
67
24
創建一個 ` /etc/shadowsocks.json ` 文件,格式如下
68
25
69
26
```
70
27
{
71
- "server":"服務器IP或域名",
72
- "server_port":端口號,
73
- "local_address": "127.0.0.1",
74
- "local_port":1080,
75
- "password":"密碼",
76
- "timeout":300,
77
- "method":"aes-256-cfb",
78
- "fast_open": false
28
+ "server":"服務器IP或域名",
29
+ "server_port":端口號,
30
+ "local_address": "127.0.0.1",
31
+ "local_port":1080,
32
+ "password":"密碼",
33
+ "timeout":300,
34
+ "method":"aes-256-cfb",
35
+ "fast_open": false
79
36
}
80
37
```
81
38
82
- ### 6、啓動 Shadowsocks
39
+ ### 3、啓動 Shadowsocks
40
+ Python 版客戶端命令是 sslocal , Shadowsocks-libev 客戶端命令為 ss-local
83
41
84
42
```
85
43
/usr/local/bin/sslocal -c /etc/shadowsocks.json -d start
86
44
```
87
45
88
46
89
- ### 7 、安裝 proxychains
47
+ ### 4 、安裝 proxychains
90
48
91
49
這裏以 Debian / Ubuntu 爲例
92
50
@@ -111,13 +69,13 @@ sudo proxychains wget xxxx
111
69
112
70
類似的命令使用 Shadowsocks 進行操作程序
113
71
114
- ### 8 、 在應用程序內代理
72
+ ### 5 、 在應用程序內代理
115
73
116
- 您衹需要將程式指定為** socks v5** 的代理
74
+ 您衹需要將程式指定為 ** socks v5** 的代理
117
75
118
76
服務器 127.0.0.1 端口 1080(應與 Shadowsocks 客戶端的本地端口對應,默認為1080)
119
77
120
- ### 9 、 關閉 Shadowsocks
78
+ ### 6 、 關閉 Shadowsocks
121
79
122
80
在終端輸入
123
81
@@ -127,27 +85,6 @@ lsof –i:1080
127
85
128
86
kill 相應 pid 即可
129
87
130
- ### 10、OpenSSL 1.1.0 錯誤
131
-
132
- 如果您在最新的 Debian 9.x 下遇到如下錯誤提示
133
-
134
- ```
135
- AttributeError: /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1: undefined symbol: EVP_CIPHER_CTX_cleanup
136
- ```
137
-
138
- 是因為 OpenSSL 1.1.x 版本中,廢棄了 ` EVP_CIPHER_CTX_cleanup ` 函數,我們可以用 ` EVP_CIPHER_CTX_reset ` 來代替此函數
139
-
140
- 修改文件 ` /usr/lib/python2.7/site-packages/shadowsocks/crypto/openssl.py `
141
-
142
- 將第 52 行 ` libcrypto.EVP_CIPHER_CTX_cleanup.argtypes = (c_void_p,) ` 改為 ` libcrypto.EVP_CIPHER_CTX_reset.argtypes = (c_void_p,) `
143
-
144
- 將第 111 行 ` libcrypto.EVP_CIPHER_CTX_cleanup(self._ctx) ` 改爲 ` libcrypto.EVP_CIPHER_CTX_reset(self._ctx) `
145
-
146
- 然後重新啓動 Shadowsocks 即可
147
-
148
- [ 參考] ( https://blog.lyz810.com/article/2016/09/shadowsocks-with-openssl-greater-than-110/ )
149
-
150
-
151
88
## 3、瀏覽器使用方法
152
89
153
90
1 . [ Firefox 瀏覽器設置教程] ( https://github.com/Shadowsocks-Wiki/shadowsocks/blob/master/7-1-firefox-settings.md )
0 commit comments