How to Disable Screen Sharing in Ubuntu Linux

The Open Port Danger

Modern versions of Ubuntu Desktop (specifically those using the GNOME desktop environment) include a built-in “Screen Sharing” feature. This utilizes the VNC (Virtual Network Computing) protocol, allowing you to remotely view and control your desktop from another computer on the network. While this is incredibly useful for remote IT support, leaving the VNC server running on a laptop that frequently connects to public coffee shop Wi-Fi is extremely dangerous. An open VNC port is a prime target for malicious actors scanning the network. If you never intend to remotely control your Ubuntu machine, you must permanently shut this service down.

How to Turn Off Desktop Sharing

You can completely disable the internal VNC server via the main system settings.

  1. Click the System Menu in the top-right corner of the Ubuntu desktop (where the battery and network icons are).
  2. Click on Settings (the gear icon).
  3. In the left-hand sidebar, click on Sharing.
  4. In the main window, click on Screen Sharing.
  5. A small pop-up window will appear. At the very top of this window, click the master toggle switch to turn it Off.
  6. Close the pop-up window.
  7. For maximum security, look at the main “Sharing” window and turn the master Sharing toggle switch (at the very top) to the Off position as well.

The Closed Port

The change takes effect instantly. Ubuntu immediately terminates the internal VNC server process and closes the associated networking port (usually port 5900). Your computer will immediately reject all incoming remote desktop connection requests, securing your machine against unauthorized remote viewing.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.