Ubuntu虚拟机终端代理上网

因为在Ubuntu终端配置一些开发环境时经常遇到下载很慢或者无法下载的情况,所以想把Windows主机的s h a dows socks代理上网给Ubuntu终端用,配置过程如下:

第一步:安装privoxy

sudo apt-get install privoxy

第二步:修改配置文件

sudo vim /etc/privoxy/config

修改两处,第一处是4.2节,修改如下(我这里和默认是一致的):

第二处是5.2节,修改如下(这里192.168.65.71是运行sha dow  socks 的Windows主机ip地址,注意端口后面还有 一个点号):

第三步:环境变量设置

export https_proxy="127.0.0.1:8118"

export http_proxy="127.0.0.1:8118"

以上命令是单次运行有效,要永久有效需要设置相关配置文件。

第四步:windows上sha dow sock s 设置

应该勾选上"允许来自局域网的连接",默认是没有勾选的:

 

第四步:测试

wsc@wsc-ros:~/ros2_ws$ wget http://www.某个不能方便访问的网址.com

--2018-07-31 15:49:57--  http://www.某个不能方便访问的网址.com/

Connecting to 127.0.0.1:8118... connected.

Proxy request sent, awaiting response... 200 OK

Length: 10793 (11K) [text/html]

Saving to: ‘index.html.1’

 

index.html.1        100%[===================>]  10.54K  --.-KB/s    in 0s     

 

2018-07-31 15:49:58 (333 MB/s) - ‘index.html.1’ saved [10793/10793]

猜你喜欢

转载自blog.csdn.net/wsc820508/article/details/81316399