(1). 下载

# 安装依赖
[root@lixin ~]# yum -y install gcc gcc-c++ automake make pam-devel openldap-devel cyrus-sasl-devel openssl-devel libssl-dev

# 下载
[root@lixin ~]# wget https://nchc.dl.sourceforge.net/project/ss5/ss5/3.8.9-8/ss5-3.8.9-8.tar.gz

# 解压
[root@lixin ~]# tar -zxvf ss5-3.8.9-8.tar.gz

[root@lixin ~]# cd ss5-3.8.9

(2). 安装

# 检查依赖本置
[root@lixin ss5-3.8.9]# ./configure 

# 编译
[root@lixin ss5-3.8.9]# make && make install

# 配置可执行权限
[root@lixin ss5-3.8.9]# chmod +x /etc/init.d/ss5 

# 加入服务列表
[root@lixin ss5-3.8.9]# chkconfig --add ss5
# 开机自动启动
[root@lixin ss5-3.8.9]# chkconfig --level 345 ss5 on

(3). ss5配置


# 配置ss5支持(用户名和密码)
[root@lixin ss5-3.8.9]# vi /etc/opt/ss5/ss5.conf 
  auth    0.0.0.0/0               -               u
  permit u        0.0.0.0/0       -       0.0.0.0/0       -       -       -       -       -


# 配置账号和密码(账号和密码之间空格隔开)
[root@lixin ss5-3.8.9]# vi /etc/opt/ss5/ss5.passwd 
  admin admin123456


# SS5默认是:1080,可配置端口:
[root@lixin ss5-3.8.9]# vi /etc/sysconfig/ss5 
  # Add startup option here
  # 放开注释,并配置监听端口.
  SS5_OPTS=" -u root -b 0.0.0.0:8888"

(4). 启动服务

[root@lixin ss5-3.8.9]# service ss5 start

(5). CURL测试

# 通过CURL尝试远程访问
lixin-macbook:~ lixin$ curl -U admin:admin123456 --socks5 47.245.26.106:8888 -v  https://www.lixin.help
*   Trying 47.245.26.106...
* TCP_NODELAY set
* SOCKS5 communication to www.lixin.help:443
* SOCKS5 connect to IPv4 185.199.110.153 (locally resolved)
* SOCKS5 request granted.
* Connected to 47.245.26.106 (47.245.26.106) port 8888 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=www.lixin.help
*  start date: Dec 24 16:50:54 2020 GMT
*  expire date: Mar 24 16:50:54 2021 GMT
*  subjectAltName: host "www.lixin.help" matched cert's "www.lixin.help"
*  issuer: C=US; O=Let's Encrypt; CN=R3
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7f8692809400)
> GET / HTTP/2
> Host: www.lixin.help
> User-Agent: curl/7.64.1
> Accept: */*
> 
* Connection state changed (MAX_CONCURRENT_STREAMS == 100)!
< HTTP/2 200 
< server: GitHub.com
< content-type: text/html; charset=utf-8
< last-modified: Sun, 27 Dec 2020 00:00:53 GMT
< access-control-allow-origin: *
< etag: "5fe7ceb5-3cc4"
< expires: Sun, 27 Dec 2020 07:39:21 GMT
< cache-control: max-age=600
< x-proxy-cache: MISS
< x-github-request-id: AF3C:46D2:100A285:13A2392:5FE837D1
< accept-ranges: bytes
< date: Sun, 27 Dec 2020 07:41:16 GMT
< via: 1.1 varnish
< age: 39
< x-served-by: cache-tyo19941-TYO
< x-cache: HIT
< x-cache-hits: 1
< x-timer: S1609054877.785398,VS0,VE1
< vary: Accept-Encoding
< x-fastly-request-id: b317cf6719b159afc54ad92174fc2b8095866444
< content-length: 15556
< 
<!DOCTYPE html>

(6). ss5日志

# 查看ss5日志
[root@lixin ~]# tail -500f /var/log/ss5/ss5.log