Debian安装后修改
在初次完成debian的安装后,需要做一些修改让系统更顺手,以下是常做的一些修改
修改静态IP
查看IP地址及网卡
ip addr修改配置文件
sudo nano /etc/network/interfaces
auto 网卡名
iface 网卡名 inet static
address IP地址/掩码
network 网段
broadcast 广播地址
gateway 网关
dns-nameservers DNS保存并关闭文件,然后重新启动网络服务
sudo systemctl restart networking.service修改ssh远程登录
debian安装后默认不允许root远程,可以修改/etc/ssh/sshd_config文件来解决
sudo nano /etc/ssh/sshd_config
#找到以下字样
PermitRootLogin yes
PasswordAuthentication yes保存并关闭文件,然后重新启动ssh服务
sudo systemctl restart ssh.service修改国内镜像源
debian默认的镜像源在国外,国内连接不上或速度很慢,需要配置国内镜像源进行加速,通常修改/etc/apt/sources.list文件
以清华源为例
Debian12
sudo nano /etc/apt/sources.list
注释源码镜像并修改清华源
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib
# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb https://security.debian.org/debian-security bookworm-security main contrib
# deb-src https://security.debian.org/debian-security bookworm-security main contribDebian13
sudo nano /etc/apt/sources.list
# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie-updates main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie-updates main contrib non-free non-free-firmware
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie-backports main contrib non-free non-free-firmware
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ trixie-backports main contrib non-free non-free-firmware
# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换
deb https://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmware
# deb-src https://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmware保存并关闭文件,更新软件源
sudo apt update
本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 ayaya
评论
匿名评论
隐私政策
你无需删除空行,直接评论以获取最佳展示效果