What is Samba, and how is it used in Linux systems?
ELI5 : What is the difference between SMB, CIFS and Samba? And NFS, if you want.
which file server that is secure, easy, fast, stable, reliable, accessible from every devices? (no seafile, no nextcloud)
Is there any way to mount windows or linux shared folder?
Videos
Hi r/homelab ,
I was reading a magazine, and they were talking about SMB 3.0. They introduced it by talking of the firsts versions and CIFS.
And later, in the same magazine, they were talking about Samba.
I always tought that SMB/Samba/CIFS were all the same file sharing protocol (Samba being the Windows version of CIFS).
And if you can also explain what is NFS vs CIFS/SMB/samba, that would be appreciated too!
Thank you,
u/webtroter
CIFS/Samba and NFS are profoundly different protocols with different implementations. Of course there may be reasons to prefer CIFS over NFS in certain scenarios, sometimes even out of performance considerations (CIFS offers more intelligent caching support through the use of oplocks whereas NFS lacks such a mechanism). The reasons for preferring Samba over the NFS implementation in a pure Linux environment obviously would need to be carefully weighted, but may be valid nonetheless.
For the general use, I would quote from the conclusion of a paper by one of the Samba team members, which also offers a lot of information comparing these two protocols:
With current Linux kernels, NFS version 4 and CIFS (cifs client/Samba server) are good choices for network file systems for Linux to Linux. NFS performance for large file copy workloads is better, and NFS offers some security options that the Linux cifs client does not. In heterogeneous environments that include Windows clients and servers, Samba is often much easier to configure.
in a pure Unix/Linux network without any Windows clients or servers?
Be carefull that this is true - and stays so.
As in: No people coming from outside with laptops, no small devices that can deal with a windows share but not anything else. Example? I recently installed a computer. I COULD have mounted the ISO file in the KVM from a windows share, but not from anything else - so I did use the mapping from my browser via Java remotely, but just to make the point: a lot of stuff supports windows style file shares, and you can be "all linux" as you want, when you call your supplier and get them reprogram a firmware you do not look smart.
Then there are external people that may come in and have Windows installed.
Is Microsoft's network filesystem so good?
From the perspective that it is everywhere, then yes it is good. If you are asking if it is a good protocol, then the answer is that it isn't really all that great. It has large problems on links with high latency. It has far too many redundant commands. Microsoft has fixed a lot of this with SMB2.
Linux systems defaulting to this Microsoft technology?
There are lots of users who require that their Linux boxes be able to participate in a heterogeneous network. SMB is the lowest common denominator that seems to be supported on all common operating systems.
What would be a Linux-native way to share files and printers
NFS is probably the most standard *nix file sharing protocol.
LPR or CUPS is the most common Printing protocol.
Personally I strongly wish that webdav would become more common for file sharing. But I have yet to find a really good webdav daemon for *nix.
The big 2 file sharing systems for Linux are NFS and SAMBA. We run both here for different reasons. Here is an off-the-top-of-my-head pro/con list
NFS
- + Server-To-Server
- + Fast
- + Easy to set up for a small number of users
- + Very dependable for clustering/High Availability
- - Each client machine needs its own config in /etc/exports
- - Very limited security options.
- - Users must match on both server and client to preserve unix permissions
- - Symlinks to content outside of the share will fail, or worse use a same-named resources on the client
SAMBA
- + Server-To-User
- + Very flexible configuration
- + Ability to use per-user authentication against Active Directory, LDAP, local users, samba users
- + Compatibility with most other OSs
- + Ability to share printers
- + Ability to save files with arbitrary permissions.
- + Optionally supports full UNIX permissions
- + Ability to make symlinks to resources outside of the share appear to be inside the share. For example to re-export a mounted share.
- - Slightly higher overhead than NFS
- - Flexible config is easy to screw up
- - Caching/locking issues. If not all users are using samba to access the files, some users might not see changes to files
- - Microsoft Issues. MS likes to "improve" the spec every few years, so future windows desktop client may not be able to connect to your Samba server. The Samba team is good about keeping up with MS, but you have to be aware of this