Remote Connections to Ubuntu Desktops

Remote Connections to Ubuntu Desktops via SSH and Microsoft Remote Desktop

Connecting via SSH

Step 1 : Ensure ssh is enabled on the Ubuntu host (system being connected to) by running the following commands in the terminal on the Ubuntu host:

  • 'sudo apt install openssh-server' to install openssh server
  • 'sudo systemctl enable ssh' to enable ssh
  • 'sudo ufw allow ssh' to allow ssh traffic through firewall
  • 'sudo systemctl status ssh' to check ssh status

demo

Step 2: Connect to the Ubuntu host by running the following command in the terminal on the client (system being connected from):

  • ssh username@ip_address or hostname | For example: ssh ojieok@10.229.2.34
  • To find the ip address you can enter 'ifconfig' or 'ip a' in terminal
ssh username@ip_address in terminalssh username@ip_address in terminal

Connecting via the Remote Desktop Application

Step 1: To install xrdp and allow remote connections to the Ubuntu host (system being connected to), run the following commands in terminal (Ctrl+Alt+T) :

  • sudo apt install xrdp -y to install xrdp
  • sudo systemctl start xrdp to start xrdp
  • sudo systemctl enable xrdp to enable xrdp
  • sudo systemctl status xrdp to check the status of xrdp, if it is active
  • sudo ufw allow from any to any port 3389 proto tcp

Step 2: Ensure that Remote Desktop is not enabled in settings. If it is enabled, this might not work

Remote Desktop DISABLED in Settings

  • Accessing Ubuntu from Windows:
    • Open the Remote Desktop Connection app and enter the domain name or IP address of the Ubuntu host
    • To find the IP address enter  ifconfig or ip a in terminal
    • In the next tab, click Yes 
    • Provide the username and password to sign in to the Ubuntu host
rdp with ip addressremote desktop warningxorg session
add pc in Microsoft Remote Desktopenter IP addressdouble click to rdphit connect when prompted

Disabling SSH

  • To disable SSH on the Ubuntu system, run the following commands in terminal:
    sudo systemctl disable --now ssh



Keywords:
remote ubuntu rdp ssh linux desktop 
Doc ID:
132048
Owned by:
Ojie O. in Engineering IT
Created:
2023-10-11
Updated:
2025-05-06
Sites:
University of Maryland Engineering IT