-
准备环境:
- 服务器选择:选择一台可靠的VPS或云服务器,确保其支持开机启动。
- 操作系统:安装Ubuntu或CentOS,推荐使用Linux系统。
-
安装必要软件:
- 更新系统:使用
sudo apt update和sudo apt upgrade确保系统更新到最新版本。 - 安装Python:运行
sudo apt install python3 python3-pip. - 安装依赖:运行
sudo apt install build-essential libevent-dev python3-dev. - 安装pip:运行
sudo apt install pip.
- 更新系统:使用
-
下载Shadowsocks:
- 克隆Shadowsocks仓库:
git clone https://github.com/shadowsocks/shadowsocks.git. - 进入目录:
cd shadowsocks.
- 克隆Shadowsocks仓库:
-
安装依赖:
- 安装Python依赖:
pip install -r requirements.txt.
- 安装Python依赖:
-
配置Shadowsocks:
- 创建配置文件:
vim etc/shadowsocks/config.json. - 填写配置内容:
{ "server": { "listen": "...", "port": 12345, "socks": "SOCKS", "direct": true, "fastopen": true, "auth": "password:shadowsocks" }, "xray": { "module": "xray", "args": "socks5,127...1:12345" } } - 确保
bind或socks根据实际需求调整。
- 创建配置文件:
-
运行Shadowsocks:
- 生成密钥文件:
mmgen -w 256:128. - 启动服务:
sudo ./ss-local -c etc/shadowsocks/config.json --no-upgrade. - 设置开机启动:编辑
etc/rc.local,添加sudo ./ss-local -c etc/shadowsocks/config.json --no-upgrade,保存后重启服务器。
- 生成密钥文件:
-
配置客户端:
- 下载Shadowsocks客户端:https://github.com/shadowsocks/shadowsocks/releases。
- 安装后打开,输入服务器IP、端口、加密方法和密码。
- 连接成功后即可通过代理访问互联网。
-
验证连接:
- 检查服务器端是否运行:通过本地客户端测试连接,确保能通过代理。
- 查看服务器日志:
journalctl -u shadowsocks,确保没有错误。
-
优化和维护:
- 性能监控:使用工具如
htop监控资源使用情况。 - 防火墙设置:确保服务器防火墙开放相关端口,避免连接被拒绝。
- 定期更新:定期检查并更新Shadowsocks版本,确保安全性。
- 性能监控:使用工具如
通过以上步骤,您可以成功配置并使用SS节点绕过网络限制,享受互联网的自由。









