CentOS系統搭建shadowsocksProxy 伺服器

來源:互聯網
上載者:User

最近城牆貌似堵的厲害,各大跳牆的方式都奇慢無比。沒辦法,就自己動手搭建shadowsocksProxy 伺服器(以CentOS為例)。

安裝相關的依賴(依次輸入以下命令)

yum install m2crypto python-setuptools
easy_install pip
pip install shadowsocks

建立設定檔
vi /etc/shadowsocks.json

在檔案中寫入:

{
    "server":"0.0.0.0",
    "server_port":8888,
    "local_address": "127.0.0.1",
    "local_port":1080,
    "password":"123456",
    "timeout":600,
    "method":"aes-128-cfb"
}

解釋說明:

server: 伺服器的ip地址,這裡直接寫0.0.0.0也是可以的(推薦)
server_port: 伺服器代理的連接埠
local_address: 本地端監聽的地址(一般填寫127.0.0.1)
local_port:本地代理連接埠(Switchy等外掛程式需要的串連的連接埠)
password:串連密碼
timeout:逾時
method:加密方式,推薦aes-128-cfb
後台啟動服務


nohup /usr/bin/ssserver -c /etc/shadowsocks.json > /dev/null 2>&1 &
有時,伺服器可能需要重啟,所以有必要把它加入到開機啟動項中:


echo "nohup /usr/bin/ssserver -c /etc/shadowsocks.json > /dev/null 2>&1 &" >> /etc/rc.local
My Gad! 為什麼沒效

在CentOS上可能由於防火牆的原因,會導致無法訪問到對應的連接埠(仍然以8888連接埠為例),則執行如下命令:


iptables -P INPUT ACCEPT
iptables -F
iptables -A INPUT -p tcp --dport 8888 -j ACCEPT
後話

以上都是伺服器端配置,本地還需要一個shadowscoks的用戶端,並配置ip地址,密碼,及本地連接埠即可。客戶下載地址:http://shadowsocks.org/en/download/clients.html

接著配置本地代理,一種方式是直接用IE中的啟用代理服務,配置如下圖,其中連接埠請以實際情況為準

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.