准备一台虚拟机,debian 12系统,2C4G32GB尺寸。
2024-02-21T01:57:47.png

释放公钥

mkdir -p ~/.ssh/
touch ~/.ssh/authorized_keys
cat <<'EOF'> ~/.ssh/authorized_keys 
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQCsFITm4ITWJPBvnD4pzVQQ7+gumY//IjWo2V8ciU+1Rzfv4IjYh25yPv0K6pf06JGtHyOGTkPzIWx85wtuNZ96cst6hjfzw7pp2IVy31DBPae6lMLhylZxrYmg8KAZE6msR1QKE4J3d8qFvyQWhOVcOF6gv5d5NPKR0vcQbOFtdAxoLGZE1/x3BXjCeb4IXA+bnXPgwB01a+cNEg8kLnt74DvoJU+aS2iX90hKOrMQ1yLzpoA0gHE38yJ9E2DfA5b6NiNcJU8r5wonWz9U08ztYTjsK1SAHSgXd5xgUlW2ImYASuxTznXIF9ehInCPxk/Khw6zKp2TaDnZUWojS1D5iEug0e+wVeuBtIMQdnHtNQtolKBzPmcSyr+SAGKdUU+y1oF6L9N4Ilu/Y1xUYfRP8s/qPUr8NBVkTyPiKslZKUeSVtn3hw5+FFR9ieKpvDinLizhkP/KWN2fKlQOjWHyB1ln4c00BjMc7HHCBioV+fN5YecFbIF82Wdr6p/XMVU= jacky
EOF

配置软件仓库

cat <<'EOF'>/etc/apt/sources.list
deb http://mirrors.ustc.edu.cn/debian stable main contrib non-free non-free-firmware
deb http://mirrors.ustc.edu.cn/debian stable-updates main contrib non-free non-free-firmware
EOF

设置时区

rm -f /etc/localtime ; ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

配置时间同步

apt install -y chrony
systemctl enable chrony
systemctl restart chrony
systemctl status chrony

安装基本软件

apt install -y tar curl wget telnet rsync iftop dstat sysstat lrzsz net-tools traceroute tcpdump tshark bind9-dnsutils git-lfs git 

安装docker

echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

or

curl -fsSL https://get.docker.com -o get-docker.sh
sudo DOWNLOAD_URL=https://mirrors.ustc.edu.cn/docker-ce sh get-docker.sh

# /etc/docker/daemon.json
{
  "debug": false,
  "experimental": true,
  "registry-mirrors": [ "https://docker.oplab.net"],
  "log-opts":{"max-size":"100m","max-file":"1"}
}

安装docker-compose

wget "https://ghproxy.sddts.cn/https://github.com/docker/compose/releases/download/v2.15.1/docker-compose-linux-x86_64" -O /bin/docker-compose
chmod a+x /bin/docker-compose

安装wireguard

apt install -y wireguard

部署文件,start文件

最后修改:2024 年 05 月 11 日
如果觉得我的文章对你有用,请随意赞赏