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.
| Port | 5900 |
|---|---|
| Transport | TCP |
| Service | Virtual Network Computing (VNC) |
| Encrypted | Often 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
| Where | Command |
|---|---|
| Scan from another machine | nmap -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 inIn 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.