标签 json 下的文章

换源

vi /etc/apt/sources.list

deb https://mirrors.ustc.edu.cn/debian stretch main contrib non-free
deb https://mirrors.ustc.edu.cn/debian stretch-updates main contrib non-free
deb https://mirrors.ustc.edu.cn/debian stretch-backports main contrib non-free
deb https://mirrors.ustc.edu.cn/debian-security/ stretch/updates main contrib non-free

apt-get update && apt-get upgrade

安装宝塔

https://www.feiji.work/2019/20.html
wget https://www.feiji.work/n1/bt/6.9.4/install.sh && sudo bash install.sh
安装完成可能有错误提示 直接reboot重启
查看面板入口:/etc/init.d/bt default

安装nginx

https://www.feiji.work/2019/41.html

打开ssh(注:如果以下步骤提示缺少文件,可以在宝塔后台执行一次安装Nginx,在下载完脚本后直接取消安装即可。)

cd /www/server/panel/install #如果目录存在nginx 先rm
wget https://www.feiji.work/n1/bt/nginx.sh 下载nginx.sh
sh nginx.sh install #直接安装

安装Nginx出现checking for GD library ... not found错误
https://de.lib.im/linux-gd.html
apt-get -y install libgd2-xpm-dev build-essential重新安装

报错Starting nginx... nginx: [emerg] getpwnam("www") failed in /www/server/nginx/conf/nginx.conf:1
https://blog.csdn.net/rebel_yangke/article/details/58601731
修改/www/server/nginx/conf/nginx.conf 两个www改成root 再重启

pppoe宽带拨号

https://xaolong.com/post/279.html
https://malagege.github.io/blog/2019/01/26/Linux%E4%BD%BF%E7%94%A8pppoe%E9%80%A3%E7%B7%9A%E6%96%B9%E6%B3%95%E5%B0%8F%E8%A8%98/

apt install pppoeconf -y
apt install isc-dhcp-server -y

vi /etc/default/isc-dhcp-server
#将INTERFACESv4=""修改为INTERFACESv4="br0"
#在INTERFACESv6=""的前面加个#,修改为#INTERFACESv6=""

mv /etc/dhcp/dhcpd.conf /etc/dhcp/dhcpd.conf.bak

vi /etc/dhcp/dhcpd.conf  ###里面的所有内容
###
option domain-name "phicomm-n1";
option domain-name-servers 119.29.29.29;
subnet 192.168.1.0 netmask 255.255.255.0 {
    range 192.168.1.101 192.168.1.254;
    option subnet-mask 255.255.255.0;
    option broadcast-address 192.168.1.255;
    option routers 192.168.1.2;
    option domain-name-servers 119.29.29.29;
}
default-lease-time 600;
max-lease-time 7200;
authoritative;
###

vi /etc/network/interfaces
#iface eth0 inet dhcp 改为iface eth0 inet manual 后面增加以下内容 ###里面的全部 见图一
###
auto br0
iface br0 inet static
bridge_ports eth0
address 192.168.1.2
broadcast 192.168.1.255
network 192.168.1.0
netmask 255.255.255.0
gateway 192.168.1.2
bridge_stp off              
bridge_waitport 0           
bridge_fd 0
###

vi /etc/sysctl.conf
#去掉net.ipv4.ip_forward=1前面的#号

sysctl -p

vi  /etc/rc.local
#在 exit 0 前一行加以下内容
iptables -t nat -A POSTROUTING -j MASQUERADE

reboot

批注 2019-12-29 185147.png

n1接光猫 #n1已经固定IP 192.168.1.2

pppoeconf #进入拨号向导
#第一个选no
#删除username 输入宽带账号
#输入宽带密码
#之后全部 yes

poff -a # 關閉全部pppoe

查看状态
plog
ip addr show ppp0

开机自动拨号
vi /etc/rc.local #在 exit 0 前一行加一句:
pon dsl-provider

账号密码配置文件地址/etc/ppp/pap-secrets

动态域名解析dns

https://github.com/NewFuture/DDNS

git clone https://github.com/NewFuture/DDNS
cd DDNS
./run.py #运行一次 生成config.json配置文件
vi config.json #修改 id 域名 token
./task.sh

说明:老毛子系统路由器使用v2ray科学上网的配置方法。本文使用新路由3 h大的最新版固件 配置前请确认节点状态可用。

导出节点

1.在电脑上将正常的节点导出为客户端json
TIM截图20190607105234.png
2.修改json第10行"listen"为路由器的管理地址
TIM截图20190607105402.png

