Linux Basics: Enable Remote Desktop (RDP) on Linux

webpwnized
18 Dec 202103:58

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

00:00

🖥️ 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)

RDP is a proprietary protocol developed by Microsoft, which provides a user with a graphical interface to connect to another computer over a network connection. In the video's context, RDP is used to remotely access a Linux desktop, such as when the desktop is hosted in a cloud environment like Azure or Google Cloud Platform (GCP). The script mentions installing RDP to facilitate this remote connection.

💡Linux desktop

A Linux desktop refers to a graphical user interface that runs on the Linux operating system. It is the environment where users interact with applications and the system itself. The script discusses connecting to a Linux desktop remotely, emphasizing the process of setting up RDP on such a system.

💡Cloud environment

A cloud environment is a network of remote servers hosted on the internet to store, manage, and process data, rather than a local server or personal computer. The script mentions Azure and GCP as examples of cloud environments where one might run a Linux desktop and need to connect via RDP.

💡Root account

In Unix-like operating systems, the root account is the superuser account with the highest level of access, equivalent to an administrator account in Windows. The script advises against using the root account for installing RDP to adhere to best practices in system security.

💡Kali user

Kali is a reference to a specific Linux distribution known for its security tools, and in the script, it also refers to a non-privileged user account on a Linux system. The script demonstrates switching to this user account for the purpose of installing RDP.

💡sudo

Sudo is a command in Unix-like operating systems that allows a permitted user to execute a command as the superuser or another user, as specified in the sudoers file. In the script, 'sudo' is used to gain the necessary privileges to install and manage software packages.

💡xrdp

xrdp is an open-source software package that enables RDP functionality on Linux systems. The script details the installation of xrdp to set up RDP on a Linux desktop, allowing for remote connections.

💡Software updates

Software updates are patches or new versions of software that fix bugs, update features, or improve security. The script mentions checking for the latest software updates before proceeding with the installation of xrdp to ensure the system is up to date.

💡User groups

In Linux, user groups are a way to organize users and assign permissions. The script discusses adding users to the 'xrdp' group to grant them access to the RDP service, illustrating the management of user permissions.

💡System control

System control refers to the management of system services, such as starting, stopping, or enabling them to start at boot. The script describes using system control commands to manage the xrdp service, ensuring it is active for remote connections.

💡Microsoft Desktop Remote Connection

Microsoft Desktop Remote Connection is a software application for Mac users that allows them to connect to an RDP session, similar to the built-in RDP client on Windows machines. The script mentions this software as an alternative for Mac users to connect to the Linux desktop via RDP.

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

play00:01

sometimes you may want to connect to

play00:03

your Linux desktop over RDP such as when

play00:06

you're running your Linux desktop in a

play00:08

cloud environment like Azure or gcp

play00:13

to install RDP I'm going to start by

play00:15

switching out of the root account and

play00:17

into a less privileged account

play00:21

so I'm going to switch to in this case

play00:23

the Kali user which does not have the

play00:27

root privileges

play00:32

I'll switch my shell

play00:38

and so now we are just in the

play00:42

Kali user who's in the Kali group and

play00:45

doesn't have automatic root access to

play00:47

the system

play00:48

it doesn't matter which user you use

play00:50

it's just best practice not to use the

play00:52

root account because the installation

play00:55

process automatically puts the current

play00:57

user into the RDP group

play01:00

so that user is going to have access

play01:03

over rdb

play01:06

to begin we just want to make sure that

play01:07

we have the latest packages I'm going to

play01:10

use the sudo Sudo prefix here to make

play01:14

sure that I have enough privileges to

play01:16

run these commands

play01:17

and I'm going to check that I've got the

play01:20

latest software updates

play01:24

put in the password for this current

play01:26

user

play01:28

and we'll go ahead and check and see if

play01:31

there's any newer software available

play01:33

once we do that we're going to install

play01:35

the packages

play01:39

so we're going to do apt install

play01:42

and we want to install the xrdp software

play01:49

installation process so

play01:52

take a little while depending on how

play01:53

fast the machine is how fast the

play01:55

internet connection

play01:56

but should be less than a couple minutes

play02:01

you may want to allow other users to

play02:04

connect over RDP you can put them into

play02:07

the correct groups

play02:09

using user mod

play02:11

and giving them the supplemental groups

play02:13

xrdp

play02:15

and SSL cert

play02:18

the RDP server uses the TLs

play02:22

protocol to encrypt the connections so

play02:25

they may need to be in both groups

play02:27

and in my case I'm going to use another

play02:30

user that I got on this box for this

play02:32

example

play02:36

now we might want to either just start

play02:38

the RDP service for this session or we

play02:40

may want to enable it to

play02:42

startup every time the computer boots if

play02:45

you're going to push your

play02:47

VM into the cloud you're going to want

play02:49

to enable it every time

play02:51

otherwise you won't be able to connect

play02:54

so to enable it for just this one time

play02:57

we're going to do the use a system

play02:59

control

play03:01

and we're just going to start the

play03:03

service it's xrdp dot service

play03:07

but if we want to enable it to start

play03:09

every time the computer boots we're

play03:12

going to use the enable command instead

play03:16

and we can check the status

play03:18

of the service

play03:20

by using the status command

play03:24

and we want to make sure that it's

play03:26

running

play03:27

and we know which Port it's running on

play03:29

which is going to be for 3389 by default

play03:33

since everything is correct we can now

play03:35

use the rdb client built into any

play03:38

Windows machine to connect or if you're

play03:41

using a Mac you can install the

play03:43

Microsoft desktop

play03:46

remote connection software from

play03:48

Microsoft

play03:50

from the App Store and you can use that

play03:52

to connect over to the RDP service just

play03:55

like you were connecting to a Windows

play03:57

machine

Rate This

5.0 / 5 (0 votes)

Ähnliche Tags
Linux RDPRemote AccessCloud EnvironmentKali LinuxRDP SetupSecurity Best PracticesSoftware UpdatesXRDP InstallationService ManagementMicrosoft RDPRemote Connection
Benötigen Sie eine Zusammenfassung auf Englisch?