Configure EC2 for Shadowsocks

References:

[1] 基于 EC2 + Shadowsocks 的翻墙解决方案 (Mostly referred to this one)

[2] AMAZON EC2 + SHADOWSOCKS 翻墙达成

Step 1 Apply for AWS EC2 (free trial version available for 12 months)

Only I didn’t see the step to choose server location and haven’t found a way to change it.

Step 2 SSH to EC2 and run Shadowsocks server

On instances page, right click on the instance, a popup will show up with ready-to-use script

Screen Shot 2016-02-21 at 22.17.28

pip seemed ready so I only need to run

sudo pip install shadowsocks

Two alternatives for running server.

Put password in script

# 监听8088端口 密码为password 加密方式为 aes-256-cfb
# 可以追加 -d start 使server 作为守护进程执行
ssserver -p 8088  -k password -m aes-256-cfb

Use a config file

{
"server":"0.0.0.0", # EC2实例的IP,注意这里我们不能填写公有IP, 需要填写私有IP或者0.0.0.0
"server_port":8088, # server端监听的端口,需要在EC2实例中开放此端口
"local_address": "127.0.0.1",
"local_port":1080,
"password":"mypassword", # 密码
"timeout":300,
"method":"aes-256-cfb", #加密方式
"fast_open": false #是否开启fast open
}
Run/stop with
# ssserver -c /etc/shadowsocks.json -d start 
# ssserver -c /etc/shadowsocks.json -d stop

Server config is done


Step 3 Download and configure client

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s