SMB

SMB port guide: file sharing on port 445

Understand how SMB uses TCP 445, when it should be reachable, how to test file-share access, and why public SMB exposure needs strict controls.

Default port
445
Protocol
TCP
Primary use
File sharing and directory services

What is the SMB port?

SMB, or Server Message Block, is the protocol behind Windows file sharing, printer sharing, many NAS devices, and Samba shares on Linux. Modern SMB usually listens on TCP port 445, where clients authenticate and access shared folders, named pipes, and domain resources.

  • Port 445 is the modern SMB port

    Windows, Active Directory environments, Samba servers, and NAS appliances typically use TCP 445 for direct SMB traffic.

  • SMB is usually private infrastructure

    SMB is powerful inside trusted networks, but exposing it directly to the internet is high risk because file shares are heavily scanned and frequently abused.

How SMB works

SMB lets clients browse shares, read and write files, lock files, use printers, and access named pipes over the network. A client connects to the SMB server, negotiates the SMB dialect, authenticates with local, domain, or directory-backed credentials, and then requests access to a specific share.

Modern deployments should use SMB 2 or SMB 3. SMB 1 is obsolete and should be disabled unless a tightly isolated legacy dependency truly requires it. SMB 3 can support signing, encryption, multichannel performance, and better resilience, but those features still depend on correct server and client policy.

SMB vs Samba vs NetBIOS ports

SMB is the protocol. Samba is an open-source implementation that lets Linux and Unix-like systems provide SMB file shares and integrate with Windows networks. On Windows, SMB is built into the operating system and exposed through File and Printer Sharing features.

Port 445 is direct-hosted SMB and is the main port to check for modern file sharing. Older NetBIOS-based SMB can involve UDP 137, UDP 138, and TCP 139. Those legacy ports are different from direct SMB on 445, and they should normally remain closed unless you have a specific older network requirement.

Should SMB be open to the internet?

In most cases, no. SMB should stay on private networks, VPNs, site-to-site tunnels, zero-trust access paths, or tightly scoped source-IP allowlists. Public SMB exposure invites password spraying, share enumeration, ransomware staging, and exploitation of outdated systems.

If a remote user needs file access, prefer a VPN, managed file-transfer service, cloud file gateway, private endpoint, or web-based document platform. If an external partner must reach SMB, restrict the source network, require strong identity controls, monitor every connection, and avoid broad write permissions.

Before opening port 445

Before you allow TCP 445, confirm that a real SMB service is listening and that the shares, users, groups, and permissions match the intended workflow. Decide whether guest access is disabled, whether SMB signing or encryption is required, and whether older dialects such as SMB 1 are blocked.

A port checker can tell you whether TCP 445 is reachable from outside the network, but it cannot prove that a user can access a share safely. Use SMB client tests and server logs to validate authentication, share-level permissions, NTFS or filesystem ACLs, and audit policy.

How to enable SMB on Windows, Linux, and NAS devices

On Windows Server or Windows Pro, enable File and Printer Sharing or the File Server role, create the share, set share permissions and filesystem ACLs, and allow inbound TCP 445 in Windows Defender Firewall. Domain environments should use groups instead of assigning permissions to individual users.

On Linux, install and configure Samba, define shares in smb.conf, create or map users, and allow TCP 445 through ufw, firewalld, nftables, or your cloud security group. For mixed environments, confirm name resolution and authentication integration before exposing the share to users.

On NAS appliances, enable SMB only for the networks that need it, disable guest shares unless they are intentional, and keep firmware current. Many NAS security incidents come from internet-exposed management interfaces and file-sharing services that were never meant to be public.

  • Service layer: Windows File Server, Samba, or NAS SMB service must be running and listening on TCP 445.
  • Network layer: host firewalls, router rules, VPN policies, cloud firewalls, and network segmentation must match the intended access path.
  • Identity layer: use named users or groups, disable guest access, require strong passwords or directory-backed authentication, and remove stale accounts.
  • Data layer: review share permissions, filesystem ACLs, encryption requirements, backups, and restore procedures before allowing write access.

How to test SMB port 445

Start with an external port check against the hostname or IP address and port 445. If the result is open, a remote client can reach the SMB listener. Then test the actual share with a Windows UNC path such as \\server\share, smbclient on Linux, or a file manager that supports SMB.

On the server, confirm the listener with PowerShell, netstat, ss, or your NAS status page. If the port is open but share access fails, inspect credentials, domain trust, share permissions, filesystem ACLs, SMB dialect policy, signing requirements, and server event logs.

Test port 445 for SMB

Common SMB troubleshooting cases

If port 445 is closed, the SMB service may be disabled, blocked by the host firewall, bound only to a private interface, or hidden behind a VPN path. If the connection times out, a router, cloud firewall, ISP, corporate egress policy, or source-IP allowlist may be dropping the traffic.

If port 445 is open but users cannot access a share, check the exact share name, username format, domain membership, clock sync, password state, NTFS or POSIX permissions, guest restrictions, and SMB signing or encryption policy. Many SMB failures are permission or identity issues rather than port issues.

Security checklist for SMB

Keep SMB off the public internet whenever possible. Disable SMB 1, require strong authentication, remove guest access, apply least-privilege permissions, and patch Windows, Samba, and NAS firmware quickly. For sensitive shares, require SMB signing or encryption where performance and client support allow it.

Back up shared data, test restores, log access to sensitive folders, and alert on unusual write volume, failed logins, or access from unexpected networks. If SMB must cross sites, carry it over a VPN, private circuit, or zero-trust access layer instead of raw internet exposure.

Frequently asked questions

What port does SMB use?

Modern SMB usually uses TCP port 445. Older NetBIOS-based SMB may also involve UDP 137, UDP 138, and TCP 139, but port 445 is the main port for direct SMB file sharing.

Is it safe to open port 445?

Opening 445 to trusted private networks is common. Opening it to the public internet is high risk and should be avoided unless access is tightly restricted, monitored, patched, and backed by strong authentication.

Is Samba the same as SMB?

No. SMB is the file-sharing protocol. Samba is an implementation of SMB commonly used on Linux and Unix-like systems so they can serve or join Windows-style file-sharing environments.

Why is port 445 open but the share still fails?

The network path may work while authentication, permissions, SMB dialect policy, signing requirements, or filesystem ACLs block access. Check server logs and test with an SMB client, not only a port checker.