0

I am trying to mount a mac share on my Pi with mount_afp. When I try to add permissions when mounting:

sudo mount_afp -o user=pi,group=pi afp://username:[email protected]/myshare ./mydir

I get this error:

FUSE reported the following error:
fuse: failed to open /dev/fuse: Permission denied
Unknown error 1, 13.

I have tried

sudo usermod -aG fuse pi
exec su -l $USER

and

gpasswd -a pi fuse

If I remove the -o user=pi,group=pi, it will mount but I need to access the directory as root, which I am trying to avoid. Any help is really appreciated.

2 Answers 2

0

Here are a sequence of commands that work. 1-4 can be thought of as "setup" commands and 5 can be repeated for the same volume. Recommend using "pi" as the username on the macOS (aka AFP) server to keep confusion down on file ownerships.

  1. sudo apt-get install afpfs-ng -y
  2. sudo apt-get install fuse -y
  3. sudo mkdir -p /Volumes/volName
  4. sudo chown pi:pi /Volumes/volName
  5. afp_client mount -u pi -p piPasswordOnMacServer macServerIPAddress:volName /Volumes/volName

Then to unmount the volume you do a: sudo umount /Volumes/volName

where:

  • volName - is the name of the "share" or volume you want the pi to access on your AFP server
  • piPasswordOnMacServer - the password setup for the "pi" user on the AFP / macOS server

Here is the same thing but getting more towards a script... The installs in #1 & #2 need not be repeated. The single command line for #3 can be used repeatedly with a different volName in your macOS (AFP) server that you want to mount:

  1. sudo apt-get install afpfs-ng -y
  2. sudo apt-get install fuse -y
  3. sudo mkdir -p /Volumes/volName;sudo chown pi:pi /Volumes/volName;afp_client mount -u pi -p piPasswordOnMacServer macServerIPAddress:volName /Volumes/volName

Moving more towards a shell script, change the macServerIPAddress, volName and piPasswordOnMacServer to variables and feed them in as parameters to your shell script.

Very important, do not sudo the afp_client command or you can only access what you mount as root, forcing you to sudo su to use the mounted volume which has a bunch of negative side effects for use on the RBPi

Last note: you can cd /Volumes/ but you cannot then cd /volName/ as it will say no such file or directory. You need to cd /Volumes/volName/ for the illusion to work.

-1

Here is the solution

sudo mount.cifs //192.168.1.XX/Passport /home/pi/passport -o user=johndoe,nounix,sec=ntlmssp

This mounts a mac share called Passport on 162.168.1.XX to a directory on my pi /home/pi/passport

1
  • This is a different approach and not a solution to the actual issue of using mount_afp.
    – Cerniuk
    Commented Jul 5, 2019 at 18:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.