0

I need to mount a remote filesystem on a linux box using the afp protocol. The linux box runs an old Debian 4.

I downloaded the source code of mount_afp, compiled it and installed it with all the required packages.

Then created /etc/fuse with the following command:

  mknod /dev/fuse c 10 229

(according to the instructions here)

I can mount the remote filesystem as root by executing:

 mount_afp afp://USER:PASSWD@REMOTE_SERVER/FOLDER /mnt/MOUNTPOINT/

but the same command fails when run as normal user (of the local machine).

After reading here and there, I created a group fuse, and added my normal user U to the group fuse:

[prompt] groups U
U fuse

Then modified the group of /dev/fuse, that now has the following rights:

 0 crwxrwx--- 1 root fuse 10, 229 Feb  8 15:33 /dev/fuse

However, if the user U tries to mount the remote filesystem by using the same command as above, U gets the following error:

Incorrect permissions on /dev/fuse, mode of device is 20770, uid/gid is 0/1007. But your effective uid/gid is 1004/1004

But the user U with uid 1004 has also gid 1007 (group fuse).

I might think the problem is related to real/effective/etc. ID, but I do not know how to proceed and could not find any clear instructions. Could you please help me?


There is also another problem. If I mount /mnt/MOUNTPOINT as root and run ls -l /mnt, I get:

  drwxrwxrwx 15 root root 466 Feb  8 16:34 MONTPOINT

If I run ls -l /mnt as normal user U I get:

 ? ?????????? ? ? ? ?            ? MOUNTPOINT

in fact when I try to cd /mnt/MOUNTPOINT I get:

 $-> cd /mnt/MOUNTPOINT
-sh: cd: /mnt/MOUNTPOINT: Not a directory

Then I unmount /mnt/MOUNTPOINT as root and run again ls -l /mnt as normal user U I get:

 0 drwxr-xr-x 2 root root 6 Feb  8 15:32 MOUNTPOINT/

After reading Frank's answer, I killed every shell/process running with privileges of user U. Still U cannot mount the remote filesystem, but the error message has changed. Now it is: "Login error: Authentication failed". The problem is not related to remote login/password since the same command works perfectly when run as root of the local machine.


Since I cannot get mount_afp to work with normal users, I decided to follow mgorven's suggestion. So I run the commands:

 mount_afp -o allow_other afp://USER:PASSWD@REMOTE_SERVER/FOLDER /mnt/MOUNTPOINT/

and

 mount_afp -o user=U afp://USER:PASSWD@REMOTE_SERVER/FOLDER /mnt/MOUNTPOINT/

The mount succeeds but user U cannot access the mount point. If U executes ls -l in /mnt

U@LOCAL_HOST [/mnt]
$-> ls -l
ls: cannot access MOUNT_POINT: Permission denied
total 0
? ?????????? ? ? ? ?            ? MOUNT_POINT

Is it so hard to have this utility working?

3 Answers 3

1

Success for my single user setup came in the form of

  • creating the group fuse
  • adding U to the fuse group
  • mounting with
    mount_afp -o user=U,group=fuse afp://USER:PASSWD@REMOTE_SERVER/FOLDER /mnt/MOUNTPOINT
    • using the uid and guid was not working for me
      Unknown user 1000
      Unknown group 108
      these being the correct uids as retrieved from id U

permissions were then set to 777 for the mounted directory and I was finally able to browse and play.

This doesn't solve the OPs question, but hopefully it's enough confirmation for some.

1
  • Did the user and group options get removed in newer MacOS versions? May 8, 2019 at 16:36
0

You probably didn't log out and in again after adding yourself to the fuse group. Group information is cached and so you need to do this after changing group memberships. Run groups after doing so to verify that fuse is listed.

By default FUSE mounts only allow access to the user who mounted them. If you want to allow other users to access them you need to add the allow_other mount option, so try this:

mount_afp -o allow_other

If that doesn't work you can set the ownership of the mount to your own user:

mount_afp -o user=1004,group=1004
3
  • I did log out and back in after adding the user to the fuse group. The problem concerns the user U not being able to mount the filesystem. Feb 8, 2013 at 23:00
  • I would rather not assign the ownership of the mount point to a specific user since the linux server is used by several people who wish to mount the same remote filesystem. Feb 10, 2013 at 12:07
  • Hi, since nothing was working, I tried to follow your suggestion. I modified the question. Do you have any idea why it keeps refusing to work? Feb 15, 2013 at 10:13
0

I had the same problem. Having added the username to the fuse group I logged out and back in (on ssh). But I still had the same problem. Then I rebooted the box. It then worked fine after creating a mount point the user has access to. So for me log out via ssh then log back in did not force reload of the groups, I guess you have to reboot or may be log out from all other shells (I am not sure if there were other shells I was log in on).

1
  • After reading your answer, I checked the number of running shells/processes for user U and found a plenty of. Killed every single process, now I have a different error: "Login error: Authentication failed". I updated the question. Feb 10, 2013 at 12:02

You must log in to answer this question.

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