camzabriskie.com

Primers › Networking

Network file shares

10 / 10 updated Oct 12, 2026
On this page
  1. A few terms
  2. Where the file system lives: NAS, SAN, and local disks
  3. SMB
    1. Keep port 445 off the internet
  4. NFS
  5. Which way the connections go
  6. Checking it from a client
  7. References

Two colleagues on the same team need the same files: one saves a spreadsheet, and the other opens it a minute later from a different computer. The usual answer is a network file share, a shared folder on a storage box on the office network that both of their computers can open. Nobody emails attachments back and forth, and each computer’s access to the folder is a network connection with a port and a direction.

The example below follows one setup through the whole primer:

A few terms

Where the file system lives: NAS, SAN, and local disks

Storage comes in three broad shapes, and the useful difference between them is which machine runs the file system:

Local disk (DAS)SANNAS
Stands forDirect-attached storageStorage area networkNetwork-attached storage
ConnectedStraight to one machine, not to the networkOver a separate storage networkOver the ordinary network
What travels between themDisk blocks, inside the machineDisk blocksWhole files and folders
Who runs the file systemThe machineEach server using a volumeThe NAS
Typical protocolsA cable straight to the machineFibre Channel, iSCSISMB, NFS
Typical useOne server’s own storageDatabases, virtual machine storageShared folders, home drives, team data

Sources for the table: TechTarget’s comparison of the three [4] and SNIA’s definition of a NAS [3].

A SAN hands out raw disk space, called block storage, and the server that uses it formats it with its own file system, so to that server it looks like a local disk. A NAS keeps the file system to itself and hands out files. That’s why a NAS is the one to reach for when several machines need the same folder: they all send requests like “open budget.xlsx” to the NAS, and the NAS sorts out names and permissions in one place. The rest of this primer is about NAS-style sharing, SMB and NFS.

SMB

SMB is how Windows shares files: when you open \\server\share or map a network drive, the machine’s SMB client opens a connection to the SMB server on the other end [1]. A Windows PC, a Windows server, or a NAS can all be SMB servers, and Linux and macOS machines can be SMB clients or servers too. On Linux that’s usually Samba, an open-source implementation of SMB [5].

Keep port 445 off the internet

In 2017 the WannaCry ransomware spread between machines by connecting to TCP port 445 and exploiting a vulnerability in SMB version 1, and CISA’s advice at the time was to block SMB at the network boundary, port 445 and the old NetBIOS ports with it [9]. Microsoft gives the same advice today in both directions: block TCP 445 inbound from the internet, and outbound to the internet too, unless a specific cloud service needs it [6]. A file share that has to be reached from somewhere else is reached over a VPN or another private connection (reaching private resources covers the options), never by opening 445 to the world. Microsoft also says to remove SMB 1.0 wherever it’s still installed [8].

NFS

NFS is the Unix side’s equivalent. A Linux machine mounts an export, a folder the NFS server shares, into a local folder, and from then on programs use it like any other directory. The line in /etc/fstab that mounts one at boot looks like this [10]:

nas01.example.com:/exports/team  /mnt/team  nfs  defaults  0 0

Which way the connections go

Arrows point from the machine that opens each connection. Both PCs connect to the NAS, and the NAS never connects to either of them.

Each arrow is one connection, opened by the machine at its tail to a port on the machine at its head, and the replies come back over that same connection. Written out one row per connection:

FromToPortWhy
pc01nas01TCP 445Save and open files over SMB
pc02nas01TCP 445, or TCP 2049 for NFSSave and open the same files

The NAS only ever answers. If anything sits between these machines that filters traffic, those two rows are all it needs to allow.

Checking it from a client

First check that the port is reachable at all, before worrying about permissions. On pc02, nc -z tries to connect without sending anything [11]. On Windows, Test-NetConnection has a shortcut for the SMB port [12]:

macOS / Linux

nc -vz nas01.example.com 445

Windows (PowerShell)

Test-NetConnection nas01.example.com -CommonTCPPort SMB

Then mount the share. On Linux, mount -t cifs mounts an SMB share and username= sets the account [13]. On Windows, New-SmbMapping maps it to a drive letter, and -RequirePrivacy $true insists on SMB encryption [7], [8]:

Linux

sudo mount -t cifs //nas01.example.com/team /mnt/team -o username=pc02user

Windows (PowerShell)

New-SmbMapping -LocalPath R: -RemotePath \\nas01.example.com\team -RequirePrivacy $true

To see which shares a server offers before mounting anything, smbclient -L lists them, with -U for the account to ask as [14]:

smbclient -L nas01.example.com -U pc02user

If the port check fails, the problem is the network path, or something on it blocking the port. If it succeeds and mounting fails, the problem is the account, its permissions on the share, or an encryption or version setting the two ends can’t agree on.

References

Show all 14 sourcesHide sources
  1. [1] ↩ a b c d Microsoft, “What is SMB file sharing for Windows and Windows Server?” Windows Server Documentation. Accessed: Oct. 12, 2026. [Online]. Available: https://learn.microsoft.com/en-us/windows-server/storage/file-server/file-server-smb-overview
  2. [2] ↩ a b c T. Haynes and D. Noveck, “Network File System (NFS) Version 4 Protocol,” RFC 7530, Internet Engineering Task Force, Mar. 2015. Accessed: Oct. 12, 2026. [Online]. Available: https://www.rfc-editor.org/rfc/rfc7530
  3. [3] ↩ a b SNIA, “Network attached storage (NAS),” SNIA Online Dictionary. Accessed: Oct. 12, 2026. [Online]. Available: https://www.snia.org/education/online-dictionary/term/network-attached-storage
  4. [4] ↩ R. Castagna, “NAS vs. SAN vs. DAS: Key differences and best use cases,” TechTarget, May 2026. Accessed: Oct. 12, 2026. [Online]. Available: https://www.techtarget.com/searchstorage/answer/The-difference-between-SAN-and-NAS
  5. [5] ↩ The Samba Team, “Samba: Opening Windows to a Wider World.” Accessed: Oct. 12, 2026. [Online]. Available: https://www.samba.org/
  6. [6] ↩ a b Microsoft, “Secure SMB traffic in Windows Server,” Windows Server Documentation. Accessed: Oct. 12, 2026. [Online]. Available: https://learn.microsoft.com/en-us/windows-server/storage/file-server/smb-secure-traffic
  7. [7] ↩ a b Microsoft, “New-SmbMapping,” Windows PowerShell Documentation (SmbShare). Accessed: Oct. 12, 2026. [Online]. Available: https://learn.microsoft.com/en-us/powershell/module/smbshare/new-smbmapping
  8. [8] ↩ a b c Microsoft, “SMB security enhancements,” Windows Server Documentation. Accessed: Oct. 12, 2026. [Online]. Available: https://learn.microsoft.com/en-us/windows-server/storage/file-server/smb-security
  9. [9] ↩ CISA, “Indicators Associated With WannaCry Ransomware,” Cybersecurity and Infrastructure Security Agency Alerts, May 2017. Accessed: Oct. 12, 2026. [Online]. Available: https://www.cisa.gov/news-events/alerts/2017/05/12/indicators-associated-wannacry-ransomware
  10. [10] ↩ a b c The Linux man-pages project, “nfs(5),” Linux manual pages. Accessed: Oct. 12, 2026. [Online]. Available: https://man7.org/linux/man-pages/man5/nfs.5.html
  11. [11] ↩ OpenBSD, “nc(1): arbitrary TCP and UDP connections and listens,” OpenBSD manual pages. Accessed: Oct. 12, 2026. [Online]. Available: https://man.openbsd.org/nc.1
  12. [12] ↩ Microsoft, “Test-NetConnection,” PowerShell NetTCPIP module reference. Accessed: Oct. 12, 2026. [Online]. Available: https://learn.microsoft.com/en-us/powershell/module/nettcpip/test-netconnection
  13. [13] ↩ The Linux man-pages project, “mount.cifs(8),” Linux manual pages. Accessed: Oct. 12, 2026. [Online]. Available: https://man7.org/linux/man-pages/man8/mount.cifs.8.html
  14. [14] ↩ The Samba Team, “smbclient(1),” Samba manual pages. Accessed: Oct. 12, 2026. [Online]. Available: https://www.samba.org/samba/docs/current/man-html/smbclient.1.html

Every source cited across the primers is collected on one page.