Linux Basics: Enable Remote Desktop (RDP) on Linux
Summary
TLDRThis tutorial demonstrates how to install and configure Remote Desktop Protocol (RDP) on a Linux desktop, particularly useful for accessing a cloud-hosted environment like Azure or GCP. It advises against using the root account for security reasons, recommends updating packages, and guides through the installation of xrdp. The process includes adding users to the appropriate groups for RDP access, starting the RDP service, and enabling it for automatic startup. Finally, it explains how to connect using a Windows or Mac machine with the necessary software.
Takeaways
- 🔒 Start by switching to a less privileged account for security best practices.
- 👤 The Kali user account is used as an example, but any non-root user account can be used.
- 🛠️ Use 'sudo' to perform administrative tasks without root access.
- 📦 Ensure the system is up to date with the latest software packages.
- 🔄 Install 'xrdp' software to enable RDP connections on Linux.
- ⏳ Be patient as the installation may take a few minutes depending on system and internet speed.
- 👥 Use 'usermod' to add other users to the correct groups for RDP access.
- 🔒 The RDP server uses TLS for encrypted connections, requiring users to be in specific groups.
- 💻 Start the RDP service for the current session or enable it to start at boot for cloud VMs.
- 🔄 Use 'systemctl' to manage the RDP service's state.
- 🔍 Check the service status to ensure it's running on the default port 3389.
- 📱 Use the built-in RDP client on Windows or Microsoft's remote connection software on Mac to connect.
Q & A
Why is it recommended to switch out of the root account before installing RDP?
-It is recommended to switch out of the root account because the installation process automatically adds the current user to the RDP group, granting them access over RDP. Using a less privileged account is a best practice for security reasons.
What command is used to check for the latest software updates on a Linux system?
-The command used to check for the latest software updates on a Linux system is `sudo apt update`.
How do you install the RDP software on a Linux system?
-You install the RDP software on a Linux system using the command `sudo apt install xrdp`.
What is the purpose of adding users to the xrdp and SSL cert groups?
-Adding users to the xrdp and SSL cert groups allows them to connect over RDP with the necessary permissions. The SSL cert group is particularly important as the RDP server uses the TLS protocol to encrypt connections.
How can you start the RDP service for just one session?
-You can start the RDP service for just one session by using the command `sudo systemctl start xrdp.service`.
What command should you use to ensure the RDP service starts every time the computer boots?
-To ensure the RDP service starts every time the computer boots, use the command `sudo systemctl enable xrdp.service`.
How do you check the status of the RDP service on a Linux system?
-You can check the status of the RDP service on a Linux system by using the command `sudo systemctl status xrdp.service`.
What is the default port number for the RDP service?
-The default port number for the RDP service is 3389.
What should Mac users do to connect to an RDP service?
-Mac users should install the Microsoft Remote Desktop software from the App Store to connect to an RDP service, similar to connecting to a Windows machine.
Why might you want to enable the RDP service on startup if running a Linux desktop in a cloud environment?
-Enabling the RDP service on startup ensures that the service is always available, which is critical when running a Linux desktop in a cloud environment. Without this, you might not be able to connect after a reboot.
Outlines
🖥️ Setting Up RDP on Linux Desktop
The script begins by emphasizing the importance of not using the root account for installing RDP on a Linux desktop, especially in cloud environments like Azure or GCP. It suggests switching to a less privileged account, such as 'Kali user', to follow best practices and prevent automatic root access during the installation. The process involves updating the system packages using 'sudo' to ensure the latest software is installed. The script then guides through the installation of 'xrdp' software, which may take a few minutes depending on the system's speed and internet connection.
Mindmap
Keywords
💡RDP (Remote Desktop Protocol)
💡Linux desktop
💡Cloud environment
💡Root account
💡Kali user
💡sudo
💡xrdp
💡Software updates
💡User groups
💡System control
💡Microsoft Desktop Remote Connection
Highlights
Switching out of the root account to a less privileged account for security best practices.
Switching to the Kali user account without root privileges.
Using the sudo prefix for commands to ensure necessary privileges.
Checking for the latest software updates before proceeding with installation.
Installing xrdp software for RDP connectivity.
The installation process duration depending on machine and internet speed.
Adding users to the correct groups for RDP access using usermod.
The importance of being part of both the xrdp and SSL cert groups for RDP connectivity.
Starting the RDP service for the current session using systemctl.
Enabling the RDP service to start on every computer boot for cloud VMs.
Checking the status of the RDP service to ensure it's running.
Identifying the default port for RDP connections, which is 3389.
Using the built-in RDP client on Windows machines for connection.
Installing Microsoft's desktop remote connection software on Mac for RDP.
Connecting to the RDP service from a Mac using Microsoft's software.
The practical application of connecting a Linux desktop in cloud environments like Azure or GCP.
Transcripts
sometimes you may want to connect to
your Linux desktop over RDP such as when
you're running your Linux desktop in a
cloud environment like Azure or gcp
to install RDP I'm going to start by
switching out of the root account and
into a less privileged account
so I'm going to switch to in this case
the Kali user which does not have the
root privileges
I'll switch my shell
and so now we are just in the
Kali user who's in the Kali group and
doesn't have automatic root access to
the system
it doesn't matter which user you use
it's just best practice not to use the
root account because the installation
process automatically puts the current
user into the RDP group
so that user is going to have access
over rdb
to begin we just want to make sure that
we have the latest packages I'm going to
use the sudo Sudo prefix here to make
sure that I have enough privileges to
run these commands
and I'm going to check that I've got the
latest software updates
put in the password for this current
user
and we'll go ahead and check and see if
there's any newer software available
once we do that we're going to install
the packages
so we're going to do apt install
and we want to install the xrdp software
installation process so
take a little while depending on how
fast the machine is how fast the
internet connection
but should be less than a couple minutes
you may want to allow other users to
connect over RDP you can put them into
the correct groups
using user mod
and giving them the supplemental groups
xrdp
and SSL cert
the RDP server uses the TLs
protocol to encrypt the connections so
they may need to be in both groups
and in my case I'm going to use another
user that I got on this box for this
example
now we might want to either just start
the RDP service for this session or we
may want to enable it to
startup every time the computer boots if
you're going to push your
VM into the cloud you're going to want
to enable it every time
otherwise you won't be able to connect
so to enable it for just this one time
we're going to do the use a system
control
and we're just going to start the
service it's xrdp dot service
but if we want to enable it to start
every time the computer boots we're
going to use the enable command instead
and we can check the status
of the service
by using the status command
and we want to make sure that it's
running
and we know which Port it's running on
which is going to be for 3389 by default
since everything is correct we can now
use the rdb client built into any
Windows machine to connect or if you're
using a Mac you can install the
Microsoft desktop
remote connection software from
Microsoft
from the App Store and you can use that
to connect over to the RDP service just
like you were connecting to a Windows
machine
Ver Más Videos Relacionados
Configure Proxmox GPU Passthrough (Step-by-Step Tutorial)
How to Install Ubuntu on Windows 10 (WSL)
Cara Install WSL Linux Di PC Windows [Security & Development]
Access Linux Server Remotely Using SSH - Putty | Windows CMD | GitBash | MobaXterm
Invoke application deployed in Cloud Run from Apigee Proxy
Full Node.js Deployment - NGINX, SSL With Lets Encrypt
5.0 / 5 (0 votes)