Super User is a question and answer site for computer enthusiasts and power users. 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

I know sshfs is used to mount remote directory to local, but I need to mount local directory to remote fs.

I would like to mount a local folder such as:


onto a remote machine which I have ssh access to, such as:


The goal being that edits made locally are reflected on the remote filesystem.

share|improve this question
fyi:… this is possible. – quinn Apr 4 '14 at 21:04
@quinn is it working solution? – Konga Raju Apr 18 '14 at 4:29
Yes, I'm using it currently, seems to work fine – quinn Apr 18 '14 at 5:14
Actually, I have one issue:… – quinn Apr 18 '14 at 11:31
@quinn you should post the solution in that blog as an answer here. It works for me. – brismuth May 22 '15 at 16:08


In order to do this "all" you need to do is reverse your logic. You could, for example, set up a 1 liner which would ssh into the remote machine and then use sshfs to mount the remote directory on the local machine on that box. Of-course this might be simplistic what with NAT, firewall rules etc, but you did not describe your usage case.

There are other protocols like SMB and, even better, NFS - but they will suffer similar issues.

The core of the problem you have is that a machine needs to trust the source of the data, and if you can remotely mount a file system that would break one of the core tenets of internet security.

share|improve this answer


How to do it? You set up ssh forwarding by using port 10000 on the machine you log in on to port 22 on your local machine and use sshfs to mount in on the other side.

F.ex. to mount /home/username/mywwwdevelstuff on your local machine to /var/www on the server side:

localusername@localmachine: ssh username@server -R 10000:localmachine:22
username@server: cd /var
username@server: sshfs -p 10000 -o idmap=user,nonempty \
                 localusername@ www
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .