This guide explains how to set up a secure VNC server. It was written for Void Linux, but should work on other Linux distributions with minor adjustments.
A Linux machine with: -x11vnc installed -An active X session running -SSH server installed and accessible A local client machine with: -SSH client -VNC viewer
Debian/Ubuntu:
sudo apt install x11vnc openssh-serverArch Linux:
sudo pacman -S x11vnc opensshVoid Linux:
sudo xbps-install -S x11vnc opensshx11vnc -storepasswdThis will save the password to ~/.vnc/passwd.
Make the script executable and run it. The script checks if x11vnc is already running, and starts it if not:
chmod +x startVNC.sh
./startVNC.shIf you're using Void Linux, enable SSH temporarily:
sudo ssh-keygen -A
sudo /usr/bin/sshdIf using runit, you can also set it up permanently:
sudo ln -s /etc/sv/sshd /var/servicessh -L 5900:localhost:5900 user@server-ipOpen your VNC client and connect to:
localhost:5900