Why does directory vanish when I do SSHFS? How to setup SSHFS share on Max OSX 10.9?

4

1

I'm running Max OSX 10.9.3 and I'm trying to setup an SSHFS file-share between my MacBook Pro and a remote file system. However, when I try to do it, it doesn't work.

Strangely enough, it makes the target directory disappear. Has anyone else seen this happen? Is it a bug?

First see that I can ssh normally into the target machine:

% ssh remoteuser@XXX.XXX.XXX.XXX            # <--- SSH to remote system works! See below.
remoteuser@XXX.XXX.XXX.XXX % ls -altr remoteDir
total 8
drwxr-xr-x 26 remoteuser remoteuser 4096 Jun 22 01:00 ..
drwxrwxrwx  2 remoteuser remoteuser 4096 Jun 22 01:08 .
remoteuser@XXX.XXX.XXX.XXX % exit
%                                           # <--- Logged out of remote system

Next, I create a directory locally and verify it was created:

% pwd
/mnt

% ls
total 0
drwxr-xr-x  31 root  admin  1122 Jun 18 18:34 ../
drwxr-xr-x   2 root  admin    68 Jun 23 08:11 ./

% sudo mkdir share1 
% ls
drwxr-xr-x  31 root  admin  1122 Jun 18 18:34 ../
drwxr-xr-x   4 root  admin   136 Jun 23 08:50 ./
drwxr-xr-x   2 root  admin    68 Jun 23 08:50 share/

Now I try to setup the SSHFS share:

% sudo sshfs remoteuser@XXX.XXX.XXX.XXX:remoteDir /mnt/share1
remoteuser@XXX.XXX.XXX.XXX's password:
%

Ok. It seems to have worked. No errors. So let's see the share we created, shall we?

% ls
ls: share1: No such file or directory
total 0
drwxr-xr-x  31 root  admin  1122 Jun 18 18:34 ../
drwxr-xr-x   3 root  admin   102 Jun 23 08:12 ./

What? Not only is the File Sharing not working, but the share1 directory seems to have vanished! (Although the file system seems to know it is missing, which is weird).

Where did /mnt/share1 go and how do I setup this SSHFS?

Saqib Ali

Posted 2014-06-23T15:23:21.247

Reputation: 163

Answers

4

Check out the config options https://code.google.com/p/macfuse/wiki/OPTIONS

I added 'allow_other' and it worked for me. Here is my connect string:

sshfs -p 22 user@example.net:/home/user/ ~/RemoteHome -oauto_cache,reconnect,defer_permissions,negative_vncache,allow_other,volname=RemoteHome

TommyD

Posted 2014-06-23T15:23:21.247

Reputation: 41

2

Unless you explicitly want to share that folder with other users of your system, you can also call it without sudo; that way you can also omit allow_other option - the user that invokes the command (you) will have exclusive access (apart from root of course).

Miro

Posted 2014-06-23T15:23:21.247

Reputation: 21