CIFS, SMB and NFS are protocols. And Samba is an implementation of SMB protocol on Linux OS.

SMB (Server Message Block)

SMB is a network protocol created by IBM for the share of resources (files and printers) in local networks. It became popular when Microsoft integrated it as the default resources sharing protocol in windows.

CIFS (Common Internet File System)

Microsoft integrate SMB in its OS windows NT4, and for marketing reasons renamed it CIFS.

Microsoft has added some improvements to the original SMB protocol.

SMB again

But the next version of CIFS was renamed SMB again (since windows 2000 / XP / server 2003). It is known as SMB version 1 (because its version 1 of SMB on windows environments).

Currently we are in version 3.1.1 of SMB.

SMB as CIFS, is intended to be use in local networks (SMB is not intended to use over internet for security reasons).

Samba

Samba is an implementation of the SMB (Server Message Block) protocol written for UNIX.

Samba client, mount windows filesystem on your Linux host or access a windows printer

Then with samba client you can access windows resources from your Linux host.

For example you can mount a windows filesystem on your linux host with a command like this:

$> mkdir /mnt/nas
$> mount -t cifs \\your_nas.yourdomain.com\folder /mnt/nas -o domain=yourdomainname,username=youruser,password=userpass,uid=1001,gid=1001,vers=2.1

it’s important to notice here the “vers=2.1” it tells that we want to use the version 2.1 of SMB because we know that our NAS has not the SMB 3 available. And our Linux OS (since linux kernel 4.13) uses SMB3 by default.

Samba server

Allow access to Linux resources from your windows host.

Security: never activate SMBv1

Never activate SMBv1, because there is a famous vulnerability that was known to be exploited by the ransomware Wannacry.

Before linux kernel 4.13 it was SMB version 1 that was used, but since 4.13 it is SMB version 3.

Since windows 10 and windows server 2019, SMB1 and CIFS are disabled by default.

NFS

NFS is the equivalent of SMB but was created for UNIX initially.

you can use SMB for the share of resources between linux hosts but it’s not appropriate because NFS has a really better performance over SMB.

NFS is intended to be used on local networks (but not over internet, for security reasons).