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安装命令
修改访问地址,用户名和密码























