📒
notebook
  • Notebook
  • DevOps
    • Git
      • 常见 Git 操作
      • 使用 SSH 连接 Git 远程仓库
      • 使用 GPG Keys 签名 Git 提交
      • Git on macOS
    • Docker
      • macOS 安装配置 Docker
      • CentOS7 安装配置 Docker CE
  • Linux
    • CentOS
      • CentOS7 安装配置 vsftpd
      • CentOS7 设置虚拟内存
      • CentOS7 使用 acme.sh 自动申请免费 SSL 证书
      • CentOS7 修改 SSH 端口号
      • CentOS7 主机初始设置
      • 阿里云 CentOS 主机常见设置
      • CentOS7 安装配置 SS
    • nginx
      • nginx 配置 301 永久重定向
      • nginx 使用 SSL证书配置 HTTPS
      • CentOS7 安装配置 nginx
      • nginx 配置 gzip 压缩
      • nginx 代理静态网页
  • Server
    • Ghost
      • macOS 安装配置 Ghost
      • CentOS7 安装配置 Ghost
    • npm & Yarn
      • Yarn 常用命令
      • CentOS7 安装卸载升级 Yarn
      • npm & Yarn 常见错误处理
      • macOS 安装卸载升级 Yarn
    • Node.js
      • Awesome Node.js
      • CentOS7 安装卸载升级 Node.js
      • macOS 安装卸载升级 Node.js
  • Web
    • Ionic
      • 创建 Ionic & Angular 项目
      • 使用 Ionic & Cordova 构建 Android 应用
      • macOS 搭建 Ionic & Cordova 开发环境
    • CSS
      • CSS 排版技巧
      • Awesome CSS
      • CSS 三栏自适应布局
    • Angular
      • Awesome Angular
      • 创建 Angular 项目
    • HTML
      • HTML head 常用标签
      • HTML 常用 DTD 声明
      • 常用网页语义结构
    • Web 技术标准
    • JavaScript
      • Awesome JavaScript
      • JavaScript 的 eval() 函数详解
  • Mobile
    • H5
      • iOS Safari Web App 配置
  • Development Environment
    • Development Utilities
      • Awesome Windows
      • macOS 安装配置 Homebrew
      • Awesome macOS
      • macOS 安装配置 iTerm2
    • FEED
      • 常用 Gulp 插件
  • Network
    • 常见公共 DNS
  • Technology Stacks for Web Front-End Development
Powered by GitBook
On this page
  • 安装依赖
  • 安装 Git
  • 安装 python 工具包和 pip
  • 安装 SS
  • 配置 SS
  • 配置文件
  • 启动 SS
  • FirewallD 配置
  • 管理 SS
  • 客户端
  • 参考文献

Was this helpful?

  1. Linux
  2. CentOS

CentOS7 安装配置 SS

安装依赖

安装 Git

检查是否已安装 Git:

git --version

如未安装,则安装:

yum -y install git

Tips:

已安装,则更新:

yum update git

检查 Git 版本信息:

git --version

git 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 --version

Shadowsocks 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.local

FirewallD 配置

创建新的 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"

客户端

参考文献

Previous阿里云 CentOS 主机常见设置Nextnginx

Last updated 4 years ago

Was this helpful?

SS for Android
SS for MacOS
SS for Windows
SS GitHub