一分钟在Centos上搭建SS服务器

一键安装 shadowsocks-go 版

wget –no-check-certificate https://tangyuecan.com/shadowsocks-go.sh  
chmod +x shadowsocks-go.sh  
./shadowsocks-go.sh 2>&1 | tee shadowsocks-go.log  

接下来开始配置影梭Shadowsock相关的密码、端口号、加密方式

#############################################################
# One click Install Shadowsocks-Python server               #
# Intro: https://tangyuecan.com                             #
# Author: tangyuecan                                        #
# Github: https://github.com/shadowsocks/shadowsocks-go     #
#############################################################

Please input password for shadowsocks-go
(Default password: teddysun.com):8888


在上访提示中输入你的密码 8888

Please input port for shadowsocks-go [1-65535]
(Default port: 8989):9000

在上方提示中输入你的端口号,注意端口号最好想个比较特殊的,防止被别人盗用

Please select stream cipher for shadowsocks-python:
1) aes-256-gcm
2) aes-192-gcm
3) aes-128-gcm
4) aes-256-ctr
5) aes-192-ctr
6) aes-128-ctr
7) aes-256-cfb
8) aes-192-cfb
9) aes-128-cfb
10) camellia-128-cfb
11) camellia-192-cfb
12) camellia-256-cfb
13) chacha20-ietf-poly1305
14) chacha20-ietf
15) chacha20
16) rc4-md5
Which cipher you'd select(Default: aes-256-gcm):


在上方选择你的加密方式,通常用默认的,如果用默认可以直接回车

配置完成后,系统会根据设置自动完成安装,记得要去iptables中开启相关端口的使用权限

然后在本地下载并安装(影梭)Shadowsock的win版本,在手机上也有对应的Android和IOS版本,可自行下载安装, 配置时候只要输入IP、端口号、密码即可

客户端

Windows   
https://github.com/shadowsocks/shadowsocks-windows/releases   

Mac OS X   
https://github.com/shadowsocks/ShadowsocksX-NG/releases  

linux   
https://github.com/shadowsocks/shadowsocks-qt5/wiki/Installation   
https://github.com/shadowsocks/shadowsocks-qt5/releases 

iOS   
https://itunes.apple.com/app/apple-store/id1070901416?pt=2305194&ct=shadowsocks.org&mt=8   
https://github.com/shadowsocks/shadowsocks-iOS/releases  

https://play.google.com/store/apps/details?id=com.github.shadowsocks   
https://github.com/shadowsocks/shadowsocks-android/releases

常用命令

# start | stop | restart | status
# 重启
/etc/init.d/shadowsocks restart 

卸载

./shadowsocks.sh uninstall

多用户配置清单

# /etc/shadowsocks/config.json
{
    "server":"0.0.0.0",
	"local_port":1080,
	"port_password": {
		"8888": "123456",
		"8001": "123456",
		"8002": "123456",
		"8003": "123456"
	},
    "method":"aes-256-cfb",
    "timeout":300,
	"fast_open": false
}


Centos 7.4 配置防火墙端口

# 开启端口号8888
$ firewall-cmd --permanent --zone=public --add-port=8888/tcp
$ firewall-cmd --reload

添加systemctl服务

vi shadowsocks.service 
[Unit]
Description=shadowsocks
After=network.target

[Service]
Type=forking
ExecStart=/etc/init.d/shadowsocks start
ExecReload=/etc/init.d/shadowsocks restart
ExecStop=/etc/init.d/shadowsocks stop
PrivateTmp=true

[Install]
WantedBy=multi-user.target

常用命令

#重载系统服务:
systemctl daemon-reload
#设置开机启动:
systemctl enable shadowsocks.service
#启动服务:
systemctl start shadowsocks.service
#停止服务:
systemctl stop shadowsocks.service
#重启服务:
systemctl reload shadowsocks.service

留下回复