-
Notifications
You must be signed in to change notification settings - Fork 6
Windows 通过远程桌面连接 CentOS GUI #97
Copy link
Copy link
Closed
Labels
ServerThe invisible heroThe invisible heroSoftwareAbout installation ande usageAbout installation ande usage
Description
整体流程
完整的流程如下:
CentOS 安装 GNOME Desktop
参考链接:How to install Desktop Environments on CentOS 7?
因为学校服务器在安装 CentOS 时预装了 GUI,所以省去了这一步。
注意:在终端执行 systemctl get-default,如果输出的结果是 graphical.target,说明 CentOS 是启动至 GUI 界面,Windows 可以直接远程桌面连接,无需额外配置。否则还需要执行 sudo systemctl set-default graphical.target,保证 CentOS 启动至 GUI 界面,而不是默认的 Shell。
CentOS 安装 xRDP
在 CentOS 终端依次执行以下命令,来安装并启动 xRDP:
$ yum install epel-release
$ yum install xrdp
$ systemctl enable xrdp
$ systemctl start xrdp
$ systemctl status xrdp # 查看 xRDP 运行状态,确保操作成功CentOS 开启 3389 端口
在 CentOS 终端依次执行以下命令:
$ firewall-cmd --add-port=3389/tcp
$ firewall-cmd --reload
$ firewall-cmd --list-all # 查看已开放端口,确保操作成功CentOS 启动 GUI
在 CentOS 终端执行 startx,来启动 GNOME Desktop GUI。
Windows 通过远程桌面连接 CentOS
在 Windows 上打开远程桌面连接,输入 CentOS 的 IP 和用户名,并按照提示输入密码,即可连接到 CentOS 的 GUI。
## CentOS 关闭 3389 端口
每次远程桌面操作完成后,在 CentOS 终端依次执行以下命令,关闭 3389 端口:
```shell
$ firewall-cmd --remove-port=3389/tcp
$ firewall-cmd --reload
$ firewall-cmd --list-all # 查看已开放端口,确保操作成功
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
ServerThe invisible heroThe invisible heroSoftwareAbout installation ande usageAbout installation ande usage