在LINODE主机上安装使用SHADOWSOCKS

想成为一个合格的程序员/媛,科学上网是必备技能。pptp等VPN被干扰得越来越厉害,用shadowsocks则是不错的选择。

必备

一台位于国外的linux主机,这里以安装了centos系统的linode为例(日本节点的linode延迟真的不错,带宽流量绰绰有余,点此查看套餐或购买) 一台自己的个人电脑,安装必要的shadowsocks本地客户端

shadowsocks服务端安装

以root用户通过putty或者mac的终端登录服务器,运行如下命令一键安装shadowsocks服务端

wget –no-check-certificate https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks.sh chmod +x shadowsocks.sh ./shadowsocks.sh 2>&1 | tee shadowsocks.log  

安装完成后,脚本提示如下:

Congratulations, shadowsocks install completed!  
Your Server IP:your_server_ip  
Your Server Port:8989  
Your Password:your_password  
Your Local IP:127.0.0.1  
Your Local Port:1080  
Your Encryption Method:aes-256-cfb  
Welcome to visit:http://teddysun.com/342.html  
Enjoy it!  

卸载方法

./shadowsocks.sh uninstall

配置文件路径:/etc/shadowsocks.json 单用户配置样例:

{
    "server":"your_server_ip",
    "server_port":8989,
    "local_address":"127.0.0.1",
    "local_port":1080,
    "password":"yourpassword",
    "timeout":300,
    "method":"aes-256-cfb",
    "fast_open": false
}

多用户配置样例:

{
    "server":"your_server_ip",
    "local_address":"127.0.0.1",
    "local_port":1080,
    "port_password":{
         "8989":"password0",
         "9001":"password1",
         "9002":"password2",
         "9003":"password3",
         "9004":"password4"
    },
    "timeout":300,
    "method":"aes-256-cfb",
    "fast_open": false
}

shadowsocks服务如果无法联网,可以调整配置文件中的ip为0.0.0.0
shadowsocks服务启动/重启/停止命令:

启动:/etc/init.d/shadowsocks start
停止:/etc/init.d/shadowsocks stop
重启:/etc/init.d/shadowsocks restart
状态:/etc/init.d/shadowsocks status

shadowsocks客户端安装

Mac用户可以直接下载shdowsocksX客户端,填写自己的服务器ip,连接端口以及对应密码即可使用。

如果无法连接,可以切换至全局模式尝试 Windows用户可以使用Shadowsocks-win-2.1.1客户端连接shadowsocks服务