On this pageHow VNC works, and where it is weak
VNC runs in more places than most people notice: hypervisor consoles, the Screen Sharing feature on every Mac, single-board computers, factory touch panels, and plenty of Linux servers. It is simple, it is open, and it works with almost any operating system. The trouble is not VNC itself but how it often meets the network: on a public address, with a short password and no encryption. This guide shows how to fix that, and when another tool fits the job better.
How VNC works, and where it is weak
VNC uses the Remote Framebuffer protocol, RFB. The server sends pictures of the screen as it changes, and the client sends back keystrokes and mouse movements. Because it only deals in pixels, it does not care which desktop or operating system draws them. Each display listens on port 5900 plus its number, so display :1 is TCP 5901.
That simplicity has costs:
| Security type | What you get | Fit for the internet? |
|---|---|---|
| None | No password at all | Never |
| VNC Authentication | A password cut to 8 characters, checked with old DES-based crypto, and no encryption of the session | No |
| VeNCrypt (TLS) | TLS encryption, optionally with system user accounts | Yes, with a real certificate |
| Vendor schemes | Encryption and account sign-in in commercial products | Yes, with that vendor's clients |
The classic scheme is still the default in many servers. It has no user name, so anyone who reaches the port only has to guess one short password, and everything you type, passwords included, crosses the network unencrypted.
Option 1: listen on localhost and tunnel over SSH
The most dependable fix needs no VNC features at all. Make the VNC server listen only on the loopback interface, and reach it through SSH, which you already trust and can secure with keys. On Debian or Ubuntu with TigerVNC:
sudo apt install -y tigervnc-standalone-server xfce4 dbus-x11
vncpasswd # set the VNC password for this user
tigervncserver :1 -localhost yes -geometry 1600x900 -xstartup /usr/bin/startxfce4
From your own computer, open the tunnel and point the viewer at your end of it:
ssh -N -L 5901:localhost:5901 alice@203.0.113.10
vncviewer localhost:5901
TigerVNC's viewer can open the tunnel itself with vncviewer -via alice@203.0.113.10 localhost:1. On Windows, the OpenSSH client that ships with Windows 10 and 11 runs the same ssh -L command. Check afterwards that nothing listens on the public interface:
ss -tlnp | grep ':59'
Every line should show 127.0.0.1 or [::1], never 0.0.0.0 or *.
Option 2: TLS inside VNC
When a tunnel is not practical, for example for users who will not run SSH, use a server and viewer that both support VeNCrypt. TigerVNC can wrap each session in TLS and check the user's system password instead of a separate VNC one: set its SecurityTypes parameter to X509Plain, point X509Cert and X509Key at a certificate, and list who may connect in PlainUsers. Check that your viewer supports VeNCrypt before you rely on it; some lightweight viewers only speak the classic scheme and will refuse to connect.
Option 3: a VPN or a browser gateway in front
Two other designs keep VNC off the public internet entirely:
- A VPN. Run WireGuard on the server and allow port 5901 only on the VPN interface. Clients connect to the VPN first, then to the server's private address.
- A browser gateway. Apache Guacamole speaks VNC, RDP and SSH on the server side and plain HTTPS to the browser, with its own accounts and optional two-factor sign-in. noVNC with websockify behind a reverse proxy that handles sign-in is a lighter version of the same idea.
Where VNC is still the right tool
VNC has jobs that other protocols do not do well:
- Consoles for virtual machines. Hypervisors expose each machine's screen over VNC, which is how you reach a server whose network or remote desktop is broken. On CloudSat, Console access (VNC) in a server's Access tab works this way, independent of the server's own firewall (recovery tools).
- Sharing the screen that is already there. RDP opens a new session; VNC servers such as x11vnc, or Screen Sharing on a Mac, show the display someone is already using, which suits helping a person at the machine.
- Macs. Screen Sharing is VNC compatible, so any VNC viewer can reach a Mac when the option for VNC viewers is turned on. Our guide to managing Macs remotely covers the settings.
- Small and embedded devices, where a VNC server is often the only remote display available.
When to pick something else
| What you need | Better fit | Why |
|---|---|---|
| A Linux desktop on a server for daily work | xrdp | Any RDP client works, TLS by default, separate sessions per user |
| Windows administration | Built-in RDP | Faster, with drive, printer and audio redirection |
| Machines behind NAT with no port forwarding | RustDesk or MeshCentral | Devices connect outward to a server you control |
| Browser-only access for a team | Apache Guacamole or Kasm Workspaces | One HTTPS entry point, central accounts |
| GNOME or KDE on Wayland | GNOME Remote Desktop, KDE's KRdp | Built into the desktop, speaks RDP |
| 3D and CAD work | Protocols built for GPU encoding | Pixels-only VNC struggles with fast-changing frames |
For Linux servers, the xrdp route is covered in our guide to a Linux desktop over RDP. For machines behind NAT, RustDesk, MeshCentral and Kasm Workspaces are one-click apps on CloudSat (RustDesk, MeshCentral, Kasm Workspaces).
A hardening checklist for any VNC server
- Bind to localhost or a VPN address, and confirm with
ss -tlnp. - Block ports 5900 to 5999 in the firewall in front of the server, so a misconfigured server is not reachable anyway.
- Prefer system accounts over a shared VNC password, and remember that classic VNC passwords only use their first 8 characters.
- Give observers a separate view-only password where the server supports one.
- Stop the server when nobody needs it. A VNC session that runs for months is a desktop left open for anyone who finds the port.
- Keep the VNC server updated. Several implementations have had authentication flaws over the years, and the fixes only help if you install them.
FAQ
Is VNC traffic encrypted?
Not by default in many servers. The classic security type encrypts nothing after the password check. TLS-based types such as VeNCrypt, commercial VNC products and an SSH tunnel all fix that.
Why does my VNC password seem to stop at 8 characters?
The classic VNC Authentication scheme only uses the first 8 characters, so correct-horse and correct- are the same password. Use system accounts over TLS, or keep the server on localhost behind SSH.
VNC or RDP for a Linux server?
RDP through xrdp in most cases: your computer already has a client, encryption is on by default, and each user gets a separate session. VNC wins when you need to see an existing display or reach a machine's console.
Can I run VNC on Windows?
Yes, several VNC servers exist for Windows, and they are useful for sharing the session a person is already using. For administering a Windows server, the built-in Remote Desktop is faster and better integrated.
Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.




