CentOS 7系統(tǒng)部署SSR服務(wù)指南
環(huán)境準備
執(zhí)行系統(tǒng)更新并安裝必要組件:
yum update -y
yum install epel-release -y
yum install python-setuptools git -y
服務(wù)端安裝
獲取項目源碼
git clone https://github.com/shadowsocksrr/shadowsocksr.git
cd shadowsocksr
配置文件生成
cp apiconfig.py userapiconfig.py
cp config.json user-config.json
參數(shù)修改說明
- server_port:指定服務(wù)監(jiān)聽端口(建議1024以上)
- password:設(shè)置高強度連接密碼
- method:選擇加密方式(推薦aes-256-cfb)
- protocol/auth_chain:配置協(xié)議插件增強安全性
服務(wù)啟動與管理
./shadowsocks/server.py -d start
systemctl enable firewalld
firewall-cmd --permanent --add-port=端口號/tcp
firewall-cmd --reload
運行狀態(tài)監(jiān)測
tail -f /var/log/shadowsocksr.log
netstat -tunlp | grep 端口號
安全強化建議
- 定期更新SSR至最新版本
- 啟用fail2ban防御暴力破解
- 配置iptables白名單訪問
- 使用非root賬戶運行服務(wù)
性能優(yōu)化方案
echo "net.core.rmem_max=16777216" >> /etc/sysctl.conf
echo "net.core.wmem_max=16777216" >> /etc/sysctl.conf
sysctl -p