TeamViewer's preferred connection port (it falls back to 443 and 80).
TeamViewer's preferred connection port (it falls back to 443 and 80).
Do not expose to the internet. Only outbound is needed. Blocking it does not stop TeamViewer since it falls back to 443; control it via policy instead.
Port 5938 is in the registered range and has no IANA assignment. The usage above is unofficial but widespread.
sudo ss -tlnp 'sport = :5938'sudo ss -ulnp 'sport = :5938'sudo lsof -nP -i :5938sudo netstat -tlnp | grep ':5938 'netstat -ano | findstr :5938Get-NetTCPConnection -LocalPort 5938 -State Listen | Select LocalAddress,OwningProcessnc -vz -w 5 HOST 5938Test-NetConnection HOST -Port 5938nc -vzu -w 5 HOST 5938sudo ufw deny 5938/tcpsudo iptables -A INPUT -p tcp --dport 5938 -j DROPsudo nft add rule inet filter input tcp dport 5938 dropNew-NetFirewallRule -DisplayName 'Block TCP 5938' -Direction Inbound -Protocol TCP -LocalPort 5938 -Action Blocksudo ufw deny 5938/udpsudo iptables -A INPUT -p udp --dport 5938 -j DROPsudo nft add rule inet filter input udp dport 5938 dropNew-NetFirewallRule -DisplayName 'Block UDP 5938' -Direction Inbound -Protocol UDP -LocalPort 5938 -Action BlockAll port numbers · Open port checker
Assignment data: IANA port number registry (public domain), retrieved 2026-11-10.