Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Windows Firewall: Allow File Sharing Safely

· 5 min read · Home Networking

In this article
  1. What Windows file sharing uses
  2. Enable sharing on a trusted network
  3. Share a folder and control access
  4. Private and public firewall profiles
  5. Fix common connection problems
  6. SMB versions and safer alternatives
  7. Frequently Asked Questions

Yes. Windows Firewall can allow file sharing, and Windows usually creates the needed firewall rules when you enable file and printer sharing for a trusted network. For a home or office network, allow sharing only on the appropriate private network profile—not on public Wi-Fi—and make sure the devices use compatible sharing settings.

What Windows file sharing uses

Windows file sharing commonly uses Server Message Block (SMB), a network protocol for accessing shared folders and printers. On a typical local network, SMB traffic uses TCP port 445. Windows Firewall includes rules for this traffic, so most people should enable the built-in file-sharing setting rather than create a custom port rule.

Allowing traffic through the firewall is only one part of sharing. The computer hosting a folder must have network discovery and file and printer sharing enabled, the folder must be shared, and the person connecting needs permission. A firewall exception does not make every folder accessible or bypass account security.

Enable sharing on a trusted network

In Windows 11, open Settings > Network & internet > Advanced network settings > Advanced sharing settings. Under the profile in use, turn on Network discovery and File and printer sharing. Menu wording can vary slightly by Windows version. In Windows 10, these options are under Settings > Network & Internet > Status > Network and Sharing Center, then Change advanced sharing settings.

Check the network profile before enabling these options. Set a home or otherwise trusted local network to Private if appropriate; keep an untrusted hotel, airport, or café connection set to Public. Windows applies different firewall rules to different profiles. Do not switch a public connection to Private merely to make a device appear in a network list.

To inspect the firewall rules directly, search for Windows Defender Firewall, open Allow an app or feature through Windows Defender Firewall, and look for File and Printer Sharing. Select the checkbox for the network profile where sharing is intended. Administrative rights may be required. The precise interface differs across Windows editions and versions.

Share a folder and control access

After enabling sharing, choose the specific folder to share. In File Explorer, right-click it, open Properties > Sharing, and use Advanced Sharing or the sharing options available in that Windows version. Grant access only to the people or accounts that need it. The sharing permissions and the folder's Security (NTFS) permissions both affect what a network user can do; effective access is limited by the more restrictive combination.

For example, a household might share a folder of photos with a named family account and grant read access, while keeping a folder of personal documents unshared. If Windows asks for credentials, use an account permitted on the computer hosting the folder. Password-protected sharing is generally safer than allowing anonymous access. Avoid granting Everyone full control unless there is a specific, understood need.

Private and public firewall profiles

A firewall profile determines which inbound connections Windows permits under a set of network conditions. A Private profile is intended for networks you trust; a Public profile applies stricter protections on networks you do not. File-sharing rules can be enabled for one profile without being enabled for the other.

This distinction matters because file sharing makes a computer respond to network requests. On a public network, other nearby devices could attempt to contact it. Leave file sharing disabled for Public networks, and do not expose SMB directly to the internet. If remote access is needed, use a properly secured VPN or another managed solution rather than forwarding SMB traffic through a router.

Fix common connection problems

If a shared computer or folder cannot be reached, check the components in order rather than turning off the firewall:

  • Confirm both computers are on the same local network or otherwise have a valid route to each other.
  • On the host, verify that the network is set to Private only when it is trusted, and that Network discovery and File and printer sharing are enabled for that profile.
  • Confirm the folder is actually shared and that the connecting account has suitable sharing and file-system permissions.
  • Test by entering the host name or local IP address in File Explorer, such as \\PC-NAME\SharedFolder. A device not appearing under Network does not necessarily mean its share is unavailable; discovery and direct access are related but distinct.
  • Check whether a third-party security product, organizational policy, router isolation setting, or another firewall is blocking traffic. On a work-managed computer, ask the administrator before changing policy.

Use Windows Firewall's allowed-app list or its built-in sharing controls to correct a rule. Do not disable the firewall as a routine test: doing so removes protection for other kinds of inbound traffic too. If troubleshooting requires a temporary change, restore the firewall and the original profile-specific settings immediately afterward.

SMB versions and safer alternatives

Modern Windows file sharing uses current SMB versions, with security features that depend on the Windows version and configuration. SMB 1.0/CIFS is an obsolete protocol with known security risks and should not be enabled just to support an old device unless there is a necessary, carefully assessed reason. Prefer updating or replacing the device, or using a safer supported transfer method.

For occasional transfers, alternatives include a trusted cloud-storage service, a USB drive, or an organization-approved secure transfer tool. These options may be more suitable when devices are not on the same trusted network. They have their own account, privacy, and security considerations, but avoid making a Windows computer's SMB share reachable from an untrusted network.

Frequently Asked Questions

Which firewall port does Windows file sharing use?
Typical modern Windows SMB file sharing uses TCP port 445. In most cases, enable Windows' built-in File and Printer Sharing rules instead of adding a broad, custom inbound rule.

Should I allow file sharing on a public network?
No. Keep sharing disabled for Public networks such as café or airport Wi-Fi. Enable it only on a network you trust, and use the Private profile only when that classification is appropriate.

Does allowing file sharing make all my files visible?
No. Only shared locations are offered for network access, and users still need appropriate permissions. Review both the share permissions and the folder's Security permissions.

Why can I access a computer by name but not see it under Network?
Network browsing and direct SMB access are not the same thing. Discovery settings or network discovery services may affect whether a computer appears in the list even when a direct path such as \\PC-NAME\Share works.

Can I turn off Windows Firewall to make sharing work?
That is not a safe fix. Check the network profile, built-in sharing rules, folder permissions, and network connectivity instead. If the device is managed by an organization, contact its administrator.