NFS vs SAMBA vs CIFS

NFS, SAMBA, and CIFS are three different terms that get thrown around a lot whenever someone mentions file sharing between two or more systems. But, do you know what these three implementations do, and how they do it differently from one another? For some reason these technologies remain in a shroud of mystery to even some seasoned system administrators.

In reality, each of the three have some defining characteristics that make them different, and none of them are very hard to understand. In this article, we will go into detail about NFS, SAMBA, and CIFS, and talk about their implementation in the context of a Linux system. We’ll also weigh the pros and cons of these three technologies so you can decide which one fits best inside your network.

In this tutorial you will learn:

  • A comparison of NFS, SAMBA, and CIFS
  • How to install NFS and SAMBA on Linux
NFS vs SAMBA vs CIFS

NFS vs SAMBA vs CIFS
Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Any Linux distro
Software NFS, SAMBA, CIFS
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command

$ – requires given linux commands to be executed as a regular non-privileged user

NFS vs SAMBA vs CIFS



Let’s start with Samba and CIFS. Both of these implement SMB (Server Message Block) protocol, which was created by Microsoft. Samba and CIFS are both able to communicate with each other as they both do the same thing, only in different ways. Unless you’re working with legacy systems, you should stick with Samba. Samba is more up to date, robust, and faster.

So, the decision here is real easy. If you need to maintain compatibility with Windows computers, then use Samba. If it doesn’t work for your environment because you’re using outdated systems, then you may be stuck with CIFS. And that may cause you some headaches, since Samba servers can act as a Domain Controller and CIFS servers cannot. This allows Windows users to use their credentials with the Samba server, rather than needing to duplicate an entire set of users from Windows to Linux in the case of CIFS.

NFS works quite similarly to Samba – they both allow one or more clients to share files with a server. But there’s one glaring caveat: NFS and SMB aren’t compatible protocols. This means that a Samba server won’t be able to communicate with an NFS server, at least not without some tweaking. NFS was developed by Sun Microsystems, but Windows Server is capable of hosting NFS shares, and other Windows operating systems are capable of connecting to it. Of course, Linux systems can also host or connect to NFS shares.

The obvious conclusion we can draw from this is that NFS works great for Linux environments and Samba works better for Windows environments or mixed environments (Linux + Windows). If your storage server is Linux, go with NFS. If it’s Windows, stick with Samba. That should give you the most ideal setup and best performance, although it’s definitely possible to run either one.

Installing Samba on Linux

To get started using Samba on Linux, use the appropriate command below to install the software on your system.

On Ubuntu, Linux Mint, and other Debian-based distros:

$ sudo apt install samba


On Fedora, CentOS, AlmaLinux, and other RHEL-based distros:

$ sudo dnf install samba samba-client

Installing NFS on Linux

To get started using NFS on Linux, use the appropriate command below to install the software on your system.

On Ubuntu, Linux Mint, and other Debian-based distros:

$ sudo apt install nfs-kernel-server

On Fedora, CentOS, AlmaLinux, and other RHEL-based distros:

$ sudo dnf install nfs-utils

Closing Thoughts

In this guide, we went over the basics of NFS, SAMBA, and CIFS. This should help you make a decision on which file sharing technology works best for your network environment. Once you’re ready to get started, we’ve given you the proper commands to install the software on your system. From there, you will need to configure NFS or SAMBA to complete the setup and start file sharing.



Comments and Discussions
Linux Forum