修改IP地址
1、修改时区 😄
sudo timedatectl set-timezone Asia/Shanghai2、编辑配置文件
sudo nano /etc/network/interfaces按如下参考修改
# The loopback network interfaceauto loiface lo inet loopback# 主网卡 - 改成静态IPauto ens3 # 改成你的网卡名iface ens3 inet staticaddress 192.168.10.123 netmask 255.255.255.0 gateway 192.168.10.1 dns-nameservers 8.8.8.8 114.114.114.114 223.5.5.5Ctrl+O→Enter→Ctrl+X保存
3、重启网络服务
sudo systemctl restart networking开启root账户登录
# 用普通用户登录后sudo nano /etc/ssh/sshd_config# 找到这行(或加进去)PermitRootLogin yes # 改成 yes# 或 PermitRootLogin prohibit-password → 只允许密钥,不允许密码
# 保存后重启sshsudo systemctl restart ssh修改apt源为国内源
1、先备份
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak2、清空并写入阿里云apt源
sudo tee /etc/apt/sources.list << 'EOF'deb https://mirrors.aliyun.com/debian/ bookworm main contrib non-free non-free-firmwaredeb-src https://mirrors.aliyun.com/debian/ bookworm main contrib non-free non-free-firmwaredeb https://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free non-free-firmwaredeb-src https://mirrors.aliyun.com/debian-security/ bookworm-security main contrib non-free non-free-firmwaredeb https://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free non-free-firmwaredeb-src https://mirrors.aliyun.com/debian/ bookworm-updates main contrib non-free non-free-firmwaredeb https://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free non-free-firmwaredeb-src https://mirrors.aliyun.com/debian/ bookworm-backports main contrib non-free non-free-firmwareEOF3、更新索引
sudo apt update为系统添加http代理(可选)
sudo nano /etc/environment
http_proxy="http://192.168.1.100:7890"https_proxy="http://192.168.1.100:7890"no_proxy="localhost,127.0.0.1,::1"改完后要么重启终端,要么source ~/.bashrc立即生效。