Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Here is my current setup:

I connect on a DSL line using SSH to a remote linux box with samba installed. I create a tunnel by forwarding port 139 on my local linux box. I then use smbmount to access files on the remote box.

Unfortunately the connection is sometimes slow and it makes software having opened files to hang. It is quite annoying.

I was wondering if there is a way to automatically cache files locally to avoid thoses hungs? It could be using smb, SSHFS or even NFS if one has a good setup for doing this. I just need to connect using SSH.

share|improve this question

SSHFS has options for tweaking its caching - see its man page (there are options both for SSHFS and for FUSE). Another option is NFSv3 over SSH/VPN or NFSv4 which can provide encryption on its own.

However, if you are using the server mostly to have your data stored in a reliable location, you could keep the files locally as well and rsync (over ssh) from time to time (it uses a delta-transfer algorithm thus saving bandwidth). In other words create the cache yourself and flush it when necessary. You can put the local copy on an encrypted partition if security is concern and you have full rights to the workstation in question (also remember to encrypt the swap in that case).

share|improve this answer
Just switching to SSHFS provides a better usability on SMB over SSH. Having files locally and rsync them from time to time is also a good option if SSHFS is not enough. I just have to be careful as the files might be modified from different locations. Thanks for your help. – Ponytech Nov 3 '12 at 15:24
@zepatou another alternative could be using a distributed version control system (git, mercurial, ...) - that could help with possible clashing updates from different machines (you could run it over ssh and with compression). However, it would only work reasonably for text files. On the other hand, you'd have a history to go back to if something went wrong. – peterph Nov 3 '12 at 21:25

Your Answer


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.