How can I configure UFW to allow VNC access to my computer from a specific IP address?


I am connecting from another local device to my laptop. How can I configure the UFW to let my specific device through?


Ubuntu 15.04

1 Answer 1


From https://www.digitalocean.com/community/tutorials/ufw-essentials-common-firewall-rules-and-commands

This would be
sudo ufw allow from to any port 5900

  • 2
    Yes, just found the same solution. I had been making a simple mistake in my previous inputs. Thanks, correct answer.
    – Vesa
    Commented Aug 9, 2017 at 13:37
  • Depending on your use case, note that "from any to any" covers all incoming addresses and "from to any" allows a specific subnet.
    – VoteCoffee
    Commented Jan 18, 2021 at 11:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .