Ubuntu使用shadowsocks和chrome

来源:互联网 发布:ubuntu怎样新建文件夹 编辑:程序博客网 时间:2024/06/16 07:26

1.安装pip
sudo apt-get install pip
2.安装shadowsocks
sudo pip install shadowsocks
3.配置文件,创建/etc/shadowsocks.json 文件,这是将配置文件放在/etc 文件夹下,放在哪里都可以
sudo gedit /etc/shadowsocks.json
在文件中输入以下内容
{
"server":"my_server_ip", #服务器ip
"server_port":8388, #服务器端口
"local_address": "127.0.0.1", #本地ip
"local_port":1080, #本地使用的端口
"password":"mypassword", #密码
"timeout":300,
"method":"rc4-md5" #加密方法
}

具体内容根据所使用的ss账号填写
4.运行shadowsocks
sslocal -c /etc/shadowsocks.json
5.在chrome中配置SwitchyOmega
这里写图片描述
此图中的代理协议根据自己需要选择,代理服务器和代理端口和之前配置文件中的”local_address”和”local_port”对应
这里写图片描述
按照红圈中的配置即可,其中规则列表网址为https://raw.githubusercontent.com/gfwlist/gfwlist/master/gfwlist.txt
注:使用shadowsocks-qt5配置总是链接不上,原因不明。
使用ssserver -c /etc/shadowsocks.json -d start 启动shadowsocks会出现option -d not recognized

开机启动的配置
sudo gedit /etc/systemd/system/shadowsocks.service
在里面填写如下内容:
[Unit]
Description=Shadowsocks Client Service
After=network.target
[Service]
Type=simple
User=root
ExecStart=/usr/bin/sslocal -c /etc/shadowsocks.json
[Install]
WantedBy=multi-user.target
然后使用在终端输入
sudo systemctl enable /etc/systemd/system/shadowsocks.service
即可。

原创粉丝点击