Network file sharing between Linux and OS X

file-sharingmountnetworkingnfssamba

I want to share a drive/folder over the internet from my Debian machine back home, such that I can mount it on my Macbook when I am on the move. Basically I want to store my music at home and just access it over the network, instead of having two separate libraries, one on each computer. I will not go into why I would prefer a shared drive as opposed to a streaming application (that would be another question). What I want to know is, what do you think would be the best and/or easiest way to do this? NFS? Samba? Are there security risks involved, since I want to share over a public network as opposed to sharing over LAN, and if so, what are they?

[Update]
The answers indicated I should use sshfs, since it is easy to set up and uses an already established ssh connection. I have tried this, but I am having bad latency problems on file access. In other words, the transfer speed is ok, but applications have to wait until the file is fully downloaded to access it. This is very inconvenient behavior: if I try and play music off the mounted drive I will have about 20 seconds of pause before every song.

Now, I have tested the same setup on a linux machine on the same network as the OS X machine. The latency problem is almost non-existent, that is I cannot distinguish it from regular throughput bottle necking. This makes me think it is an OS X specific issue. Which brings me back to my original question: what is a good way to mount a remote folder that's on a linux server under an OS X client?

Best Answer

An SSH server with SFTP service (which comes standard in most SSHD installs), it's also a platform independent solution.

The setup is easy:

sudo apt-get install ssh

should fill in any of the server-side gaps you'd need.

On your router, you'd want to map port 22 to the hosting machine, or you could reconfigure SSHD to listen on a different or additional port, and then forward that instead.

You might also have to modify that machine's firewall policy, if you are using one.

Also, bear in mind that if serving from your home connection, the speed will be limited to your home connection's upload speed. For music, that may not matter, but for video, it would probably choke.

Related Question