Ubuntu安装ss(终端+浏览器)

Ubuntu安装ss(终端+浏览器)

1.首先需要保证你的网络是畅通的,然后更新软件源,用下面的命令

注意:由于博客网站会自动屏蔽特殊词汇,因此全部用ss代替s***socks.   
sudo apt-get update

sudo apt-get install python-pip

sudo pip install ss 

2.输入以下代码

{
    "server": "你的服务器ip",      
    "server_port": 你的服务器端口,    
    "local_address": "127.0.0.1",     
    "local_port": 1080,    
    "password": "你的SS密码",     
    "method": "aes-256-cfb",    
    "fast_open": true,   
    "timeout":300    
}

3.启动SS

sudo sslocal -c /etc/ss.json

4.开机自动启动SS

将上面3的代码加入到/etc/rc.local文件中的exit 0这句代码之前。

5.将sock5代理映射为http代理

sudo apt-get install privoxy
打开/etc/privoxy/config
找到其中的4.1节,看一下有没有一句listen-address localhost:8118的代码,如果被注释了,取消注释。
接着找到5.2节,在本节末尾加入下面代码
forward-socks5 / 127.0.0.1:1080 .

6.重启privoxy服务

sudo /etc/init.d/privoxy restart

7.开机自启privoxy服务

sudo /etc/init.d/privoxy start代码加入到/etc/rc.local文件中的exit 0这句代码之前。

8.终端代理

将以下代码追加到/etc/profile中或者~/.bashrc

export http_proxy="127.0.0.1:8118"    
export https_proxy="127.0.0.1:8118"      
export ftp_proxy="127.0.0.1:8118"    

接着执行source /etc/profile或者source ~/.bashrc,这样就完成了终端翻墙的配置,执行wget google.com测试一下。

9.Firefox浏览器的配置,打开设置->高级->网络->连接

将Manual proxy configuration里面的HTTP Proxy设置为127.0.0.1,Port为8118
勾选Use this proxy server for all protocols

原文地址:https://www.cnblogs.com/zhongzhaoxie/p/13360668.html