XRDP(http://www.xrdp.org/)is an open source RDP server for X11 and it present a GUI screen to remote user by using remote desktop protocol.
If we want to connect it from Windows platform to XRDP, the XRDP have to add Xvnc or X11rdp package so that it can display a Windows desktop to Windows user by Microsoft remote desktop client.
How to build it? The following process will descript it roughly.
At first, we have to install some package as follows for compiling the XRDP package laterand also install X.Org X11 libXrandr development package (# 1)
Install VNC Server packageIf we don’t have a vncserver package installed on this host, we have to install it by using the yum command
Install GNOME X Window System
For adding the GNOME Desktop environment to the CentOS Minimal platform, we have to use the yum groupinstall “X Window System” “Desktop” “Fonts” command (# 2)
Assign VNC Permission
In Linux environment, we will choose one normal account as davidwa and supper account as root for delegating the individual VNC permission.
For assigning VNC User privilege, we have to switch the current logon session to another user as davidwa account. Once the user has already existed (# 3), we will set the password used to access VNC server by using the vncpasswd command.So does that the password file name will be to $HOME/.vnc/passwd by default.
Configure & Start VNC ServerIf the single user will log on this VNC Server remotely, we will make the following change at the end of the /etc/sysconfig/vncservers file.If the multi-user will log on it, the file will be changed as followsWhen the vnc user has a vnc password (# 4) and the /etc/sysconfig/vncservers file is configured correctly, we can start the VNC service by using the service vncservers start command.
Install XRDP Server
To download and extract the newest xrdp-master.zip from https://github.com/FreeRDP/xrdp or get the related file by using git clone git://github.com/FreeRDP/xrdp.git command
If we download it by git method, we will go to the xrdp subfolder next to run the bootstrap command (# 5)configure commandmake commandmake install commandSo do that we have already finish installing the XRDP process.
Configure & Start XRDP Server
To create two groups as ts-users and ts-admins for assigning the normal permission to the specific account.also need to map these groups to TerminalServerUsers & TerminalServerAdmins in the /etc/xrdp/sesman.ini file
To confirm Xvnc listening port 5901 by using the netstat -tunlp | grep Xvnc commandcorrect port=5901 in the [xrdp2] content of the /etc/xrdp/xrdp.ini file (# 6)Now we will start the Xrdp daemon by using /etc/xrdp/xrdp.sh start command
Change firewall Rule
To edit the iptables rule for adding the port 3389 to the INPUT list by using the iptables -I INPUT -p tcp -m state --state NEW -m tcp --dport 3389 -j ACCEPT commandDon’t forget to save the iptables rule and restart it for applying the new rule right now.
Test Xrdp from Windows platform
Before using Remote Desktop Connection from Windows platform, please confirm whether the remote desktop has already been enabled in the CentOS platform.
If no, open a terminal next to type the following commandOnce the above procedure complete, we can use RDP client to connect to XRDP server. When the XRDP login windows show up, we need to change the sesman-Xvnc module and enter the username as davidwa and password.If the authentication pass, the desktop will show up in a few seconds.
Reference:
(# 1). If no exit this package, it will fail to do make process for XRDP later.(# 2). If we want to switch boot mode from CLI to GUI, we have to change some value id:5:initdefault: in the /etc/inittab file as follow: (# 3). If the Linux user does not exist, we can create it by using the useradd command and set the password by using the passwd command (# 4). If the vnc user has no a vnc password, the VNC service will not be started.
(# 5). If there is no execution right in these files as bootstrap and configure , we have to assign it by using the chmod u+x bootstrap and chmod u+x configure command(# 6). If the port number is not correct, maybe we will get the following error message
沒有留言:
張貼留言