VPS常用脚本集合

VPS常用脚本集合

Tags
docker
脚本
Published
Author

docker管理工具

docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock --restart=always --name portainer portainer/portainer-ce
 

甲骨文ARM DD系统

bash <(wget --no-check-certificate -qO- 'https://raw.githubusercontent.com/MoeClub/Note/master/InstallNET.sh') -d 10 -v 64 -p "您的密码" -port "22"
甲骨文amd DD Windows10 2019LTSC 64位 企业深度精简版 [账户Administrator密码nat.ee]
wget --no-check-certificate -qO InstallNET.sh 'https://sunpma.com/other/oss/InstallNET.sh' && bash InstallNET.sh -dd 'https://oss.sunpma.com/Windows/Oracle_Win10_2019LTSC_64_Administrator_nat.ee.gz'

八合一脚本

 
更新系统
yum update -y #CentOS系统命令 apt update -y #Debian系统命令
安装wget
yum install -y wget #CentOS系统命令 apt install -y wget #Debian系统命令
脚本
wget -P /root -N --no-check-certificate "https://raw.githubusercontent.com/mack-a/v2ray-agent/master/install.sh" && chmod 700 /root/install.sh && /root/install.sh
 

流媒体解锁测试

bash <(curl -L -s https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh)
 

带验证的speed test测速port:9999

docker run -d -e TZ=Asia/Shanghai -e ENABLE_CAPTCHA=1 -e INFLIGHT_TEST_LIMIT=1 --network host --restart=always -it mengskysama/speedtest-go:v1.17-alpha-alpine3.15
 

不带测速的GB5

 
GB6 跑分脚本,附带宽测试: curl -sL yabs.sh | bash GB6 剔除带宽测试,因为都是国外节点测试,国内跑没多大意义: curl -sL yabs.sh | bash -s -- -i GB5 跑分脚本,附带宽测试: curl -sL yabs.sh | bash -5 GB5 剔除带宽测试: curl -sL yabs.sh | bash -s -- -i -5
curl -sL yabs.sh | bash -s -- -i

多线程测速

bash <(curl -Lso- https://www.infski.com/files/superspeed.sh)

单线程测速

bash <(curl -Lso- https://bench.im/hyperspeed)
 

docker安装

国内源
curl -sSL https://get.daocloud.io/docker | sh
国外源
curl -fLsS https://get.docker.com/ | sh
 
 

开放所有端口

#停止firewall systemctl stop firewalld.service #禁止firewall开机启动 systemctl disable firewalld.service #关闭iptables service iptables stop #去掉iptables开机启动 chkconfig iptables off #开放所有端口 sudo iptables -P INPUT ACCEPT sudo iptables -P FORWARD ACCEPT sudo iptables -P OUTPUT ACCEPT sudo iptables -F #Oracle自带的Ubuntu镜像默认设置了Iptable规则,关闭它 apt-get purge netfilter-persistent reboot #强制删除 rm -rf /etc/iptables && reboot
 

VPS改密码登录

sudo -i echo root:要修改的密码 |sudo chpasswd root sudo sed -i 's/^.*PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config; sudo sed -i 's/^.*PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config; sudo service sshd restart
 
 

开放指定端口

安装iptables(通常系统都会自带,如果没有就需要安装)
apt-get update apt-get install iptables
例如要放行8888端口
iptables -I INPUT -p tcp --dport 8888 -j ACCEPT
然后保存放行规则
iptables-save
设置完就已经放行了指定的端口,但重启后会失效,下面设置持续生效规则;
 
安装iptables-persistent
apt-get install iptables-persistent
保存规则持续生效
netfilter-persistent save netfilter-persistent reload
设置完成后指定端口就会持续放行了;

甲骨文改root登陆 也适用AWS

sudo -i echo root:要修改的密码 |sudo chpasswd root sudo sed -i 's/^.*PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config; sudo sed -i 's/^.*PasswordAuthentication.*/PasswordAuthentication yes/g' /etc/ssh/sshd_config; sudo service sshd restart
 

socat端口转发

wget https://raw.githubusercontent.com/lzw981731/Socat/master/socat.sh && bash socat.sh

iptables端口转发

安装
wget --no-check-certificate -qO natcfg.sh https://www.arloor.com/sh/iptablesUtils/natcfg.sh && bash natcfg.sh
卸载
wget --no-check-certificate -qO uninstall.sh https://raw.githubusercontent.com/arloor/iptablesUtils/master/dnat-uninstall.sh && bash uninstall.sh

vps更换为国内源

bash <(curl -sSL https://gitee.com/SuperManito/LinuxMirrors/raw/main/ChangeMirrors.sh)
 
 

screen后台守护

安装
yum install screen
查看
screen -ls
新建一个david会话
screen -S david
运行
screen bash xxxxx
重新连接会话
screen -r 12865
 

国内三网测速

bash <(curl -Lso- https://git.io/superspeed_uxh)
 

永久更改DNS

方法三(写保护锁定resolv.conf文件) rm -f /etc/resolv.conf editor /etc/resolv.conf #填写上指定的DNS服务器: nameserver 1.1.1.1 nameserver 1.0.0.1 ------------------------------------ 此时resolv.conf文件的内容就会被锁定不会被重启覆盖,想要解锁的话运行: chattr +i /etc/resolv.conf
 
回程
traceroute -n cloud.189.cn
 

hostloc发布url链接方法——在loc发布链接

带文本链接
注意:需要加上http或https
[url=[url][url]https://rebgm.com/[/url][/url]]输入文本[/url]
纯链接(小几率不行)
[url][url][url]https://rebgm.com/[/url][/url][/url]
 

将正在运行的容器设为自启动

 
docker update --restart=always <CONTAINER ID>
 

N1做单臂路由,ssh无法连接外部IP

设置步骤,,网络-防火墙-通信规则-drop-wan-ssh 取消勾选 保存并应用即可。
notion image
 
 
 
 
VPS真实测速
apt-get install -y iperf3
iperf3 -s
iperf3 -c xxx.xxx.xxx.xxx -P 10 -R -p 5201
 

回程测试bash <(curl -Ls https://raw.githubusercontent.com/sjlleo/nexttrace/main/nt_install.sh) nexttrace ip

bash <(curl -Ls https://raw.githubusercontent.com/sjlleo/nexttrace/main/nt_install.sh) nexttrace ip

Linux VPS一键屏蔽指定国家所有的IP访问

wget https://www.moerats.com/usr/shell/block-ips.sh chmod +x block-ips.sh ./block-ips.sh
封禁ip时会要求你输入国家代码,代码查看:点击进入。记住所填参数均为小写字母。比如JAPAN (JP),我们就输入jp这个参数。
 

Iperf3

apt-get install -y iperf3
iperf3 -s
iperf3 -c xxx.xxx.xxx.xxx -P 10 -R -p 5201