路由器上v2ray设置

1.搭建Web环境==>v2ray==>v2ray proxy 开关 打开==>粘贴v2ray_config_script==>应用本页设置
TIM截图20190607105551.png

transocks设置

广告屏蔽功能==>transocks==>transocks 开关 打开
透明重定向的代理服务器IP、域名:路由器的管理IP
透明重定向的代理服务器端口:json文件第9行的端口
远端服务器IP、域名:v2ray节点的域名或者IP
TIM截图20190607111955.png

官网简介:从你的 Linux(X86/ARM)/Mac/BSD 系统环境下发起 traceroute 请求,附带链路可视化,兼容性更好,支持 JSON 格式输出。

下载BestTrace

wget https://cdn.ipip.net/17mon/besttrace4linux.zip #下载
unzip besttrace4linux.zip #解压
chmod +x besttrace #赋予BestTrace执行权限

使用BestTrace

./besttrace -q1 -g cn 119.6.6.6
TIM20190531012438.png

参考:https://www.xiaoz.me/archives/11769

说明个人理解:用于内网穿透,moon相当于中转服务器。
安装环境 Debian 8

安装zerotier

curl -s https://install.zerotier.com/ | bash
cd /var/lib/zerotier-one #进入目录
./zerotier-cli join xxxxxxxxxxxxxxxx #id是之前申请好的,成功会返回 200 jion ok

生成及修改 moon.json

zerotier-idtool initmoon identity.public >>moon.json #在当前目录下生成一个文件 moon.json
vi moon.json #修改 "stableEndpoints" 为当前公网ip 如:
# "stableEndpoints": [ "1.2.3.4/9993","2001:abcd:abcd::1/9993" ] ipv4和ipv6之间用,隔开,防火墙放行端口
zerotier-idtool genmoon moon.json #生成签名文件 000000xxxxxxxxxx.moon
在 /var/lib/zerotier-one 目录下建立子文件夹 moons.d
将生成的 000000xxxxxxxxxx.moon 拷贝进 moons.d 文件夹中,并重启服务器
/etc/init.d/zerotier-one restart

内网机器连接上moon节点

zerotier-cli orbit xxxxxxxxxx xxxxxxxxxx #其中xxxxxxxxxx为节点服务器的 ZeroTier address

zerotier卸载

#Debian/Ubuntu
apt-get purge zerotier-one
#CentOS卸载命令如下所示:
yum remove  zerotier-one

说明:telegram的mtproto最近挂得很快,搜索了下发现用国内机子中转下,同时找到了inner-ss。下面是国内小鸡上的操作,国外的酸酸正常使用的情况。
不仅仅电报可以用,老毛子固件的transocks应该也行,配合gfwlist

1.下载自己服务器对应的版本 https://github.com/ihciah/inner-shadowsocks/releases
2.上传到服务器目录下/root/inner-ss/ 只是举例,按自己实际情况
3.编辑config.json

{
  "listen": "0.0.0.0",
  "port": 23333, #socks5的端口
  "auth": false, #认证默认关闭
  "username": "ihc", #用户名
  "password": "iah", #密码
  "servers": ["ss://RC4-MD5:pass1@ip1:port1", "ss://RC4-MD5:pass2@ip2:port2"], #酸酸服务器
  "maxfail": 3,
  "recovertime": 600,
  "starttimeout": 3,
  "remotetimeout": 120,
  "insidetimeout": 120,
  "whitelistenable": false,
  "whitelistdomains": [".telegram.org"],
  "whitelistips": ["::/0", "0.0.0.0/0", "91.108.4.0/22", "91.108.8.0/22", "91.108.56.0/22", "109.239.140.0/24", "149.154.160.0/20", "149.154.164.0/22", "2001:67c:4e8::/48"]
}

4.开机启动后台运行(Debian8)
vi /etc/rc.local
在"exit 0"前添加一行
nohup /root/inner-ss/inner-ss -c /root/inner-ss/config.json > /dev/null 2>&1 &
给权限
chmod +x /etc/rc.local

菜鸟一枚,根据自己操作写的记录贴,有不当的地方请指出

下载v2ray

下载地址:https://github.com/v2ray/v2ray-core/releases/
r2d选择arm:https://github.com/v2ray/v2ray-core/releases/download/v3.43/v2ray-linux-arm.zip

上传至路由器

目录:根据自己实际情况,之前又mt工具箱,所以直接放里面了
/data/etc/misstar/applications/v2ray
1.解压上传客户端文件

