Skip to content

Instantly share code, notes, and snippets.

@imasimali
Last active March 14, 2021 16:19
Show Gist options
  • Save imasimali/82d3c568f17d1423013662fc01d80133 to your computer and use it in GitHub Desktop.
Save imasimali/82d3c568f17d1423013662fc01d80133 to your computer and use it in GitHub Desktop.
Ubuntu Uncomplicated Firewall (ufw) rules to allow specific IP addresses to access VNC
## allow ssh connections (otherwise you will lock yourself out)
sudo ufw allow 22/tcp
## allow VNC connections from one IP address (edit the port if you don't use 5901)
sudo ufw allow from 12.34.56.78/24 to any port 5901
## reject all other incoming connections
sudo ufw default reject incoming
## enable the firewall
sudo ufw enable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment