Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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?

share|improve this question
1  
Samba and NFS exposed to the internet both seem a bit unwise. A secure protocol is probably best if you're hosting the files yourself. –  killermist Jun 22 '12 at 20:39
1  
What if I were to tunnel the traffic through ssh? –  vlsd Jun 22 '12 at 20:44
1  
You could potentially do nfs or samba sharing across an SSH tunnel, but sftp protocol is sufficiently integrated in most systems that it is probably easier than tunneling and then using a different protocol. –  killermist Jun 22 '12 at 20:46
1  
A lot of Linux/Mac filemanagers will often include an option to connect to an SSH server. I don't even know the name of the filemanager that was installed with Linux Mint (Debian), but it includes the option very easy to access. –  killermist Jun 22 '12 at 20:51
add comment

2 Answers

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.

share|improve this answer
    
Can I mount a remote FTP folder such that it looks exactly like a local folder to local applications? I was under the impression that, to access files on an ftp server, I need to first download them to a local folder. –  vlsd Jun 22 '12 at 20:35
1  
try to read this and see if it helps google.it/search?q=mac+os+mount+sftp+as+disk –  user827992 Jun 22 '12 at 20:37
    
Most FTP mounts do use local storage for temporary files instead of acting directly. And FTP is definitely less secure than SFTP. –  killermist Jun 22 '12 at 20:38
1  
Just telling people to google it is pretty useless, but the suggested edit helps a lot –  Michael Mrozek Jun 22 '12 at 20:58
    
@michael-mrozek i suggested to go with Google for a step by step guide, aka a tutorial, i don't think that the edited text added something relevant to the case. It's just the fact that you can't write a guide for SSH servers in a single post. –  user827992 Jun 22 '12 at 21:05
show 3 more comments

Adding to answer above (agree with SSH to implement this), the Dokan SSH libraries will help you mount SFTP folders in Windows, making SFTP a complete solution.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.