0

I want to mount directories on my Raspberry Pi running Raspbian Stretch and access on macOS using nfs.

/etc/exports on the Pi contains

/home/pi    *(rw,sync,no_subtree_check)

I can successfully mount the share on macOS with

sudo mount -t nfs -o resvport,rw IP:/home/pi mountpoint

This mounts the files as user 1000, and I can access the files, but not write or delete.

sudo mount -t nfs -o noowners,resvport,rw IP:/home/pi mountpoint

Mounts the files as current macOS user, but I still can't write or delete.

The uid of the macOS user is 501. Ideally I would like to configure the system to allow my Mac user to have equivalent access to the pi user, without opening the whole home directory to all.

1
  • Can you run NFS v4 on each system? That will let you specify ID mapping on the NFS server. Oct 15, 2017 at 10:42

1 Answer 1

2

Thanks to the hint by Mark Plotnick, reading the very confusing man pages and lots of experimentation I finally got it to work using the following in /etc/exports

/home/pi        *(rw,sync,no_subtree_check)
/home/pi        zaphod.local(rw,sync,no_subtree_check,all_squash,anonuid=1000,anongid=1000)

zaphod.local is my Mac, and this maps the uid and gid to those of the pi user.

Other pi users have their normal access, but any others can only read files.

You must log in to answer this question.

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