来源:https://www.zybuluo.com/ncepuwanghui/note/954160

参考:https://blog.huihut.com/2017/08/25/LinuxInstallConfigShadowsocksClient/

亲测在CentOS-7-x86_64-DVD-1804.iso(KDE)上安装成功

一、安装shadowsocks

安装epel扩展源
采用Python包管理工pip安装

sudo yum -y install epel-release
sudo yum -y install python-pip

由于安装shadowsocks时提示需要jiaja2和pyudev,dnspython的版本要求,所以安装和更新

ipaclient 4.5.4 requires jinja2, which is not installed.
rtslib-fb 2.1.63 has requirement pyudev>=0.16.1, but you'll have pyudev 0.15 which is incompatible.
ipapython 4.5.4 has requirement dnspython>=1.15, but you'll have dnspython 1.12.0 which is incompatible.

安装jiaja2

sudo yum -y install python-jinja2

更新pyudev

git clone https://github.com/lunaryorn/pyudev.git
cd pyudev
sudo python setup.py install

更新dnspython

wget http://www.dnspython.org/kits/1.15.0/dnspython-1.15.0.tar.gz
tar -zxvf dnspython-1.15.0.tar.gz
cd dnspython-1.15.0
sudo python setup.py install

安装shadowsocks

sudo pip install shadowsocks

如果出现此提示,则按提示更新pip

You are using pip version 8.1.2, however version 10.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.

更新

sudo pip install --upgrade pip

二、配置Shadowsocks

新建设置文件

sudo vi /etc/shadowsocks.json
{
"local_address": "127.0.0.1",
"local_port":1080,
"server":"服务器IP",
"server_port":服务器端口,
"password":"服务器密码",
"timeout":300,
"method":"aes-256-cfb",
"fast_open": false,
"workers": 1
}

2.新建自启动脚本,设置后开机可以自启动(注意路径)

sudo vi /etc/systemd/system/shadowsocks.service
[Unit]
Description=Shadowsocks
[Service]
TimeoutStartSec=0
ExecStart=/usr/bin/sslocal -c /etc/shadowsocks.json
[Install]
WantedBy=multi-user.target

3.启动

systemctl enable shadowsocks.service
systemctl start shadowsocks.service
systemctl status shadowsocks.service

4.测试,成功时返回shadowsocks的设置IP

curl --socks5 127.0.0.1:1080 http://httpbin.org/ip

三、配置火狐

下载安装FoxyProxy Standard

配置FoxyProxy,填写IP和端口,选择socks5,保存

启用代理

测试

四、安装配置Privoxy

sudo yum -y install privoxy

启动Privoxy

systemctl enable privoxy
systemctl start privoxy
systemctl status privoxy

配置Privoxy(文本较长,建议其他文本编辑器查找)

sudo vi /etc/privoxy/config

确保如下内容没有被注释掉

listen-address 127.0.0.1:8118    #8118是默认端口,不用改
forward-socks5t / 127.0.0.1:1080 . #转发到本地端口

添加代理

sudo vi /etc/profile
export http_proxy=http://127.0.0.1:8118
export https_proxy=http://127.0.0.1:8118
source /etc/profile

测试

curl www.google.com

