# Rocky Linux 9 DVD ISOwget https://mirrors.tuna.tsinghua.edu.cn/rocky/9/isos/x86_64/Rocky-9-latest-x86_64-dvd.iso# AlmaLinux 9 DVD ISOwget https://mirrors.tuna.tsinghua.edu.cn/almalinux/9/isos/x86_64/AlmaLinux-9-latest-x86_64-dvd.iso# Fedora Server DVD ISOwget https://mirrors.tuna.tsinghua.edu.cn/fedora/releases/40/Server/x86_64/iso/Fedora-Server-dvd-x86_64-40-1.4.iso# RHEL(需要注册 Red Hat 账号)# https://developers.redhat.com/products/rhel/download
3.2 安装步骤(服务器模式)
1. 启动后选择 "Install Rocky Linux 9.x"
2. 语言: English (United States) (推荐英文,减少 TTY 乱码)
3. Installation Summary 界面配置:
├── Keyboard → English (US)
├── Language Support → 添加简体中文
├── Time & Date → Asia/Shanghai, NTP ON
├── Installation Source → 自动检测(或指定镜像 URL)
├── Software Selection → Server(无 GUI)
│ └── 勾选 "Standard" 和 "System Tools"
├── Installation Destination → 选硬盘,Storage Configuration: Custom
├── Network & Hostname → 设置主机名,开启网卡
├── Root Password → 设置 root 密码
└── User Creation → 创建管理员用户,设为 Administrator
4. 点击 "Begin Installation"
5. 完成后 "Reboot System"
# 备份默认仓库sudo mkdir /etc/yum.repos.d/backupsudo mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup/# 写入清华镜像sudo tee /etc/yum.repos.d/rocky-mirror.repo << 'EOF'[baseos]name=Rocky Linux $releasever - BaseOSbaseurl=https://mirrors.tuna.tsinghua.edu.cn/rocky/$releasever/BaseOS/$basearch/os/gpgcheck=1enabled=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9[appstream]name=Rocky Linux $releasever - AppStreambaseurl=https://mirrors.tuna.tsinghua.edu.cn/rocky/$releasever/AppStream/$basearch/os/gpgcheck=1enabled=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9[extras]name=Rocky Linux $releasever - Extrasbaseurl=https://mirrors.tuna.tsinghua.edu.cn/rocky/$releasever/extras/$basearch/os/gpgcheck=1enabled=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-Rocky-9[epel]name=EPEL for Rocky Linux $releaseverbaseurl=https://mirrors.tuna.tsinghua.edu.cn/epel/$releasever/Everything/$basearch/gpgcheck=1enabled=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-$releaseverEOFsudo dnf makecache
sudo cp /etc/ssh/sshd_config /etc/ssh/sshd_config.baksudo vim /etc/ssh/sshd_config
Port 2222
PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
MaxAuthTries 3
ClientAliveInterval 300
ClientAliveCountMax 2
X11Forwarding no
AllowAgentForwarding no
AllowTcpForwarding no
sudo systemctl restart sshd# SELinux 允许 SSH 使用非标准端口sudo semanage port -a -t ssh_port_t -p tcp 2222
7.2 自动安全更新
# 安装 dnf-automaticsudo dnf install dnf-automatic -y# 配置sudo vim /etc/dnf/automatic.conf