I had the opportunity to set up a RDP connection for business from Windows to the GUI environment of CentOS. This time, I would like to leave this as knowledge.
Terminal: Windows 10 Pro OS: CentOS7.7
[root@tspshell01 ~]# cat /etc/redhat-release
CentOS Linux release 7.7.1908 (Core)
[root@tspshell01 ~]#
OS installation with "minimal installation"
--The following settings have been completed **-Host name / IP address setting ** ** ・ DNS settings **
--The initial state is directly under "/etc/yum.repos.d"
[root@tspshell01 ~]# ll /etc/yum.repos.d/
32 in total
-rw-r--r--.1 root root 1664 September 5 2019 CentOS-Base.repo
-rw-r--r--.1 root root 1309 September 5 2019 CentOS-CR.repo
-rw-r--r--.1 root root 649 September 5 2019 CentOS-Debuginfo.repo
-rw-r--r--.1 root root 630 September 5 2019 CentOS-Media.repo
-rw-r--r--.1 root root 1331 September 5 2019 CentOS-Sources.repo
-rw-r--r--.1 root root 6639 September 5 2019 CentOS-Vault.repo
-rw-r--r--.1 root root 314 September 5 2019 CentOS-fasttrack.repo
[root@tspshell01 ~]#
--You must be able to connect to the Internet
Click here for the procedure.
** ① Disable the firewall (or open the port) ** ** ② Read repository file ** ** ③ Install GNOME desktop ** ** ④ Install epel repository ** ** ⑤ Install required packages for remote desktop ** ** ⑥ Operation check **
Then, I will explain.
--Firewall disabled / auto-start disabled
・ Firewall stop
systemctl status firewalld
systemctl stop firewalld
systemctl status firewalld
-Disable firewall
systemctl is-enabled firewalld
systemctl disable firewalld
systemctl is-enabled firewalld
--3389 Port open (when firewall is not stopped)
firewall-cmd --permanent --zone=public --add-port=3389/tcp
firewall-cmd --reload
firewall-cmd --list-all
--Clear yum cache
yum clean all
--Reading the file directly under "/etc/yum.repos.d"
yum repolist all
→ Confirm that "base / 7 / x86_64" is valid
yum groupinstall "GNOME Desktop"
** * You will be asked "yes" or "no" just before installation, so execute "y" **
The "epel repository" is used to install "xrdp".
--Install the epel repository directly under "/etc/yum.repos.d"
yum install epel
--Confirm that "epel.repo" is directly under "/etc/yum.repos.d"
[root@tspshell01 yum.repos.d]# ll /etc/yum.repos.d/
36 in total
-rw-r--r--.1 root root 1664 September 5 2019 CentOS-Base.repo
-rw-r--r--.1 root root 649 September 5 2019 CentOS-Debuginfo.repo
-rw-r--r--.1 root root 630 September 5 2019 CentOS-Media.repo
-rw-r--r--.1 root root 1331 September 5 2019 CentOS-Sources.repo
-rw-r--r--.1 root root 6639 September 5 2019 CentOS-Vault.repo
-rw-r--r--.1 root root 314 September 5 2019 CentOS-fasttrack.repo
-rw-r--r--1 root root 1050 October 3 2017 epel-testing.repo
-rw-r--r--1 root root 951 October 3 2017 epel.repo
[root@tspshell01 yum.repos.d]#
--Clear yum cache
yum clean all
--Reading the file directly under "/etc/yum.repos.d"
yum repolist all
--Package installation
yum install tigervnc-server
yum install xrdp
--xrdp service start / automatic start
・ Start xrdp service
systemctl status xrdp
systemctl start xrdp
systemctl status xrdp
・ Xrdp automatic start
systemctl is-enabled xrdp
systemctl enable xrdp
systemctl is-enabled xrdp
--After starting Remote Desktop, enter the IP address and connect (Can be started with "mstsc")
--If the connection is successful, the login screen will be displayed. Enter server username / password
--If you log in successfully, you will see a screen like this.
--Session change --Screen color depth setting
「Xvnc」→「Xorg」
--Configuration file backup
cp -p /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini_`date "+%Y%m%d_%H%M%S"`
--Check file backup
[root@tspshell01 yum.repos.d]# ll /etc/xrdp | grep xrdp
-rw-r--r--1 root root 5427 March 11 19:53 xrdp.ini
-rw-r--r--1 root root 5427 March 11 19:53 xrdp.ini_20200518_223104
-rw-r--r--1 root root 3570 March 11 19:53 xrdp_keyboard.ini
[root@tspshell01 yum.repos.d]#
--File content change
vi /etc/xrdp/xrdp.ini
Before correction
#[Xorg]
#name=Xorg
#lib=libxup.so
#username=ask
#password=ask
#ip=127.0.0.1
#port=-1
#code=20
[Xvnc]
name=Xvnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=-1
#xserverbpp=24
#delay_ms=2000
Revised
[Xorg]
name=Xorg
lib=libxup.so
username=ask
password=ask
ip=127.0.0.1
port=-1
code=20
#[Xvnc]
#name=Xvnc
#lib=libvnc.so
#username=ask
#password=ask
#ip=127.0.0.1
#port=-1
#xserverbpp=24
#delay_ms=2000
→ Setting to display only "Xorg" on the login screen
--Compare with backup file
diff /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini_20200518_223104
Execution result
[root@tspshell01 yum.repos.d]# diff /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini_20200518_223104
181,192c181,183
< [Xorg]
< name=Xorg
< lib=libxup.so
< username=ask
< password=ask
< ip=127.0.0.1
< port=-1
< code=20
<
< #[Xvnc]
< #name=Xvnc
< #lib=libvnc.so
---
> #[Xorg]
> #name=Xorg
> #lib=libxup.so
196a188,196
> #code=20
>
> [Xvnc]
> name=Xvnc
> lib=libvnc.so
> username=ask
> password=ask
> ip=127.0.0.1
> port=-1
[root@tspshell01 yum.repos.d]#
→ There is a difference only in the edited part
--Restart the "xrdp" service
systemctl status xrdp
systemctl restart xrdp
systemctl status xrdp
--Remote desktop implementation
Confirm that you can connect (session has been changed to "Xorg")
-Configuration file backup
cp -p /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini_`date "+%Y%m%d_%H%M%S"`
--File backup confirmation
[root@tspshell01 yum.repos.d]# ll /etc/xrdp | grep xrdp
-rw-r--r--1 root root 5426 May 18 22:37 xrdp.ini
-rw-r--r--1 root root 5427 March 11 19:53 xrdp.ini_20200518_223104
-rw-r--r--1 root root 5426 May 18 22:37 xrdp.ini_20200518_224629
-rw-r--r--1 root root 5426 May 18 22:37 xrdp.ini_20200518_224633
-rw-r--r--1 root root 3570 March 11 19:53 xrdp_keyboard.ini
[root@tspshell01 yum.repos.d]#
--Change configuration file
vi /etc/xrdp/xrdp.ini
Before correction
max_bpp=32
Revised
max_bpp=24
--Compare with backup file
[root@tspshell01 yum.repos.d]# diff /etc/xrdp/xrdp.ini /etc/xrdp/xrdp.ini_202005
18_224633
73c73
< max_bpp=24
---
> max_bpp=32
[root@tspshell01 yum.repos.d]#
→ There is a difference only in the edited part
--Restart the "xrdp" service
systemctl status xrdp
systemctl restart xrdp
systemctl status xrdp
--Remote desktop implementation
Confirm that you can connect
Install xrdp on CentOS7 and connect with remote desktop from Windows https://qiita.com/shinoere/items/35793d9c6155145cb37c
xrdp https://qiita.com/n-yamanaka/items/653af5cdac63721ff074
Twitter I mainly mutter about career hacks of infrastructure engineers. ** ** https://twitter.com/satton6987
Recommended Posts