centos7 失去支持,
想要找能够支持时间久一点的系统,
本来想尝试 alibaba cloud linux3, 在尝试的过程中,感觉相关的支持太少,放弃,
随换成 debian12
debian 现在的版本是 13,但是宝塔推荐的还是 12,并且没有关于 13 的兼容情况说明,
所以还是使用 12
腾讯云镜像有 12 的安装包 https://mirrors.cloud.tencent.com/debian-cd/
最小安装 (无图形面板和其他所有附加件)
开启网络
sudo nano /etc/network/interfaces
添加下面内容 (自动获取)
auto eth0
iface eth0 inet dhcp
如果要使用静态的添加下面文件
auto eth0
iface eth0 inet static
address 192.168.1.100 # 你的静态 IP 地址
netmask 255.255.255.0 # 子网掩码
gateway 192.168.1.1 # 网关地址
dns-nameservers 8.8.8.8 114.114.114.114 # DNS 服务器地址,可设置多个
按 Ctrl+X,然后按 Y 确认保存,然后按回车保存为原来的文件名
重启网络服务
sudo systemctl restart networking
测试一下看 OK 了么
ping www.baidu.com
安装 ssh 用来方便使用 putty 操作,可以比较方便的进行指令复制
检测有没有 ssh(应该是没有的)
dpkg -l | grep openssh-server
安装 ssh(要从安装盘里安装,第一个升级指令大概是没用)
sudo apt update
sudo apt install openssh-server
启动 ssh
sudo systemctl start ssh
如果要设置开机启动的话 (最好别这样)
sudo systemctl enable ssh
然后我们来变更源,之前的源的文件里就写了从安装盘更新
先打开源的列表文件
sudo nano /etc/apt/sources.list
把里面从安装盘更新的东西删掉换成中科大的
deb https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware
deb https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
deb-src https://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
按 Ctrl+X,然后按 Y 确认保存,然后按回车保存为原来的文件名
再来试下看可以使用了不
sudo apt update
让我们来安装宝塔使用 ssh 连接服务器
查看 ip 使用
ip addr
我们就不开启 root 的 ssh 了,先用普通用户的进去后 su root
然后粘贴宝塔的 debian 安装命令
修改访问地址,用户名和密码