Install xrdp on CentOS 7 / RHEL 7

https://blog.csdn.net/u014447845/article/details/80291678?utm_medium=distribute.pc_relevant_download.none-task-blog-2~default~blogcommendfrombaidu~default-1.nonecase&dist_request_id=1331645.10905.16183974899996483&depth_1-utm_source=distribute.pc_relevant_download.none-task-blog-2~default~blogcommendfrombaidu~default-1.nonecas

 

https://www.itzgeek.com/how-tos/linux/centos-how-tos/install-xrdp-on-centos-7-rhel-7.html

summarize and expand on this thread for anyone else reading this, who is trying to get an alternative desktop working on a fresh install of the latest CentOS 7. The webpage you linked to is pretty good, but it's missing some small details like SELinux support and the need for xorgxrdp. I've also added some of my own sysadmin experiences.

At the time of writing, the following versions apply:-

SoftwareVersion
CentOS7.7
xrdp RPM0.9.11-5
xorgxrdp RPM0.2.11-1
  • Ensure the OS is up to date with sudo yum update

  • Install EPEL repository with sudo yum install epel-release

  • Install and enable XRDP with:-

    sudo yum install xrdp
    sudo systemctl enable --now xrdp
    sudo systemctl enable --now xrdp-sesman
    
  • If you're using the firewall, allow external access to TCP port 3389 with:-

    sudo firewall-cmd --add-port=3389/tcp --permanent
    sudo firewall-cmd --reload
    
  • If you're using SELinux, sudo yum install xrdp-selinux

  • If you want to use the Xorg backend in addition to (or instead of) the Xvnc backend, do the following. The differences between the two backends are covered elsewhere.

    • sudo yum install xorgxrdp
    • Edit /etc/xrdp/xrdp.ini. If the [Xorg] section is commented out, uncomment it.
    • If you changed xrdp.inisudo systemctl restart xrdp to pick up the changes.
  • Install your desktop(s), making sure that you use a command to install the whole desktop rather than a subset of it. This will probably be a yum groupinstall command. For example, for MATE, use sudo yum groupinstall "MATE Desktop".

  • The default desktop for XRDP on CentOS 7 is GNOME. If you want the default desktop for all XRDP users to be something else, create the file /etc/sysconfig/desktop and set the PREFERRED variable to the command to start the desktop. For example, this /etc/sysconfig/desktop sets the default desktop to MATE for all XRDP users:-

    # This file is read by /etc/X11/xinit/Xclients if the user does not
    # override it - see /etc/X11/xinit/Xsession for details
    
    # Set the default desktop for all users
    PREFERRED=mate-session
    
  • XRDP users who want to use a desktop other than the default will need to soft-link the command to start the correct session in to ~/.xsession or ~/.Xclients . For MATE, this command is adequate:-

    ln -sf /usr/bin/mate-session ~/.xsession
    

    As an aside, some websites suggest creating a vanilla file ~/.xsession containing the command to start the desktop. That's OK too, but you have to remember to make the file executable. The soft-link method avoids this pitfall.

That should get the desktop running. Here are a couple of gotchas:-

  • Some desktops expect GDM to be running to provide some of their functionality over DBUS. For example, the GNOME lock screen is implemented in GDM. If you're using one of these desktops you may need to enable GDM on the machine console (if it isn't enabled already):-
    sudo yum install gdm xorgxrdp xrdp-selinux  //必须要
    sudo systemctl set-default graphical
    sudo systemctl isolate graphical
    
  • When using the Xvnc backend, you may need to set the colour depth on the client to 24 or 32 if the desktop, or the applications require mesa 3D support. The Xorg backend always runs at a suitable colour depth.

I think that's it, but please let me know if I've left anything out.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值