树莓派终端代理

作者: 飞鱼ll | 来源:发表于2018-08-04 12:44 被阅读12次

树莓派安装Shadowsocks客户端

在树莓派上配置Shadowsocks客户端, 这是让树莓派翻QIANG的必要条件。

#安装pip管理python包
sudo apt-get install python-pip python-m2crypto
#安装python版shadowsocks
sudo pip install shadowsocks
#设置shadowsocks客户端配置文件
sudo vim /etc/shadowsocks.json

shadowsocks.json文件内容模板如下:

{
  "server":"xxx.xxx.xxx.xxx", //VPS IP
  "server_port":8388, //VPS端口
  "local_address": "xxx.xxx.xxx.xxx", //树莓派IP
  "local_port":1080, //树莓派端口
  "password":"mypassword", //VPS上设置shadowsocks服务器的密码
  "timeout":60,
  "method":"encrypt_method", //VPS 上设置的加密方式, 不知道可以选择"aes-256-cfb"
  "fast_open": false,
  "workers": 1
}

若要设置SS客户端开机自启动,需编辑/etc/rc.local文件,在最后的exit一行之前添加:

/usr/local/bin/sslocal -c /etc/shadowsocks.json -d start

然后检查sslocal是否正确运行

sudo systemctl status rc-local.service

如果rc.local正确运行,可以看到类似下面的的输出:

● rc-local.service - /etc/rc.local Compatibility
   Loaded: loaded (/lib/systemd/system/rc-local.service; static)
  Drop-In: /etc/systemd/system/rc-local.service.d
           └─ttyoutput.conf
   Active: active (running) since Wed 2016-07-13 00:06:01 CST; 1min 40s ago
  Process: 603 ExecStart=/etc/rc.local start (code=exited, status=0/SUCCESS)
 Main PID: 1072 (sslocal)
   CGroup: /system.slice/rc-local.service
           └─1072 /usr/bin/python /usr/local/bin/sslocal -c /etc/shadowsocks.json -d start

curl和wget实例

curl -x http://127.0.0.1:1080 github.com
wget -e "http_proxy=127.0.0.1:1080" github.com

终端设置代理
打开终端,执行

export http_proxy=http://127.0.0.1:1080;
export https_proxy=http://127.0.0.1:1080;

参考:
http://www.wuliaole.com/post/raspberry_pi_and_shadowsocks/
https://www.timenotes.me/articles/shared/28/ss-configuration-lets-the-terminal-move-to-the-agent

相关文章

  • 树莓派终端代理

    树莓派安装Shadowsocks客户端 在树莓派上配置Shadowsocks客户端, 这是让树莓派翻QIANG的必...

  • 树莓派串口配置及minicom的安装

    1.树莓派串口配置:树莓派串口默认用于终端调试,如需使用串口,则需要修改树莓派设置。执行如下命令进入树莓派配置:s...

  • 树莓派4B安装Nood.js

    手把手教你在树莓派上安装Nood.js 1.查看树莓派架构下载对应的版本 首先查看树莓派的架构,树莓派终端输入命令...

  • 树莓派串口通信

    树莓派的串口默认为串口终端调试使用,如要正常使用串口则需要修改树莓派设置。关闭串口终端调试功能后则不能再通过串口登...

  • 树莓派镜像烧写及远程登录(Linux和Windows)

    烧写系统到树莓派 在树莓派官网下载raspberry系统,在Windows中要下载烧写软件,在Linux中只需终端...

  • 安卓树莓派WiFi连接

    不想看见烦人的布线? 安卓树莓派的WiFi就不能少。 首先将树莓派和电脑终端连在一个网络下。打开cmd,或者And...

  • 树莓派4B终端(命令行)安装邮箱脚本实现文件上传

    手把手教你在树莓派上配置邮箱脚本实现文件上传 1 安装heirloom-mailx 在树莓派终端输入如下命令: 完...

  • 基于树莓派的远程视频内外网监控系统

    远程视频监控系统采用树莓派作为智能终端,通过CSI摄像头获取当前老年公寓内环境的视频信息,树莓派的得到视频信息后,...

  • 树莓派针脚图

    树莓派40Pin引脚对照表 本表格适用于树莓派B+、树莓派2B、树莓派A+,并且兼容树莓派B,树莓派B为26Pin...

  • 树莓派上手资料

    树莓派开箱上手教程树莓派下载资料使用手机连接树莓派1使用手机连接树莓派2树莓派实验室无显示屏启动树莓派 如何用pu...

网友评论

    本文标题:树莓派终端代理

    本文链接:https://www.haomeiwen.com/subject/yddhmftx.html