Last active
October 3, 2024 00:31
-
-
Save tosin2013/b3a10160db2d1ff2a944ab669cffbbd2 to your computer and use it in GitHub Desktop.
GNOME GUI and xrdp on RHEL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Install GNOME GUI | |
sudo yum groupinstall "Server with GUI" -y | |
# Enable EPEL repository | |
#sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm -y | |
sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm -y | |
# Install xrdp and dependencies | |
sudo yum install tigervnc-server xrdp firewalld -y | |
# Enable and start the xrdp service | |
sudo systemctl enable xrdp | |
sudo systemctl start xrdp | |
# Enable and start the firewalld service | |
sudo systemctl enable firewalld | |
sudo systemctl start firewalld | |
# Open firewall port for xrdp | |
sudo firewall-cmd --permanent --add-port=3389/tcp | |
sudo firewall-cmd --reload | |
echo "GNOME GUI and xrdp have been installed and enabled." | |
echo "You can now connect to this system using Remote Desktop from another machine." | |
# optional | |
curl -OL https://gist.githubusercontent.com/tosin2013/385054f345ff7129df6167631156fa2a/raw/b67866c8d0ec220c393ea83d2c7056f33c472e65/configure-sudo-user.sh | |
chmod +x configure-sudo-user.sh | |
./configure-sudo-user.sh |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The key steps are:
Install the GNOME desktop environment using
yum groupinstall "Server with GUI"
[1]Enable the EPEL repository which contains the xrdp package[2]
Install xrdp and the tigervnc-server dependency with
yum install tigervnc-server xrdp
[2][4]Enable and start the xrdp service using systemctl[2][4]
Open port 3389 in the firewall for Remote Desktop connections[2][4]
After running this script, the RHEL 8 server will have the GNOME GUI installed and will accept Remote Desktop connections on the standard port 3389. You can connect from a Windows machine using the built-in Remote Desktop Connection application.[2][6]
The script automates the manual steps required to set this up on RHEL 8. It provides a quick way to enable remote GUI access to the server.
Links:
[1] https://www.tecmint.com/install-gui-on-rhel-8/
[2] https://www.ucartz.com/clients/knowledgebase/1560/How-To-Install-xrdp-on-Red-Hat-Enterprise-Linux-8.html
[3] https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html/using_the_desktop_environment_in_rhel_8/accessing-the-desktop-remotely_using-the-desktop-environment-in-rhel-8
[4] https://docs.e2enetworks.com/guides/centos_xrdp.html