Debian 13安装配置手册
本文适用于Debian 12、13系统安装完毕后进行初始化配置时使用。
安装手册
暂无
配置手册
允许root远程登录
编辑ssh配置文件:nano /etc/ssh/sshd_config
找到PermitRootLogin修改yes:
PermitRootLogin yes
重启ssh:systemctl restart sshd
修改root终端配置文件
此项修改以后可为root用户的终端命令添加上颜色
复制普通用户配置文件:cp /home/fm/.bashrc /root/.bashrc
编辑root用户配置文件:nano /root/.bashrc
export PATH=/usr/bin:/usr/sbin:/bin:/sbin:/usr/local/bin
修改为静态IP
nano /etc/network/interfaces
auto enp0s3
iface enp0s3 inet static
address 192.168.1.99
netmask 255.255.255.0
gateway 192.168.1.1
dns-nameservers 119.29.29.29 223.5.5.5
119.29.29.29为腾讯旗下DNSPod Public DNS
223.5.5.5为阿里公共DNS
重启网络:/etc/init.d/networking restart
修改镜像源
Debian 13镜像源
编辑镜像文件:/etc/apt/sources.list.d/debian.sources
Types: deb URIs: http://mirrors.ustc.edu.cn/debian Suites: trixie trixie-updates Components: main contrib non-free non-free-firmware Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg Types: deb URIs: http://mirrors.ustc.edu.cn/debian-security Suites: trixie-security Components: main contrib non-free non-free-firmware Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
Debian 12镜像源
编辑镜像文件:nano /etc/apt/sources.list
# 默认注释了源码仓库,如有需要可自行取消注释 deb http://mirrors.ustc.edu.cn/debian bookworm main contrib non-free non-free-firmware # deb-src http://mirrors.ustc.edu.cn/debian bookworm main contrib non-free non-free-firmware deb http://mirrors.ustc.edu.cn/debian bookworm-updates main contrib non-free non-free-firmware # deb-src http://mirrors.ustc.edu.cn/debian bookworm-updates main contrib non-free non-free-firmware # backports 软件源,请按需启用 deb http://mirrors.ustc.edu.cn/debian bookworm-backports main contrib non-free non-free-firmware # deb-src http://mirrors.ustc.edu.cn/debian bookworm-backports main contrib non-free non-free-firmware deb http://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware # deb-src http://mirrors.ustc.edu.cn/debian-security/ bookworm-security main contrib non-free non-free-firmware
安装基础软件
apt install openssh-server sudo tree wget gnupg gnupg1 gnupg2 apt-transport-https ca-certificates net-tools unzip curl git screen vim sysstat btop ranger iftop -y
btop为服务器资源占用可视化查看工具
ranger为快速文件管理工具
修改内存配置及关闭ipv6
此项配置目的为优先使用物理内存而不是swap
nano /etc/sysctl.conf
vm.swappiness=0 net.ipv6.conf.all.disable_ipv6 = 1 net.ipv6.conf.default.disable_ipv6 = 1
使配置生效:sysctl -p