Close

Connect to Ubuntu Linux via RDP (well xrdp)

To set up Remote Desktop Protocol (RDP) on an Ubuntu system, you can use a program called “xrdp,” which allows you to access your Ubuntu desktop remotely from another computer. Here are the steps to install and configure RDP on Ubuntu:

1. Update your system:
Open a terminal (Ctrl+Alt+T) and run the following commands to make sure your system is up to date:

sudo apt update
sudo apt upgrade

2. Install xrdp:
You can install xrdp with the following command:

sudo apt install xrdp

3. Start the xrdp service:
After installation, xrdp should start automatically. If it doesn’t, you can start it manually with:

sudo systemctl start xrdp

To enable it to start on boot:

sudo systemctl enable xrdp

4. Configure the session manager:
By default, xrdp uses the “Xsession” session manager, which may not work correctly with the Ubuntu desktop. To use the “xfce4” session manager (which is a lightweight desktop environment), create a symbolic link:

sudo ln -s /etc/xrdp/startwm.sh /etc/xrdp/startwm.sh

5. Allow the xrdp port (if you’re using a firewall):
If you’re running a firewall (e.g., UFW), you need to allow the RDP port (3389) through it. Run the following command to allow incoming RDP connections:

sudo ufw allow 3389/tcp

6. Restart xrdp:
Restart the xrdp service to apply the changes:

sudo systemctl restart xrdp

7. Connect to your Ubuntu machine:
On your Windows or other RDP client, enter the IP address or hostname of your Ubuntu machine. You should be prompted to enter your Ubuntu username and password.

8. Additional configuration (optional):
If you want to customize the RDP session further, you can create a file called ~/.xsessionrc and add your preferred desktop environment or window manager. For example, to use the default GNOME desktop:

echo “gnome-session” > ~/.xsessionrc

9. Security Note:
When exposing your system to the internet through RDP, it’s crucial to use strong passwords and consider using SSH tunneling or a VPN for additional security.

Now, you should be able to access your Ubuntu desktop remotely using RDP. Make sure you have an RDP client installed on your local machine to connect to your Ubuntu system.

If this doesn’t work for some reason check that you are logged out of any other sessions with the same username on the linux machine. If you are, sign out and try again.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.