ubuntu20.04系统dd成debian11并安装xray

概述

甲骨文的ubuntu20.04升级成debian11

ubuntu20.04 1.4G 大
debian11 400MB 小

#更新apt源
apt-get update
#安装需要的工具包
apt-get install -y xz-utils openssl gawk file


bash <(wget --no-check-certificate -qO- 'https://moeclub.org/attachment/LinuxShell/InstallNET.sh') -d 11 -v 64 -a -firmware -p "root密码"
apt-get install -y nginx curl tar net-tools iftop

大约等20多分钟, 如果失败, 请删除重开

timedatectl set-timezone Asia/Shanghai
# 设置hostname
#hostnamectl set-hostname aaa

# 配置authorized_keys
ssh-keygen

# 安装工具
apt-get install -y nginx curl tar net-tools iftop
# ./tcp.sh
# ./superbench.sh

## 安装xray
bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ install -u root --version 1.5.3
# 删除xray
# bash -c "$(curl -L https://github.com/XTLS/Xray-install/raw/main/install-release.sh)" @ remove

cp config.json /usr/local/etc/xray/config.json

#创建你的网站目录
mkdir /home/www/nideyuming.com
vim /etc/nginx/site-enable/default
    root /home/www/nideyuming.com
systemctl restart nginx

#防火墙, debian可忽略
#iptables -L
#sudo iptables -F

安装证书
curl https://get.acme.sh | sh
~/.acme.sh/acme.sh --register-account -m [email protected]
~/.acme.sh/acme.sh  --issue  -d nideyuming.com --webroot /home/www/nideyuming.com/
mkdir /usr/local/etc/xray/cert
~/.acme.sh/acme.sh --installcert -d nideyuming.com --key-file /usr/local/etc/xray/cert/private.key --fullchain-file /usr/local/etc/xray/cert/cert.crt
~/.acme.sh/acme.sh --upgrade --auto-upgrade
chmod -R 755 /usr/local/etc/xray/cert

systemctl restart xray
systemctl restart nginx
# 查看日志
journalctl -u xray --output cat -f

#配置cfw