王海庆的云笔记

CentOS安装XRDP(远程桌面)


关闭防火墙

systemctl stop firewalld
systemctl disable firewalld
sed -i -e  's/^SELINUX=.*/SELINUX=disabled/g' /etc/selinux/config
setenforce 0


换成阿里云的源

rm -rf /etc/yum.repos.d/*
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
curl -o /etc/yum.repos.d/epel.repo https://mirrors.aliyun.com/repo/epel-7.repo

yum clean all
yum makecache fast -y


安装

yum groupinstall -y "X Window System"
yum groupinstall -y "GNOME Desktop"

yum install -y xrdp

systemctl start  xrdp
systemctl enable xrdp
systemctl status xrdp


设置默认启动为图形界面(非必须)

# 安装完成后,修改默认启动方式为图形化界面
systemctl set-default graphical.target  # 设置成图形模式 

# 如果要换回来 
systemctl set-default multi-user.target  # 设置成命令模式 


如果修改端口,并重启服务

vi /etc/xrdp/xrdp.ini
port=3389


通过Windows 的远程连接终端,连接远程桌面(172.18.0.117)

文章最后更新时间: 2021-12-28 00:01:02