>&n..."/>
溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

shadowsocks 安裝及使用

發(fā)布時間:2020-07-08 20:22:17 來源:網(wǎng)絡 閱讀:5719 作者:lvnian2009 欄目:系統(tǒng)運維



安裝 shadowsocks
1. 安裝shadowsocks

    pip install shadowsocks

2. 編寫shadowsocks配置文件測試,配置文件如下:

cat >> /etc/shadowsocks.json <<EOF
{
    "server":"0.0.0.0",
    "server_port":1075,
    "local_port":1080,
    "password":"25d55ad283aa400af464c76d713c07ab",
    "timeout":10,
    "method":"aes-256-cfb"
}
EOF

3.測試配置文件是否可用

    ssserver -c /etc/shadowsocks.json

    
4.如果啟動成功,出現(xiàn)1075端口即可


5. 使用supervisor管理shadowsocks進程。安裝 supervisor

    pip install supervisor

    
6. 啟動 supervisor
  

 mkdir -p /etc/supervisor/conf.d/
cat >>/etc/supervisor/supervisor.conf<<EOF
; supervisor config file
[unix_http_server]
file=/var/run/supervisor.sock   ; (the path to the socket file)
chmod=0700                       ; sockef file mode (default 0700)
[supervisord]
logfile=/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log)
pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid)
childlogdir=/var/log/supervisor            ; ('AUTO' child log dir, default $TEMP)
; the below section must remain in the config file for RPC
; (supervisorctl/web interface) to work, additional interfaces may be
; added by defining them in separate rpcinterface: sections
[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl]
serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL  for a unix socket
; The [include] section can just contain the "files" setting.  This
; setting can list multiple files (separated by whitespace or
; newlines).  It can also contain wildcards.  The filenames are
; interpreted as relative to this file.  Included files *cannot*
; include files themselves.
[include]
files = /etc/supervisor/conf.d/*.conf
EOF

    
    啟動supervisor

    supervisord

    
    
7.     添加supervisor 的shadowsocks配置文件

cat >>/etc/supervisor/conf.d/shadowsocks.conf  <<EOF
[program:shadowsocks]
command=ssserver -c /etc/shadowsocks.json  
autorestart=true  
redirect_stderr=true
stdout_logfile=/tmp/shadowsocks.log
stdout_logfile_maxbytes=300MB
stdout_logfile_backups=10
stdout_capture_maxbytes=500MB
EOF

8.重新加載supervisor

    supervisorctl update

    
9.檢查supervisor是否啟動了shadowsocks

ubuntu@ip-172-131-12-251:~$ sudo supervisorctl status
shadowsocks                      RUNNING   pid 18785, uptime 0:13:10
ubuntu@ip-172-131-12-251:~$
出現(xiàn)RUNNING 即成功


windows客戶端下載地址:https://github.com/shadowsocks/shadowsocks-windows/releases/download/4.0.4/Shadowsocks-4.0.4.zip

mac客戶端下載地址:https://github.com/shadowsocks/shadowsocks-iOS/releases



向AI問一下細節(jié)

免責聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI