VPS 常用命令

random image

🌶 过期警告: 本页面距今已有 1452 天未更新,年久失修,内容可能有所偏颇,还请仔细甄别!

宝塔面板

ubuntu/deepin
1
# centos
2
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install_6.0.sh && sh install.sh
3
4
wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && sudo bash install.sh
5
6
# debian
7
wget -O install.sh http://download.bt.cn/install/install-ubuntu_6.0.sh && bash install.sh
8
9
# fedora
10
wget -O install.sh http://download.bt.cn/install/install_6.0.sh && bash install.sh
11
12
# 更新
13
curl http://download.bt.cn/install/update6.sh|bash
14
5 collapsed lines
15
# 删除登录验证
16
sed -i "s|if (bind_user == 'True') {|if (bind_user == 'REMOVED') {|g" /www/server/panel/BTPanel/static/js/index.js
17
rm -rf /www/server/panel/data/bind.pl
18
# 还原绑定
19
sed -i "s|if (bind_user == 'REMOVED') {|if (bind_user == 'True') {|g" /www/server/panel/BTPanel/static/js/index.js

BBR 加速

Terminal window
1
wget --no-check-certificate -O tcp.sh https://github.com/cx9208/Linux-NetSpeed/raw/master/tcp.sh && chmod +x tcp.sh && ./tcp.sh
2
3
wget -O tcp.sh mcnb.top/tcp.sh && bash tcp.sh
4
5
wget "https://dt.yixiagege.cn/shell/TCP-CN.sh" && chmod +x TCP-CN.sh && ./TCP-CN.sh

回程路由

Terminal window
1
wget https://raw.githubusercontent.com/nanqinlang-script/testrace/master/testrace.sh
2
bash testrace.sh
3
4
bash <(curl -sL mcnb.top/besttcp.sh)

测速

Terminal window
1
# SuperBench
2
wget -qO- --no-check-certificate https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash
3
curl -Lso- -no-check-certificate https://raw.githubusercontent.com/oooldking/script/master/superbench.sh | bash
4
5
# Zbench
6
wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/ZBench/master/ZBench-CN.sh && bash ZBench-CN.sh
7
wget -N --no-check-certificate https://raw.githubusercontent.com/FunctionClub/ZBench/master/ZBench.sh && bash ZBench.sh
8
9
# SuperSpeed
10
bash <(curl -Lso- https://git.io/superspeed)
11
12
# LemonBench
13
curl -fsL https://ilemonra.in/LemonBenchIntl | bash -s fast
14
15
# 91yun
1 collapsed line
16
wget -N --no-check-certificate https://raw.githubusercontent.com/91yun/91yuntest/master/test.sh && bash test.sh -i "io,bandwidth,chinabw,download,traceroute,backtraceroute,allping"

更改 SSH 端口

Terminal window
1
# 备份
2
cp /etc/ssh/sshd_config /etc/ssh/sshd_config.backup
3
# 更改端口
4
vim /etc/ssh/sshd_config
5
# 重启服务
6
systemctl restart sshd
7
# 设置防火墙
8
# firewall
9
firewall-cmd --permanent --zone=public --add-port=xxxx/tcp
10
firewall-cmd --reload
11
# iptables
12
iptables -A INPUT -p tcp --dport xxxx -j ACCEPT
13
service iptables save
14
systemctl enable iptables

一键安装 File2Ban

Terminal window
1
# 安装
2
wget https://raw.githubusercontent.com/FunctionClub/Fail2ban/master/fail2ban.sh
3
bash fail2ban.sh
4
# 卸载
5
wget https://raw.githubusercontent.com/FunctionClub/Fail2ban/master/uninstall.sh
6
bash uninstall.sh

Brook 中转

Terminal window
1
wget -N --no-check-certificate https://zhujiget.com/wp-content/uploads/2020/brook-pf.sh && chmod +x brook-pf.sh && ./brook-pf.sh

添加 Swap 分区

Terminal window
1
wget https://www.moerats.com/usr/shell/swap.sh && bash swap.sh

buyvm 挂载存储块

Terminal window
1
# 查询存储块ID
2
ls /dev/disk/by-id/
3
# 格式化硬盘
4
mkfs.ext4 -F /dev/disk/by-id/scsi-0BUYVM_SLAB_VOLUME-xxxx
5
# 创建挂载点
6
mkdir /mnt/pan
7
# 挂载硬盘
8
mount -o discard,defaults /dev/disk/by-id/scsi-0BUYVM_SLAB_VOLUME-xxxx /mnt/pan
9
# 开机自动挂载
10
echo '/dev/disk/by-id/scsi-0BUYVM_SLAB_VOLUME-xxxx /mnt/pan ext4 defaults,nofail,discard 0 0' | sudo tee -a /etc/fstab

一键查询主机是否解锁 Netflix

Terminal window
1
bash <(curl -L -s https://raw.githubusercontent.com/lmc999/RegionRestrictionCheck/main/check.sh)
◀ 盘点不怎么熟悉但十分有趣的html标签 项目是怎么一步一步变复杂的 ▶
Author

Spencer Woo

阿巴阿巴 o((>ω< ))o