So I used sshfs to Mount a Remote Filesystem

This is the one Linux way to edit files remotely as if they were local. For a Windows approach, see my post on WinSCP. There’s also a Windows sshfs called Dokan SSHFS.

sshfs is a user-space Linux filesystem that makes an ssh connection look like a local filesystem.

It’s trivial to use:

  1. As root (or using sudo) add your user to the ‘fuse’ group:

    # adduser butler fuse
    Adding user `butler' to group `fuse' ...
    Adding user butler to group fuse

  2. Start a new shell as the desired user (to get the updated group list), make a mount point, and start sshfs. Note that sshfs will prompt you to accept the remote key (not shown) if this user hasn’t previously connected to this remote account.

    $ mkdir soi
    $ sshfs soi's password:
    $ ls soi/images
    changeDirectories.jpg keepRemoteSynced.jpg updatingFiles.jpg
    directoriesSynced.jpg session.jpg watchForChanges.jpg
    firstSession.jpg updateFiles.jpg

  3. Read and update files as if they were local – but with some transfer lag…

If you don’t want to deal with the lag every time you read or write the file, you’ll probably want to use scp or rsync to copy the files over when you need them on the remote machine – and you’ll probably want to use ssh-agent and ssh-add to set up key-based authentication, so you don’t have to type your password every time. You can even put the scp or rsync calls in your Makefile…


  1. auto loans for bad credit Said,

    July 26, 2013 @ 12:42 am

    She provides useful information on bad credit
    car loanss. You can use this money to create a little
    more conservative these days and the qualifications for getting
    an auto loan calculator. Auto financing is a blessing for borrowers with bad credit.
    Going to the local bank might seem the obvious move, but Bad Credit Car Loanss from traditional lenders tend to offer much better loan packages given that they feel that
    this would preserve his or her next car. You can get a
    Bad Credit Car Loans, regardless of you current financial situation.

  2. Keep Remote Directory Up-to-date [ANSWERED] - Tech ABC to XYZ Said,

    February 12, 2016 @ 2:40 am

    [...] A bit more detail, like how to set it up so you can do this as a regular user, on my blog [...]

Leave a Comment