2.上传客户端配置文件
2.1导出客户端配置并上传至路由器
image

2.2修改配置文件,参考下面代码

{
  "log": {
    "access": "",
    "error": "error.log", 
    "loglevel": "warning"
  },
  "inbound": {
    "port": 2333,
    "listen": "0.0.0.0",
    "protocol": "socks",
    "domainOverride": [
      "tls",
      "http"
    ],
    "settings": {
      "auth": "noauth",
      "udp": true,
      "ip": "127.0.0.1",
      "clients": null
    },
    "streamSettings": null
  },
  "outbound": {
    "tag": "agentout",
    "protocol": "vmess",
    "settings": {
      "vnext": [
        {
          "address": "us2.sangyu.tw",
          "port": 443,
          "users": [
            {
              "id": "xxxxxxxxxxxxxxxxxxx",
              "alterId": 233,
              "email": "t@t.tt",
              "security": "aes-128-gcm"
            }
          ]
        }
      ],
      "servers": null
    },
    "streamSettings": {
      "network": "ws",
      "security": "tls",
      "tlsSettings": {
        "allowInsecure": true,
        "serverName": null
      },
      "tcpSettings": null,
      "kcpSettings": null,
      "wsSettings": {
        "connectionReuse": true,
        "path": "/",
        "headers": {
          "Host": "us2.sangyu.tw"
        }
      },
      "httpSettings": null
    },
    "mux": {
      "enabled": true
    }
  },
    "inboundDetour":[
        {
           "protocol":"dokodemo-door",
           "port":1099, 
           "settings":{
              "address":"",
              "network":"tcp",
              "timeout":0,
              "followRedirect":true
           }
        }
     ],
  "outboundDetour": [
    {
      "protocol": "freedom",
      "settings": {
        "response": null
      },
      "tag": "direct"
    },
    {
      "protocol": "blackhole",
      "settings": {
        "response": {
          "type": "http"
        }
      },
      "tag": "blockout"
    }
  ],
  "dns": {
    "servers": [
      "8.8.8.8",
      "8.8.4.4",
      "localhost"
    ]
  },
  "routing": {
    "strategy": "rules",
    "settings": {
      "domainStrategy": "IPIfNonMatch",
      "rules": [
        {
          "type": "field",
          "port": null,
          "outboundTag": "direct",
          "ip": null,
          "domain": [
            "geosite:cn"
          ]
        },
        {
          "type": "field",
          "port": null,
          "outboundTag": "direct",
          "ip": [
            "geoip:cn"
          ],
          "domain": null
        },
        {
          "type": "field",
          "port": null,
          "outboundTag": "direct",
          "ip": [
            "0.0.0.0/8",
            "10.0.0.0/8",
            "100.64.0.0/10",
            "127.0.0.0/8",
            "169.254.0.0/16",
            "172.16.0.0/12",
            "192.0.0.0/24",
            "192.0.2.0/24",
            "192.168.0.0/16",
            "198.18.0.0/15",
            "198.51.100.0/24",
            "203.0.113.0/24",
            "::1/128",
            "fc00::/7",
            "fe80::/10"
          ],
          "domain": null
        }
      ]
    }
  }
}

运行软件

1.切换到目录下:/data/etc/misstar/applications/v2ray
2.赋予权限:

chmod +x /data/etc/misstar/applications/v2ray/v2ray
chmod +x /data/etc/misstar/applications/v2ray/v2ctl

3../v2ray --config=/data/etc/misstar/applications/v2ray/config.json
后台运行nohup /data/etc/misstar/applications/v2ray/v2ray --config=/data/etc/misstar/applications/v2ray/config.json &

参考:
https://ralf.ren/717
https://cloverkit.coding.me/2018/08/07/配置-V2Ray-和路由器透明代理

1、依赖安装

apt-get update
apt-get install git wget python-setuptools -y
apt-get install python-pip
pip install cymysql

2、libsodium 安装

apt-get install build-essential -y
wget https://github.com/jedisct1/libsodium/releases/download/1.0.16/libsodium-1.0.16.tar.gz
tar xf libsodium-1.0.16.tar.gz && cd libsodium-1.0.16
./configure && make -j2 && make install
echo /usr/local/lib > /etc/ld.so.conf.d/usr_local_lib.conf
ldconfig
cd ../ && rm -rf libsodium*

3、下载源代码并安装依赖

git clone -b manyuser https://github.com/Anankke/shadowsocks.git
cd shadowsocks
pip install -r requirements.txt