[Linux]CentOS与终端破墙的更多相关文章

  1. [Linux]Ubuntu与终端破墙

    参考:https://www.jianshu.com/p/941bf811f9c2 亲测在ubuntu-14.04.4-desktop-amd64.iso上安装成功 福利:https://github ...

  2. Linux(centos)系统各个目录的作用详解

    Linux(centos)系统各个目录的作用详解 文件系统的类型 LINUX有四种基本文件系统类型:普通文件.目录文件.连接文件和特殊文件,可用file命令来识别. 普通文件:如文本文件.C语言元代码 ...

  3. Linux Centos 6.6搭建SFTP服务器

    Linux Centos 6.6搭建SFTP服务器 在Centos 6.6环境使用系统自带的internal-sftp搭建SFTP服务器. 打开命令终端窗口,按以下步骤操作. 0.查看openssh的 ...

  4. VM的Linux CentOS系统的VMTools的手动安装

    VM的Linux CentOS系统的VMTools的手动安装 一是没时间安装,另外是一直用的是VM的绿色版,里面没有Linux.iso 文件 今天晚上安装上了 linux 的vmtools ,再也不用 ...

  5. NO.4day LINUX centos 文件基本操作

    LINUX centos 文件基本操作 1 LINUX简介 Linux的定义:Linux是一套免费使用和自由传播的类Unix操作系统,是一个基于POSIX和UNIX的多用户.多任务.支持多线程和多CP ...

  6. Linux CentOS 7 安装confluence 5.8.10

    一..需要下载的安装包如下 1.atlassian-confluence-5.8.10-x64.bin #confluence安装包 2.confluence5.x-crack.zip #conflu ...

  7. Linux(centos 6.5) 调用java脚本以及定时运行的脚本实例及配置文件具体解释

    Linux(centos 6.5) 调用java脚本以及定时运行的脚本实例 一.调用java程序脚本(默认已经搭建好了Java环境) 1.jdk 安装路径 /usr/jdk/jdk1.7/-- 2.j ...

  8. linux centos安装zabbix 4.0服务端

    1.服务器安装docker sudo yum install -y yum-utils device-mapper-persistent-data lvm2 sudo yum-config-manag ...

  9. .Net Core 项目发布到Linux - CentOS 7(一)

    由于项目的需求,需要发布到Linux服务器上,在这里记录一下我发布的过程. 安装Linux 安装liunx系统很简单,网上也有很多教程,我是直接使用阿里云的CentOS 7.7 64位 部署环境 Li ...

随机推荐

  1. REST SOAP Thrift 对比

    别人的REST SOAP Thrift对比: 单项分数越高越好 项目 REST SOAP Thrift Extensibility 5 3 1 Neutrality 2 4 3 Independenc ...

  2. 第六章Django

    web应用程序 server端建立socket,不断地accept,当收到客户端连接信号之后,服务端向客户端发送数据,将html网页打开,read出来,并发送至客户端,这样客户端就可以浏览到网页的内容 ...

  3. [原] RTTI 为什么type_info 有比较操作

    The lifetime of the object returned by typeid extends to the end of the program. 根据C++标准, typeid()返回 ...

  4. PythonStudy——闭包

    # closure:被包裹的函数,称之为闭包 # 完整的闭包结构:1.将函数进行闭包处理:2.提升函数名的作用域 # 案例:延迟加载 def get_site(url): #url='https:// ...

  5. 用 EPWA 写一个 图片播放器 PicturePlayer

    用 EPWA 写一个 图片播放器  PicturePlayer  . 有关 EPWA,见 <我发起并创立了一个 EPWA 的 开源项目>   https://www.cnblogs.com ...

  6. 弹出的 Dialog 里,包含 Form,如何在关闭 Dialog 时,执行 resetFields(对整个表单进行重置,将所有字段值重置为初始值并移除校验结果)

    做法: before-close 事件中,调用 resetFields 取消按钮事件中,调用 resetFields <el-dialog title="弹出窗口" :vis ...

  7. sql 用过记住

    1 递归查询一个节点下的所有子节点 包括该节点 connect by h.parent_menu_id= prior h.menu_idstart with h.menu_id='当前节点' h.pa ...

  8. MySQL更改命令行默认分隔符

    MySQL命令行默认语句分隔符为分号  ; 使用DELIMITER命令可以更改默认分隔符 mysql> DELIMITER   // 将默认分割符改为  //

  9. 使用phpunit测试yaf项目操作步骤

    yaf + phpunit 使用phpunit对yaf进行测试的核心在于bootstrip文件的配置. *1. 首先在项目目录下创建tests文件,并在tests中创建phpunit.xml < ...

  10. Ubuntu16.04下安装nginx+mysql+php+redis

    一.redis简介 Redis是一个key-value存储系统.和Memcached类似,为了保证效率,数据都是缓存在内存中.区别的是redis会周期性的把更新的数据写入磁盘或者把修改操作写入追加的记 ...