Skip to content

Instantly share code, notes, and snippets.

@zhoukekestar
Last active June 29, 2017 03:59
Show Gist options
  • Save zhoukekestar/3d58eee766f750a3c059366308d6ec08 to your computer and use it in GitHub Desktop.
Save zhoukekestar/3d58eee766f750a3c059366308d6ec08 to your computer and use it in GitHub Desktop.
shadowsocks

login

ssh -i "zhoukekestar.pem" ec2-user@ec2-54-153-60-209.us-west-1.compute.amazonaws.com

Install shadowsocks

sudo -s // 获得超级权限
yum install epel-release
yum update
yum install python-setuptools m2crypto supervisor
easy_install pip
pip install shadowsocks

Edit shadowsocks.json

vi /etc/shadowsocks.json
内容如下:
{
    "server":"0.0.0.0",
    "server_port":8388,
    "local_port":1080,
    "password":"yourpassword",
    "timeout":600,
    "method":"aes-256-cfb"
}
server_port为shadowsocks连接的端口号
password为连接shadowsocks连接密码
配置多个接口格式如下:
{
    "server":"0.0.0.0",
    "port_password":
    {
        "8383":"password1",
        "8384":"password2",
        "8385":"password3"
    },
    "password":"yourpassword",
    "timeout":600,
    "method":"aes-256-cfb"
}

启动ss:

/usr/bin/python /usr/bin/ssserver -c /etc/shadowsocks.json -d start

// 显示防火墙
sudo iptables -L
// 清楚防火墙
 sudo iptables -F
// 添加规则
iptables -A INPUT -p tcp --dport 8388 -j ACCEPT
// 显示监听端口
netstat -tunpl

Refs

https://github.com/shadowsocks/shadowsocks/issues/133

@zhoukekestar
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment