I have found the best way to combat bad file permissions on NFS shares, only do this if you don’t care for security.
in /etc/exports add the option
This will by default force permissions of all creations and accesses to the uid 65534 and the gid 65534, if you wish to specify the user id and the group id to use instead of this, just add the following:
where XXXX is the ID, not the name, of the user/group you wish to force.
Under Debian/Ubuntu, by default the first user & group id is 1000:1000, so you could use the following
Then on your NFS share, be sure to fix the permissions of all the existing files if there is any, this MUST be done on the NFS server, the NFS server by default will squash root operations originating from a client.
$ sudo chown -R 1000:1000 /path/to/nfs/share
Very simple to fix, much easier then setting up samba even still, and works much better when serving to a linux machine.
For those that are interested, my /etc/exports contains:
And my files are ALL owned by 65534:65534, which under Debian & Ubuntu are «nobody:nogroup».