Second VNC display; the default for many Linux VNC servers started with vncserver :1.
Second VNC display; the default for many Linux VNC servers started with vncserver :1.
Expose only to trusted sources. Same as 5900: tunnel through SSH or a VPN.
Port 5901 is in the registered range and has no IANA assignment. The usage above is unofficial but widespread.
sudo ss -tlnp 'sport = :5901'sudo lsof -nP -i :5901sudo netstat -tlnp | grep ':5901 'netstat -ano | findstr :5901Get-NetTCPConnection -LocalPort 5901 -State Listen | Select LocalAddress,OwningProcessnc -vz -w 5 HOST 5901Test-NetConnection HOST -Port 5901Replace 203.0.113.10 with the address or network you trust. With ufw, make sure the default incoming policy is deny.
sudo ufw allow from 203.0.113.10 to any port 5901 proto tcpsudo iptables -A INPUT -p tcp --dport 5901 -s 203.0.113.10 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 5901 -j DROPsudo nft add rule inet filter input ip saddr 203.0.113.10 tcp dport 5901 accept
sudo nft add rule inet filter input tcp dport 5901 dropNew-NetFirewallRule -DisplayName 'TCP 5901 trusted' -Direction Inbound -Protocol TCP -LocalPort 5901 -RemoteAddress 203.0.113.10 -Action AllowAll port numbers · Open port checker
Assignment data: IANA port number registry (public domain), retrieved 2026-11-10.