wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
yum install python-pip
pip install --upgrade pip
pip install shadowsocks
mkdir /etc/shadowsocks
vi /etc/shadowsocks/shadowsocks.json
添加以下内容
[root@VM_0_13_centos .hulk-master]# cat /etc/shadowsocks/shadowsocks.json
{
"server": "c20s1.jamjams.net",
"server_port": 19381,
"password": "*****",
"method": "aes-256-gcm",
"plugin": "",
"plugin_opts": "",
"plugin_args": "",
"remarks": "",
"timeout": 5
}
备注:
server填写你代理服务器的IP
server_port代理服务器设置的端口
password代理服务器密码
这几个参数很好理解,前提是你了解过并且有ss代理
配置自启动
vi /etc/systemd/system/shadowsocks.service
添加以下内容
[root@VM_0_13_centos .hulk-master]# cat /etc/systemd/system/shadowsocks.service
[Unit]
Description=Shadowsocks
[Service]
TimeoutStartSec=0
ExecStart=/usr/bin/sslocal -c /etc/shadowsocks/shadowsocks.json
[Install]
WantedBy=multi-user.target
5、启动shadowsocks客户端
systemctl enable shadowsocks.service
systemctl start shadowsocks.service
systemctl status shadowsocks
报错 不支持加密方式aes-256-gcm
[root@VM_0_13_centos system]# systemctl status shadowsocks
● shadowsocks.service - Shadowsocks
Loaded: loaded (/etc/systemd/system/shadowsocks.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Mon 2020-03-16 13:05:25 CST; 10s ago
Main PID: 51250 (code=exited, status=1/FAILURE)
Mar 16 13:05:25 VM_0_13_centos systemd[1]: Started Shadowsocks.
Mar 16 13:05:25 VM_0_13_centos systemd[1]: Starting Shadowsocks...
Mar 16 13:05:25 VM_0_13_centos sslocal[51250]: INFO: loading config from /etc/shadowsocks/shadowsocks.json
Mar 16 13:05:25 VM_0_13_centos sslocal[51250]: 2020-03-16 13:05:25 WARNING warning: your timeout 5 seems too short
Mar 16 13:05:25 VM_0_13_centos sslocal[51250]: 2020-03-16 13:05:25 ERROR method aes-256-gcm not supported
Mar 16 13:05:25 VM_0_13_centos systemd[1]: shadowsocks.service: main process exited, code=exited, status=1/FAILURE
Mar 16 13:05:25 VM_0_13_centos systemd[1]: Unit shadowsocks.service entered failed state.
Mar 16 13:05:25 VM_0_13_centos systemd[1]: shadowsocks.service failed.
解决方法
pip install https://github.com/shadowsocks/shadowsocks/archive/master.zip -U
[root@VM_0_13_centos .hulk-master]# systemctl start shadowsocks
[root@VM_0_13_centos .hulk-master]# systemctl status shadowsocks
● shadowsocks.service - Shadowsocks
Loaded: loaded (/etc/systemd/system/shadowsocks.service; enabled; vendor preset: disabled)
Active: active (running) since Mon 2020-03-16 13:18:31 CST; 4s ago
Main PID: 53148 (sslocal)
CGroup: /system.slice/shadowsocks.service
└─53148 /usr/bin/python2 /usr/bin/sslocal -c /etc/shadowsocks/shadowsocks.json
Mar 16 13:18:31 VM_0_13_centos systemd[1]: Started Shadowsocks.
Mar 16 13:18:31 VM_0_13_centos systemd[1]: Starting Shadowsocks...
Mar 16 13:18:31 VM_0_13_centos sslocal[53148]: INFO: loading config from /etc/shadowsocks/shadowsocks.json
Mar 16 13:18:31 VM_0_13_centos sslocal[53148]: 2020-03-16 13:18:31 WARNING warning: your timeout 5 seems too short
Mar 16 13:18:31 VM_0_13_centos sslocal[53148]: 2020-03-16 13:18:31 INFO loading libcrypto from libcrypto.so.10
Mar 16 13:18:31 VM_0_13_centos sslocal[53148]: 2020-03-16 13:18:31 INFO starting local at 127.0.0.1:1080
安装Proxychains 实现命令行代理
https://www.234du.com/1188.html
最后测试如下
[root@VM_0_13_centos .hulk-master]# proxychains4 curl -I www.google.com
[proxychains] config file found: /etc/proxychains.conf
[proxychains] preloading /usr/lib/libproxychains4.so
[proxychains] DLL init: proxychains-ng 4.14-git-8-gb8fa2a7
[proxychains] Strict chain ... 127.0.0.1:1080 ... www.google.com:80 ... OK
HTTP/1.1 200 OK
Date: Mon, 16 Mar 2020 05:27:29 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=ISO-8859-1
P3P: CP="This is not a P3P policy! See g.co/p3phelp for more info."
Server: gws
X-XSS-Protection: 0
X-Frame-Options: SAMEORIGIN
Set-Cookie: 1P_JAR=2020-03-16-05; expires=Wed, 15-Apr-2020 05:27:29 GMT; path=/; domain=.google.com; Secure
Set-Cookie: NID=200=JBfr5Q6bk1PqN8lTCIuYOcB5oJGAkhWCRtZiVP2dEHgOlyb12TOvy4Zb-CFJn_SReq2zxudlOyyobejQhxEIa0lwcv4yyzctRTXrJPKr-_5DjaPVgqWTrbLs_MtW-lRJr45rVEFN0CBesrC3N_Ug6lVSxOlD7-C1M35M4qXIXsc; expires=Tue, 15-Sep-2020 05:27:29 GMT; path=/; domain=.google.com; HttpOnly
Transfer-Encoding: chunked
Accept-Ranges: none
Vary: Accept-Encoding
来源:oschina
链接:https://my.oschina.net/kcw/blog/3195906