Debian13系统安装

安装类型

安装语言环节

网络配置

创建用户

磁盘分区

创建主分区

创建逻辑分区

配置软件包管理器

设置静态IP

bash 复制代码
ip a # 查看ip
bash 复制代码
cp -rf /etc/network/interfaces /etc/network/interfaces_back # 【ROOT用户下】备份网络接口配置文件
bash 复制代码
nano /etc/network/interfaces # 【ROOT用户下】编辑网络接口配置信息
auto ens33  #开机自启   
allow-hotplug ens33 #开启配置热生效   
iface ens33 inet static          
address 192.168.105.188 #静态IP地址
netmask 255.255.255.0 #子网掩码    
gateway 192.168.105.2 #子网掩码
bash 复制代码
nano /etc/resolv.conf # 【ROOT用户下】配置DNS
nameserver 192.168.105.2
nameserver 8.8.8.8
bash 复制代码
systemctl restart networking.service # 重启网络服务

配置镜像

  • Debian13可能使用传统的/etc/apt/sources.list,也可能使用新 DEB822 格式 /etc/apt/sources.list.d/debian.sources
bash 复制代码
# A:如果是【/etc/apt/sources.list】则追加如下
cp -rf /etc/apt/sources.list /etc/apt/sources.list.back # 【ROOT用户下】备份历史数据
nano /etc/apt/sources.list # 【ROOT用户下】替换为如下内容
deb 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 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
bash 复制代码
# B:如果使用的是 /etc/apt/sources.list.d/debian.sources(DEB822 格式)
# 将 http://deb.debian.org/debian 替换为 https://mirrors.tuna.tsinghua.edu.cn/debian

修复 DNS 配置

bash 复制代码
nano /etc/resolv.conf #【ROOT用户下】追加如下内容
nameserver 223.5.5.5
nameserver 119.29.29.29
bash 复制代码
ping -c 3 mirrors.tuna.tsinghua.edu.cn # 验证解析是否恢复
bash 复制代码
apt update #【ROOT用户下】更新软件包索引

配置防火墙

  • Debian13 默认没有启用任何防火墙服务,网络流量默认处于全部放行的状态。不过其系统底层默认使用的防火墙框架是 nftables
  • 虽然框架是 nftables,但 Debian 的默认安装并不会自动加载一套限制性的防火墙规则。除非你手动安装并启用了 nftables 服务或配置了规则,否则系统不会对网络流量进行任何过滤
  • 如果不想引入额外工具,可以直接管理 nftables。Debian 默认的规则文件位于 /etc/nftables.conf
bash 复制代码
apt install nftables # 【ROOT用户下】安装/升级nftables
systemctl enable nftables && systemctl restart nftables
bash 复制代码
systemctl status nftables

打开或关闭端口

  • 不用 UFW 的话,在 Debian 13 上主要有两个成熟的选择:直接使用 nftables(系统默认底层框架),或者使用 firewalld(另一个管理前端)。它们的关系和适用场景不太一样
  • nftables:性能最好,规则表达能力强,是 Debian 官方推荐的新防火墙构建方式。缺点:需要自己写规则文件,语法相对底层
bash 复制代码
nano /etc/nftables.conf #【ROOT用户下】编辑配置文件并写入你的放行和拒绝规则
systemctl restart nftables

查看端口监听列表

bash 复制代码
apt install net-tools # 【ROOT用户下】安装netstat
lsof -i :80 # 【ROOT用户下】查看80端口监听列表
bash 复制代码
ss -tulnp # 【ROOT用户下】
-t:显示 TCP 端口
-u:显示 UDP 端口
-l:仅显示处于监听状态的端口
-n:以数字形式显示端口号(不解析为服务名,速度更快)
-p:显示占用端口的进程名和 PID(需 sudo 权限才能看到其他用户的进程)
相关推荐
女神下凡4 小时前
芯易选(133):建荣(AppoTech)_开发指南
linux·arm开发·stm32·单片机·嵌入式硬件
JWIPC6 小时前
MyClaw 3.0 自动化数据采集实战指南
linux·运维·笔记·科技·深度学习·物联网·自动化
Flynt6 小时前
自托管重开实录:照 HN 419 分热帖让 AI 从零搭一遍,15 分钟踩了三个真坑
linux·开源·ai编程
EmbeddedChen8 小时前
Linux 怎么查看 IP 地址和网络状态?常用网络命令入门
linux·网络·ip·route·ping
爱和冰阔落9 小时前
【Linux网络】GET 和 POST 真的只是参数位置不同吗?从 HTTP 请求方法、抓包分析到长连接与路由实战
linux·c++·http·网络编程·get与post
无足鸟ICT9 小时前
【RHCA+】_proc_pid_attr_exec
linux·运维·服务器
牙牙7059 小时前
接口一直超时,后端却查不出问题:TIME_WAIT 把本地端口耗尽了
linux·网络·tcp·连接池·故障排查·time_wait
智商偏低10 小时前
创建的 conda 环境如何迁移到领一个离线电脑上,后面随着开发需要往离线电脑上拷贝包
linux·人工智能·conda
Johny_Zhao21 小时前
Keepalived与Nginx架构选型
linux·nginx·信息安全·云计算·apache·shell·yum源·keepalive·系统运维
FlightYe1 天前
linux系统编程(二十一):C 语言常见坑
android·linux·运维·服务器·c语言·音视频