在 CentOS Minimal(最小化安装)环境下,默认通常没有图形界面,也没有开启远程桌面,一般通过 SSH 远程命令行 来管理。下面按常见需求说明。
CentOS Minimal 有时默认没装 openssh-server:
rpm -qa | grep openssh
如果没有,安装:
yum install -y openssh-server
systemctl start sshd
systemctl enable sshd
ip addr
或
hostname -I
ssh 用户名@服务器IP
例如:
ssh root@192.168.1.100
⚠️ 注意:
firewall-cmd --permanent --add-service=ssh
firewall-cmd --reload
CentOS Minimal 没有 GUI,如果要远程桌面:
yum groupinstall -y "GNOME Desktop"
yum install -y tigervnc-server
然后配置 VNC(较复杂,不推荐服务器用)。
如安装 Cockpit:
yum install -y cockpit
systemctl enable --now cockpit.socket
浏览器访问:
https://IP:9090
scp file.txt user@ip:/path/
| 需求 | 推荐方式 |
|---|---|
| 日常管理 | ✅ SSH |
| 文件传输 | ✅ SCP / SFTP |
| 图形界面 | ❌ 不建议 Minimal |
| Web 管理 | ✅ Cockpit |
如果你告诉我:
我可以给你更精确的命令。