Centos 7 Linux 安装远程桌面
用 XShell 或 SSH Secure Shell Client 连接 Linux 服务器只能运行在纯命令模式,但有时候还是需要在图形界面做一些操作,比如用NetBean IDE去调试代码。Centos 安装个 xrdp就可以在windows 下远程桌面了,前提是 Centos 已安装了图形界面。
一、Centos 7 配置远程服务
// 要安装xrdp,需要配置repo,这里用的是阿里云的镜像
wget -O /etc/yum.repos.d/epel-aliyun.repo http://mirrors.aliyun.com/repo/epel-7.repo
// 安装 xrdp
yum install -y xrdp
// 如果需要修改 xrdp的配置,使用默认配置就好了
vim /etc/xrdp/xrdp.ini
// 启动 xrdp 服务
systemctl start xrdp
// 查看 xrdp 服务是否运行
systemctl status xrdp
// 设置开机运行 xrdp 服务
systemctl enable xrdp
// 防火墙开启远程桌面的 3389端口
firewall-cmd --zone=public --add-port=3389/tcp --permanent
firewall-cmd --reload
firewall-cmd --list-ports | grep 3389
二、Windows 远程连接 Centos
Win + R 组合键 运行 mstsc:
输入 Centos 服务器的 IP地址:
输入服务器的用户名和密码登录:
OK: