Atom Package with SSHFS... fusermount: mount failed: Operation not permitted

1.4k Views Asked by At

I'm writing a Atom package which attempts to mount a remote filesystem via SSHFS and show it in a tree-view. I'm having issues with getting the mount to succeed. Specifically, as user 'wagoodman' if I type at the terminal the following:

sshfs -o IdentityFile=/home/wagoodman/.ssh/id_rsa -o cache=yes -o StrictHostKeyChecking=no wagoodman@localhost:/tmp /home/wagoodman/.atom/mounts/localhost/tmp

This works fine! That is, I am able to mount the /tmp directory from my localhost over ssh to /home/wagoodman/.atom/mounts/localhost/tmp with no issue.

However, if I attempt the same task within the Atom package (a coffee script) then it fails with fusermount: mount failed: Operation not permitted. I've checked that atom is running under the same user (wagoodman). This is done by calling child_process.exec to the sshfs binary on the system (with the necessary parameters).

Something interesting to note: If I write a small coffescript that is invoked via the commandline that does the same thing (call child_process.exec to sshfs) and the script works fine! This is quite perplexing.

I've created a repo with a small Atom package to reproduce the issue I'm seeing here: https://github.com/wagoodman/fusermount-issue

Add the package to atom in Dev mode and hit Ctrl+Alt+O to see the problem. Run coffee test.coffee to see the operation work.

Note: you need to tweak the parameters in test.coffee and lib/fusermount-issue.coffee for your environment (user, mount point, etc....).

0

There are 0 best solutions below