This episode addresses VNC's biggest weakness: without encryption all data is sent in plaintext and can be sniffed. You'll enable TLS/SSL in x11vnc and TigerVNC, see proof of sniffing with tcpdump, and understand the SSH tunnel as an encryption layer.

Episode 12 strengthened authentication, but there's a bigger hole: VNC without encryption sends all data as plaintext. Your screen, keyboard input, and the authentication handshake travel across the network in a form readable by anyone sniffing. On public networks or open WiFi, this is like sending your screen contents to anyone.
Episode 13 closes that hole. You'll see the proof of sniffing yourself with tcpdump, enable TLS/SSL encryption in x11vnc and TigerVNC, and understand the SSH tunnel's position as the final encryption layer, which will be covered in full in episode 14.
When a viewer connects to a VNC server without encryption, all RFB communication crosses the network raw. The leaked data includes:
This is why raw VNC should never be exposed to the internet. Even on internal local networks, sniffing habits still matter — especially in environments with many users.
The most convincing way is to see it yourself. Run tcpdump on one machine, open a VNC session, and observe the data passing through:
sudo tcpdump -i eth0 -X -s 0 port 5900The sudo tcpdump -i eth0 -X -s 0 port 5900 command captures packets on port 5900 and displays them in hex and ASCII. If you watch closely, the RFB protocol header is clearly visible as readable text — proof that there's no encryption at this layer.
Warning
After the experiment, close the unencrypted session and enable one of the mechanisms below. Sniffing your own traffic to learn is legitimate, but leaving VNC open in plaintext on a public network is a risk not worth taking.
x11vnc supports built-in TLS/SSL encryption. With the -sslgen option, x11vnc automatically creates a self-signed certificate and uses it directly:
x11vnc -display :0 -ssl -sslgen -rfbauth /etc/x11vnc.passThe x11vnc -display :0 -ssl -sslgen -rfbauth /etc/x11vnc.pass command runs the server with TLS-encrypted connections. For a certificate from an official CA — one that doesn't trigger warnings in viewers — create a certificate with openssl and point to it with -sslcert:
openssl req -x509 -newkey rsa:2048 -keyout /etc/x11vnc-key.pem -out /etc/x11vnc-cert.pem -days 365 -nodes
x11vnc -display :0 -ssl /etc/x11vnc-cert.pem -rfbauth /etc/x11vnc.passThe TigerVNC viewer can connect to a TLS server by selecting the appropriate security type:
vncviewer -SecurityTypes TLSVnc,TLSNone 192.168.1.20:5900TigerVNC (especially 1.16 and later) builds its TLS support on GnuTLS. The server picks the mechanism via the -SecurityTypes option, and the viewer must agree on the same mechanism:
Xvnc :1 -geometry 1920x1080 -depth 24 -SecurityTypes VncAuth,TLSVnc -passwordfile ~/.vnc/passwdThe Xvnc :1 -SecurityTypes VncAuth,TLSVnc -passwordfile ~/.vnc/passwd command creates display :1 that accepts VNC connections with password authentication encrypted by TLS. On the viewer side:
vncviewer -SecurityTypes TLSVnc localhost:5901If the server and viewer use mismatched security types, the connection fails with a message showing the list of mechanisms each side supports.
Not all TigerVNC builds include TLS. Verify support with this command:
vncviewer --help | grep -i -E "security|tls"An output showing the -SecurityTypes option means your viewer build supports TLS. If it's absent, upgrade TigerVNC to 1.16 or use an SSH tunnel instead.
The most universal and reliable way is to wrap VNC in an SSH tunnel. Its advantages: no server configuration changes at all, encryption is handled by battle-tested OpenSSH, and the server can stay bound to localhost.
ssh -L 5901:localhost:5900 arman@192.168.1.20Once the tunnel is active, the viewer on the local machine just connects to localhost:5901 and all VNC traffic passes through the encrypted SSH connection:
vncviewer localhost:5901This is the pattern most recommended for accessing VNC from outside networks, and episode 14 will cover it thoroughly — including jump hosts and reverse tunnels.
Episode 13 closed the VNC plaintext weakness: you saw the proof of sniffing with tcpdump, enabled TLS/SSL in x11vnc with -sslgen, used the TLS security type in TigerVNC, and recognized the SSH tunnel as the most universal encryption layer.
Key takeaways:
tcpdump -X port 5900 proves the RFB header can be read directly.-ssl and -sslgen for built-in TLS/SSL.-SecurityTypes VncAuth,TLSVnc for TLS.In the next episode, episode 14, we dissect SSH tunneling and secure remote access — local forwarding for VNC and RDP, two-way tunnels for firewall bypass, jump hosts with ssh -J, and reverse tunnels so servers behind NAT can be accessed from outside. See you there!