Practical Linux, Windows Server and cloud guides for IT pros.

How to Enable Remote Access on Ubuntu: SSH vs XRDP vs VNC

A practical Ubuntu remote-access guide that explains when to use SSH, XRDP or VNC and how to avoid opening the wrong service to the internet.

Filed under

,

Published

Written by

Last updated

Featured image for How to Enable Remote Access on Ubuntu: SSH vs XRDP vs VNC

TL;DR – Ubuntu remote access choices

  • Use SSH for admin work: It is the default answer for shell tasks, automation and low-overhead maintenance.
  • Use XRDP for a full desktop: Especially when your client machine is Windows and RDP is already the habit.
  • Use VNC only when you actually need it: Shared sessions and app-level GUI workflows are the usual reasons.
  • Do not expose everything: The biggest decision is often how the service is reached, not which service you picked.

Start here: If you already know you want the desktop route, How To Install Xrdp Server On Ubuntu 22.04 is the deeper XRDP walkthrough. This page helps you choose the right access model before you install anything.

ToolWhenCommand or port
SSHShell admin, files, scriptingsudo apt install openssh-server / TCP 22
XRDPFull Ubuntu desktop from Windows RDPsudo apt install xrdp / TCP 3389
VNCShared GUI session or specific remote desktop patternUsually TCP 5900+
RuleAny internet-facing setupRestrict access with VPN, firewall rules or trusted source IPs

The easiest way to get Ubuntu remote access wrong is to start with the most visual answer instead of the most practical one. Many people install a full desktop stack when what they really needed was a shell, file access and a stable SSH workflow.

Diagram comparing SSH, XRDP and VNC for Ubuntu remote access

Step-by-step: enable Ubuntu remote access safely

Choose the access method based on the outcome you need, not on which screenshot looks friendliest. Shell work wants SSH. A real desktop wants RDP or XRDP. VNC is the special-case path.

SSH: use this for admin and server work

  1. Install the OpenSSH server package.
  2. Enable the service immediately and on boot.
  3. Open TCP 22 in the firewall if ufw is active.
  4. Test from another machine with ssh user@server before you expose anything beyond the local network.
sudo apt update
sudo apt install -y openssh-server
sudo systemctl enable --now ssh
sudo ufw allow 22/tcp
hostname -I

Ubuntu Desktop 24.04+: use the built-in RDP feature first

  1. Open Settings – System – Remote Desktop.
  2. Turn on Desktop Sharing if somebody needs to see your current session, or Remote Login if they should log in to their own desktop session.
  3. Note the generated remote-desktop username, password, host name, and port number. They are separate from your normal login details.
  4. Allow TCP 3389:3390 through the firewall if needed, then connect from a client such as Remmina or the Windows Remote Desktop app.
sudo ufw allow 3389:3390/tcp
sudo ufw reload

XRDP: use this when you need a classic RDP service

  1. Install the xrdp package on the Ubuntu machine.
  2. Enable and start the service.
  3. Open TCP 3389 in the firewall.
  4. Connect from Windows Remote Desktop using the Ubuntu machine’s IP or DNS name.
sudo apt update
sudo apt install -y xrdp
sudo systemctl enable --now xrdp
sudo ufw allow 3389/tcp

VNC: only when you specifically need VNC semantics

  1. Install a VNC server such as TigerVNC.
  2. Set a VNC password with vncpasswd.
  3. Start a VNC display, for example :1, which maps to TCP 5901.
  4. Keep VNC on a trusted LAN or behind a VPN rather than forwarding it raw to the internet.
sudo apt update
sudo apt install -y tigervnc-standalone-server tigervnc-common
vncpasswd
vncserver :1
sudo ufw allow 5901/tcp

Do not ufw allow 5901/tcp to the internet. Plain VNC is unencrypted and trivially observable. The safe pattern is to bind the VNC display to localhost on the server and reach it from the client through an SSH tunnel — that way you keep VNC’s session semantics without giving the protocol an internet-exposed listener:

If you genuinely need VNC reachable across networks without a tunnel, put it behind a VPN or use the encrypted variant (TigerVNC’s -SecurityTypes options). The default vncserver :1 with no further hardening is a LAN tool, not a public service.


SSH is still the default answer for server work

If the job is package management, config edits, service restarts, logs, automation or file work, SSH is the cleanest path. It is lighter, safer to expose through controlled paths, and much easier to pair with keys, jump hosts and VPN access.

sudo apt update
sudo apt install openssh-server -y
sudo systemctl enable --now ssh
sudo ufw allow 22/tcp

XRDP makes sense when you need a real desktop

XRDP is the obvious fit when the user expects a full Ubuntu desktop and is connecting from Windows. It lines up nicely with the native Remote Desktop client and feels familiar to people who already manage Windows boxes that way.

sudo apt install xrdp -y
sudo adduser xrdp ssl-cert
sudo systemctl restart xrdp
sudo ufw allow 3389/tcp

If that is your direction, use How To Install Xrdp Server On Ubuntu 22.04 for the dedicated install and troubleshooting path.

VNC is the niche answer, not the default answer

VNC still has a place. It is useful when you need a shared graphical session, when the workflow is tied to a particular VNC stack, or when you are dealing with a tool that expects that style of desktop access. It is just not the best first answer for most Ubuntu admin tasks.

Security matters more than the access method label

  • Expose as little as possible directly to the internet.
  • Restrict source IPs where you can.
  • Prefer VPN access for GUI protocols.
  • Harden SSH properly if it is your main admin channel.

For the SSH side of that conversation, the follow-on guide is Linux SSH Hardening Checklist for Small Servers and Home Labs. For a fresh Ubuntu box, pair this with Ubuntu Server First 30 Minutes


Related next steps

Elsewhere On TurboGeek:  Install MediaWiki on Ubuntu 22.04 with 1.43 LTS

Leave a Reply

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

Find more on the site

Keep reading by topic.

If this post was useful, the fastest way to keep going is to pick the topic you work in most often.

Want another useful post?

Browse the latest posts, or support TurboGeek if the site saves you time regularly.

Translate »