xrdp---远程桌面连接
xrdp is an Open Source Remote desktop Protocol server, which allows you to RDP to your Linux server from Windows machine; it is capable of accepting connections from rdesktop, freerdp, and remote desktop clients. This how to will help you to setup xrdp server on CentOS 7 / RHEL 7.
Prerequisites:
1. This was written when xrdp is available neither on CentOS repositories nor on EPEL repository, after a lot of Google search; i found desktop repository (http://li.nux.ro/) which was having xrdp for CentOS 7 / RHEL 7. We need to manually setup the repository on CentOS 7.
2. Don’t forget to install Gnome on CentOS 7
Automatic (recommended):
Install EPEL and nux Desktop repository rpms.
# rpm -Uvh https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm # rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-1.el7.nux.noarch.rpm |
Manual:
Create a repository file.
# vi /etc/yum.repos.d/xrdp.repo |
Place the following content. Once added, save and close the file.
[xrdp] name=xrdp baseurl=http://li.nux.ro/download/nux/dextop/el7/x86_64/ enabled=1 gpgcheck=0 |
Installation:
Issue the following command to install xrdp
# yum -y install xrdp tigervnc-server |
You will get the following output, make sure you are getting package from the newly created repository.
--> Running transaction check ---> Package xrdp.x86_64 0:0.6.1-2.el7.nux will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: xrdp x86_64 0.6.1-2.el7.nux xrdp 271 k Transaction Summary ================================================================================ Install 1 Package Total download size: 271 k Installed size: 1.5 M Is this ok [y/d/N]: y Downloading packages: xrdp-0.6.1-2.el7.nux.x86_64.rpm | 271 kB 00:05 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : xrdp-0.6.1-2.el7.nux.x86_64 1/1 Verifying : xrdp-0.6.1-2.el7.nux.x86_64 1/1 Installed: xrdp.x86_64 0:0.6.1-2.el7.nux |
Once it is installed, lets start the xrdp service.
# systemctl start xrdp.service |
xrdp will listen on 3389, lets confirm this by issuing following command.
# netstat -antup | grep xrdp tcp 0 0 0.0.0.0:3389 0.0.0.0:* LISTEN 1508/xrdp tcp 0 0 127.0.0.1:3350 0.0.0.0:* LISTEN 1507/xrdp-sesman |
By default, services wont auto start after system reboot. Issue the following command to enable the service at system start up.
# systemctl enable xrdp.service |
Next is to create iptables rule to allow rdp connection from the external machines, following command will add the exception for rdp port (3389).
# firewall-cmd --permanent --zone=public --add-port=3389/tcp # firewall-cmd --reload |
Configure SELinux
# chcon --type=bin_t /usr/sbin/xrdp # chcon --type=bin_t /usr/sbin/xrdp-sesman
Test:
Now take rdp from any windows machine using Remote Desktop Connection, enter ip address of Linux server in computer field and click on connect.
CentOS 7 – xrdp MSTSC
You would be asked to enter the user name and password, you can either use root or any user that you have it on system. Make sure you use module “sesman-Xvnc”.
CentOS 7 – xrdp Login page
If you click ok, you will see the processing. In less than a half min, you will get a desktop.
CentOS 7 – xrdp Desktop
That’s All, you have successfully configured xRDP on CentOS 7 / RHEL 7. We welcome your comments.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)