Skip to content
Look up and open a port

Port 445: Understand and secure the SMB port

Port 445 (TCP) is the port for SMB, the protocol behind Windows file sharing and Samba. The tool shows you the service, protocol, and security guidance, and provides suitable firewall commands.

Built by Justin Schuessler

Try the commands on your own VPS, with root access and your own firewall.

Add multiple ports one at a time, up to 12.

Or choose a preset

Ports

445/TCPSMB

File transfer · Well-known port · OSI layer 7

Windows file sharing and Samba. Use only on a local network or over a VPN.

IANA: officially registered as microsoft-ds

Do not expose it to the internet: Worms such as WannaCry spread via SMB. Use file shares only on the local network or over a VPN.

Firewall rule (inbound)

At least one port should not be open to everyone. Choose “Specific IP” instead.

Firewall commands

Open port

sudo ufw allow 445/tcp
Check port
Notes on ufw

For Ubuntu and Debian. ufw creates the rule for both IPv4 and IPv6. If ufw is disabled, allow SSH first (sudo ufw allow 22/tcp), then enable it with sudo ufw enable, or you'll lock yourself out.

On a ZAP-Hosting VPS with an active network firewall, you also need to allow the port in the Customer Panel.

Port 445 explained

What is port 445 used for?

Purpose

Port 445 carries network file and printer sharing using the Server Message Block (SMB) protocol. Windows uses it for network drives, access to shared folders and many functions in an Active Directory domain. On Linux, Samba provides the same service so Windows clients can access shares. Here, SMB runs directly over TCP without the older NetBIOS layer.

Origin and standard

SMB originated in the 1980s and ran over NetBIOS on ports 137 to 139 for many years. Since Windows 2000, SMB has been able to run directly over TCP on port 445, which IANA lists as “microsoft-ds”. Microsoft documents the current protocol versions, SMB 2 and SMB 3, in the MS-SMB2 specification. Port 445 became widely known in 2017 because of the WannaCry ransomware, which spread rapidly through the EternalBlue vulnerability in SMBv1.

Typical use

  • Network drives and shared folders on company or home networks
  • Samba shares on a Linux server for Windows clients
  • Authentication and Group Policy in an Active Directory domain
  • Remote access to file shares over a VPN

Security

Port 445 should never be accessible from the internet. Exposed SMB shares are common targets for automated scans, password attacks, and worms, as WannaCry demonstrated. Many ISPs block port 445 for this reason. If you need to access shares remotely, use a VPN such as WireGuard and only allow port 445 on your internal network. Also disable the outdated SMBv1 protocol and keep Windows and Samba up to date.

More ports

Related ports

These ports are often part of the same setup. Click one to see its explanation and firewall commands.

View all well-known ports and the complete IANA list

Port list source: IANA Service Name and Transport Protocol Port Number Registry, as of October 22, 2026. iana.org

Discover more

More tools

FAQ

Frequently asked questions

Quick answers about port 445.

Port 445 is the default port for SMB, used for Windows file shares, network drives, and shared printers. Samba on Linux uses it too. IANA names the service “microsoft-ds”.

Yes, if you open it to the internet: SMB is constantly scanned and attacked. The port is fine on a local network or over a VPN. After making a change, check that port 445 cannot be reached from outside.

Many ISPs filter port 445 because worms such as WannaCry have spread through it. This protects unsecured computers from internet attacks. For remote access to shares, a VPN is the better option anyway.

With ufw, restrict the rule to a source network, for example: sudo ufw allow from 192.168.1.0/24 to any port 445 proto tcp. The port will then remain closed to the internet. On Windows, you can also use the RemoteAddress parameter in New-NetFirewallRule to allow only specific networks.

Any more questions?

Contact Support
Your own server?

Try the commands on your own VPS

With a ZAP-Hosting VPS, you have root access, can set up services and firewall rules yourself, and can immediately see which ports are open.

4.4/5 Trustpilot32,000+ Active serversSince 2010

No setup. No risk. Online in seconds.

Flexible TermCancel anytimeOnline in 60 seconds

Looking for more tools? View all network tools