Port 139: NetBIOS Session

Port 139 (TCP) is used by NetBIOS Session. File sharing over NetBIOS (SMB 1 era). Modern SMB uses 445.

139Port
TCPProtocol
netbios-ssnIANA service name
Windows networkingCategory

Port range

139 is a well-known (system) port (range 0–1023). On Linux and macOS, binding to it traditionally needs root or the CAP_NET_BIND_SERVICE capability.

Security

Port 139 should not be reachable from the public internet. Restrict it to trusted networks or a VPN, and scan your public IP to confirm it is closed.

Open port 139 in a firewall

ufw         sudo ufw allow 139/tcp
iptables    sudo iptables -A INPUT -p tcp --dport 139 -j ACCEPT
firewalld   sudo firewall-cmd --permanent --add-port=139/tcp
Windows     New-NetFirewallRule -DisplayName "NetBIOS Session 139" -Direction Inbound -Protocol TCP -LocalPort 139 -Action Allow

Check if port 139 is open

nc -vz example.com 139
Test-NetConnection example.com -Port 139   # PowerShell
sudo ss -tulpn | grep ':139 '   # what is listening locally (Linux)

Other windows networking ports

Frequently asked questions

What is port 139 used for?
NetBIOS Session. File sharing over NetBIOS (SMB 1 era). Modern SMB uses 445.
Is port 139 TCP or UDP?
TCP.