# 查询是否已经安装epel
sudo rpm -qa | grep epel

# 安装epel
sudo yum install epel-release -y

# 安装tigervnc-server
sudo yum install tigervnc-server -y

# 安装xrdp
sudo yum install xrdp -y

# 为用户root设置VNC密码
sudo vncpasswd root

# 配置xrdp
sudo vim /etc/xrdp/xrdp.ini

# 开放3389端口
sudo firewall-cmd --permanent --zone=public --add-port=3389/tcp
sudo firewall-cmd --reload
sudo firewall-cmd --zone=public --query-port=3389/tcp

# 设置xrdp开机自启
sudo systemctl enable xrdp

# 启动xrdp服务
sudo systemctl start xrdp

# 停止xrdp服务
sudo systemctl stop xrdp