Free tech learning for everyone, from basics to pro

Port 5900: VNC (Virtual Network Computing)

What port 5900 (TCP) does, the security risks of leaving it open, and how to secure and test it.

Port5900
TransportTCP
ServiceVirtual Network Computing (VNC)
EncryptedOften no

What is port 5900?

VNC shares a computer's screen for remote control. The first display uses TCP 5900, the next 5901, and so on.

Common uses

  • Remote support and controlling Linux or macOS desktops

Security risks

  • Many VNC servers have weak or no passwords
  • Traffic is often unencrypted
  • Exposed VNC on industrial systems has led to real incidents

How to secure port 5900

  • Never expose VNC to the internet; tunnel it over SSH or a VPN
  • Set strong passwords and use versions with encryption

How to check if port 5900 is open

WhereCommand
Scan from another machinenmap -p 5900 <host>
Windows (PowerShell)Test-NetConnection <host> -Port 5900
Linux (what is listening)sudo ss -tulpn | grep :5900
Windows (what is listening)netstat -ano | findstr :5900

Only scan systems you own or have permission to test.

Example: block it at the internet edge (Cisco)

For a service that should stay inside your network, deny it on the internet-facing interface. Put the rule before any broader permit statements:

ip access-list extended INTERNET-IN
 remark Block VNC from the internet
 deny   tcp any any eq 5900
 permit ip any any
!
interface GigabitEthernet0/0
 ip access-group INTERNET-IN in

In a real network the final line would be your normal inbound policy, not "permit ip any any". Build and check rules with the ACL builder.

Related ports

Frequently asked questions

What is port 5900 used for?

Port 5900 (TCP) is used by Virtual Network Computing (VNC). VNC shares a computer's screen for remote control.

Is it safe to open port 5900?

Only if the service needs to be reached and is configured securely. Never expose VNC to the internet; tunnel it over SSH or a VPN.

How do I check if port 5900 is open?

From another computer, run nmap -p 5900 followed by the host address. On the server itself, ss -tulpn on Linux or netstat -ano on Windows shows whether anything is listening on 5900.

Learn more: TCP, UDP and ports explained and firewall basics.

Get free updates by email

New notes, tools, CCNA and Security+ tips and important security news from FM TecHub, explained simply. Free, about twice a month. Unsubscribe anytime; see our privacy policy.

PortServiceStatus
SMTP/25Email updatesup

Free · no spam · past emails · powered by Buttondown