CentOS7 安装配置 SS
安装依赖
安装 Git
检查是否已安装 Git:
git --version如未安装,则安装:
yum -y install gitTips:
已安装,则更新:
yum update git
检查 Git 版本信息:
git --versiongit version 1.7.1
安装 python 工具包和 pip
yum -y install python-setuptools && easy_install pip安装 SS
使用 pip 从 github 安装最新版 SS:
pip install git+https://github.com/shadowsocks/shadowsocks.git@master检查安装的 SS 版本:
ssserver --versionShadowsocks 3.0.0
配置 SS
配置文件
创建配置文件:
vim /etc/shadowsocks.json插入配置:
{
"server": "0.0.0.0",
"server_port": 10199,
"local_address": "127.0.0.1",
"local_port": 1080,
"password": "pwd",
"timeout": 600,
"method": "rc4-md5"
}Tips:
server_port为 SS 端口号。
password为 SS 密码。
method为加密方式,推荐rc4-md5速度快,如需高密度则推荐aes-256-cfb。
启动 SS
后台启动 SS 服务:
ssserver -c /etc/shadowsocks.json -d start设置 SS 开机启动:
echo "ssserver -c /etc/shadowsocks.json -d start" >> /etc/rc.localFirewallD 配置
创建新的 FirewallD 服务配置文件:
vim /etc/firewalld/services/ss.xml插入配置:
<service>
<short>SS</short>
<description>SS</description>
<port protocol="tcp" port="10199"/>
</service>Tips:
port和上面 SS 配置文件中的server_port保持一致。
保存退出,在默认区域添加 SS 服务:
firewall-cmd --permanent --add-service=ss重载 FirewallD 规则:
firewall-cmd --reload管理 SS
启动运行 SS 服务:
ssserver -c /etc/shadowsocks.json -d start停止 SS 服务:
ssserver -c /etc/shadowsocks.json -d stop重启 SS 服务:
ssserver -c /etc/shadowsocks.json -d restart查看日志:
less /var/log/shadowsocks.log查看 SS 进程:
ps aux | grep ssserver | grep -v "grep"客户端
参考文献
Last updated
Was this helpful?