4、配置文件

cp apiconfig.py userapiconfig.py
cp config.json user-config.json
vi userapiconfig.py

5、运行SSR

python server.py 用于调试的
./run.sh 无日志后台运行
./logrun.sh 有日志后台运行

6、开机启动
假设你的shadowsocks是安装在root目录下,可以这样:
vi /etc/rc.local
加入一条:
sh /root/shadowsocks/run.sh
然后:
chmod +x /etc/rc.local
Debian 9开机启动 https://sixu.life/debian-9-etc-rc-local.html
7、使用Supervisor守护进程启动ssr

# 安装
apt-get install supervisor -y

# 写入配置
vi /etc/supervisor/conf.d/ssr.conf

# 写入以下内容
[program:ssr]
command=python /root/shadowsocks/server.py 
autorestart=true
autostart=true
user=root

# 重启Supervisor服务。
/etc/init.d/supervisor restart

# 重启 ssr
supervisorctl restart ssr

# 查看Supervisor服务运行状态。
supervisorctl status

# 如果遇到问题,可以检查日志:
supervisorctl tail -f ssr stderr

# 如果使用supervisor进程守护,需要修改文件vi /etc/default/supervisor,添加一行:
ulimit -n 1024000

8、加速
Debian OpenVZ 魔改 BBR:https://sixu.life/debian-openvz-magic-change-bbr.html
Debian centos bbr加速:https://sixu.life/the-acceleration-effect-of-bbr-is-obvious.html

参考:
https://blog.starryvoid.com/archives/176.html

https://github.com/zyl6698/ss-panel-v3-mod-with-f2fpay/wiki/%E5%AE%89%E8%A3%85%E9%AD%94%E6%94%B9%E5%90%8E%E7%AB%AF

https://github.com/iMeiji/shadowsocks_install/wiki/%E6%90%AD%E5%BB%BA-sspanel-v3-%E9%AD%94%E6%94%B9%E7%89%88%E8%AE%B0%E5%BD%95

简介

5hadow5ocksR 多用户版服务端安装记录(S*S-Panel后端)

安装环境

1.centos 7.3
2.阿里云国际版sg

基本库安装

yum update
yum install git -y

获取源代码

git clone -b manyuser https://github.com/ToyoDAdoubi/shadowsocksr.git

注意:根目录的是多用户版(即数据库版)[shadowsocksr];子目录中的是单用户版[shadowsocksr/shadowsocksr]

安装依赖(cymysql)

cd shadowsocksr
# 进入ShadowsocksR根目录
bash setup_cymysql.sh
# 安装Cymysql 依赖
bash initcfg.sh
# 初始化ShadowsocksR服务端

服务端配置

shadowsocksr 根目录内,打开文件vi usermysql.json,输入i进入编辑状态,esc退出编辑,:wq保存退出

"host": "127.0.0.1", //前端mysql域名/IP
"port": 3306, //mysql端口
"user": "ss", //mysql用户名
"password": "pass", //mysql密码
"db": "shadowsocks", //数据库名

注意:host如果在其他主机,要添加本机的访问权限。

配置文件config.json

一般情况下不需要编辑,除非你需要修改 加密方式/协议/混淆等参数。

vi user-config.json

注意:新版ShadowsocksR服务端的 默认加密方式为 aes-128-ctr ,大家注意一下。
"method":"aes-128-ctr", //修改成您要的加密方式的名称
"protocol": "auth_aes128_md5", //修改成您要的协议插件名称
"obfs": "tls1.2_ticket_auth_compatible", //修改成您要的混淆插件名称

服务端运行与停止

python server.py

这句运行代码主要用于调试,关闭ssh后ss后端自动关闭,所以正式使用请使用下面的脚本运行!
如果需要停止请按Ctrl+C键终止程序。

firewall(centos7)的防火墙配置

服务端没有错误,而连接不上,需要检查iptables或firewall(centos7)的防火墙配置

systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动

添加安全组规则

1.阿里云控制台中实例选择“管理”
2.依次点击“本实例安全组”=>“配置规则”=>“添加安全组规则”
3.把s*s端口添加进去
image

开机启动

chmod +x /etc/rc.d/rc.local
#首先设置开机启动文件的权限
vi /etc/rc.d/rc.local
#编辑文件,按i进入编辑模式
bash /root/shadowsocksr/run.sh
#添加开机启动命令,按esc退出编辑模式,输入 :wq 保存退出

来源:https://doub.io/ss-jc14/