温馨提示×

怎样配置debian sedebian

小樊
40
2026-10-02 03:32:38
栏目: 智能运维

你是想问 如何配置 Debian(或基于 Debian 的衍生系统,比如 Ubuntu / 深度 / Kali 等),还是特指 SED Debian(Security Enhanced Debian,或某个定制版)?

下面我分两种情况说明,你看看哪一个是你需要的。


一、普通 Debian 系统的基础配置(最常见)

1. 配置网络

DHCP(自动获取 IP)

sudo systemctl enable networking
sudo systemctl start networking

静态 IP(Debian 12 推荐使用 netplan 或 /etc/network/interfaces)

sudo nano /etc/network/interfaces

示例:

auto eth0
iface eth0 inet static
    address 192.168.1.100
    netmask 255.255.255.0
    gateway 192.168.1.1
    dns-nameservers 8.8.8.8

重启网络:

sudo systemctl restart networking

2. 配置软件源(apt)

sudo nano /etc/apt/sources.list

国内常用(清华源):

deb https://mirrors.tuna.tsinghua.edu.cn/debian bookworm main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main

更新:

sudo apt update
sudo apt upgrade

3. 创建普通用户并配置 sudo

adduser yourname
usermod -aG sudo yourname

4. 开启 SSH

sudo apt install openssh-server
sudo systemctl enable ssh
sudo systemctl start ssh

5. 防火墙(可选)

sudo apt install ufw
sudo ufw allow 22
sudo ufw enable

二、如果你说的是 SED Debian(安全增强 Debian)

如果你指的是 SED = Security-Enhanced Debian,一般配置会额外包括:

1. 启用 AppArmor / SELinux

Debian 默认用 AppArmor:

sudo apt install apparmor apparmor-utils
sudo systemctl enable apparmor

2. 最小化安装 + 服务审计

sudo apt install lynis
sudo lynis audit system

3. 强制 SSH 安全配置

sudo nano /etc/ssh/sshd_config

建议:

PermitRootLogin no
PasswordAuthentication no

三、请你补充一下

你可以直接告诉我:

  • 是 Debian 服务器 还是 桌面
  • 是 普通 Debian 还是 某个定制版(SED / 国产 / 教学版)
  • 你想“配置”的是:网络 / 源 / 安全 / 服务 / 自动化

我可以给你 一步步命令级配置方案。

0 踩