SSH vs SMB vs NFS for GUI file transfer

19,852

Solution 1

You are right, SMB is something coming originally from Windows. But nowadays it works great with Linux and Mac as well.

Since speed is important, you have to keep in mind: SSH is a great thing for everything connected to Unix/Linux and networks, but it is really slow compared to NFS, FTP or SMB.

NFS is the fastest, but it is not encrypted. Do not use any unencrypted protocols if you can't fully trust your network (see also this Q&A). NFS should be available for Windows and Mac too, but it might be a bit of work to set it up.

SMB should be easy to set up on Windows, Linux and Mac and it is still reasonable fast compared to SSH. But the same warning about security holds for SMB (see this Q&A).

Some similar questions were discussed here.

There are also [many benchmarks] about the speed of different network protocols out there.

Solution 2

NFS is easy to set up, fast, and easy to use, but is not designed for security (plaintext file transfers). You might want to look at sshfs, which can be used to create mount points similar to NFS but in a secure way, and in my own humble testing had similar performance to NFS. sshfs can be used to locally access any folder you can access on another system over the network which has an SSH server running. Also, sshfs operates in user space so you don't need to be root to set it up.

Getting either of these to work on Windows will probably be challenging, but both will work on Mac.

The SMB protocol has always seemed clunky to me, so I haven't used it much, but I understand that Samba's implementation is solid. I can't speak to it's performance or ease of use in general.

Solution 3

Popular file hosting protocols are such few: NFS, SMB, SFTP, FTPS, WebDAV.

Classify the file hosting services in 2 dimension:

  • Serving range
  • Data's legal ownership

In the dimension of serving range, they are categorized into

  • LAN service
  • Internet service

In the dimension of data ownership, they are categorized into

  • Public service
  • Private service

Private service means the users own the server's address.

Private service Public service
LAN service Synology NAS; AWS EFS;
Internet service AWS S3; Alibaba OSS; OneDrive; iCloud;

Which protocol should be used depends on which category of the file hosting service you are providing.

Public Internet service

  • SMB and NFS don't support unlimited transferring buffer or unlimited slide window, so they have a bad performance on high latency network, e.g. the Internet.
  • FTPS doesn't support range reading. It can specify the beginning byte of a read operation, but cannot specify the ending byte. So when you are watching a stream video over FTPS, the player has to buffer the entire file, which may exceeds the memory.
  • SFTP is built over SSH rather than TLS, so a client cannot authenticate the server automatically by the OS's built-in CAs. As a service provider, you cannot guarantee your users connect to your genuine server rather than a hacker's server.

So, the only choice has to be WebDAV.

Private Internet service

  • SMB and NFS don't support unlimited transferring buffer or unlimited slide window, so they have a bad performance on high latency network, e.g. the Internet.
  • FTPS doesn't support range reading. It can specify the beginning byte of a read operation, but cannot specify the ending byte. So when you are watching a stream video over FTPS, the player has to buffer the entire file, which may exceeds the memory.
  • WebDAV can range read, but cannot range write.

So, SFTP is the best choice.

Private LAN service

  • FTPS doesn't support range reading. It can specify the beginning byte of a read operation, but cannot specify the ending byte. So when you are watching a stream video over FTPS, the player has to buffer the entire file, which may exceeds the memory.
  • WebDAV can range read, but cannot range write.
  • The most popular version of SFTP (v3) cannot lock files on the server.

So, SMB/NFS is the best choice.

GUI

Every protocol can have a GUI on any OS, because you can mount it to a directory and access it with your native file manager application.

Share:
19,852

Related videos on Youtube

HarlemSquirrel
Author by

HarlemSquirrel

Updated on September 18, 2022

Comments

  • HarlemSquirrel
    HarlemSquirrel over 1 year

    I am using Ubuntu 12.04 on many computers at my school (I am a teacher and the head tech dude). I use Clonezilla to massively clone desktops and laptops. I want to easily share the disk images between computers in order to back things up.

    I tried sharing over our wireless network using samba, and I did get it to work, but it was painfully slow trying to transfer 3GB+. It was much faster over the wired network, but I still had connectivity issues. Correct me if I'm wrong but I understand that samba is based on a windows standard, and that SSH is more Linux-native. My experience with samba has not been favorable so far.

    NFS seems to have more features than samba. I think this is what Mac OS uses by default.

    So, my question is: what is the best GUI way to share files between two Ubuntu machines with the following priorities in descending order:

    1. speed
    2. free and open source
    3. easy setup
    4. compatible with Windows and Mac OS