[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

nfs 'all_squash' not working on unstable nor stable servers



Hi there,

I was trying to configure a debian to serve an nfs to my mac. The main problem I encountered was that uids and guids did not match on those computers, so I did not have read-write access I need. Since I did not want to change the guids and gids on any of the machines I decided to use the all_squash option allied to anongid and anonuid on exportfs:
/path_to_export     mac_IP(rw,all_squash,anonuid=1000,anongid=1000)
So that the mac would see all of the things inside the mounted directory /path_to_export as having both guid and gid 1000.
It did not work.

First I thought it had to do with the mac, but that was not the case: my next step was testing it with another computer running debian. And again, it did not work. Basically the all_squash option in exportfs is being ignored on these debian systems. A full description of what I did follows.

I started by setting a machine called mozart as server (it runs debian stable and a 2.4 kernel). I changed the /etc/exports adding:
/       haydn(rw,all_squash,anonuid=1000,anongid=1000)
those number came from the other computer, haydn (running debian unstable and a 2.6 kernel), by issuing:
haydn$ id rhwinter
So, as I mounted this entry from mount:
haydn$ cat mount
mozart:/      /mozart         nfs       rw,noauto                             0       0
haydn$ mount /mozart
I expected it to list all files as if they were owned by rhwinter (or gid/uid 1000). That is, I expected:
haydn$ ls -n /mozart
total XXXX
drwxr-xr-x  12 1000 1000     1112 May  5  2006 XXXX
Instead, to my surprise, I got:
haydn$ ls -n /mozart
total XXXX
drwxr-xr-x  12 1001 1001     1112 May  5  2006 XXXX
Now, those uid and gid are exactly the same as in mozart. I first thought that the anongid and annonuid were not working. So I decided to test all_squash by itself. That is, I changed mozart's /etc/exports to:
/       haydn(rw,all_squash)
And exported the volumes again:
mozart# exportfs -a (I also tried exportfs -r , but that did not make any difference)
And umounted and mounted /mozart on haydn again, that is:
haydn# umount /mozart
haydn# mount /mozart
Now I expected the uid and gid of everything on haydn's /mozart to be 65534 (those of 'nobody'). Instead I got exaclty the same as before.

The last thing I tried was inverting haydn and mozart, that is setting mozart as the client and haydn as the server, to see if it was related their flavors/kernels. The same thing happened, all_squash was ignored yet again. I even tried restarting the nfs-related processes (/etc/init.d/nfs-common restart; /etc/init.d/nfs-kernel restart;/etc/portmap restart ) on both machines but it still didn't work.

Any clues on what might be going on? Did I get the way all_squash works all wrong?

Thanks a lot on any help!!!
rhwinter
(PS: please CC any replies of this to my email since I don't subscribe to debian-user!!!)

Some references I (had a hard time to find, perhaps they might help others!):
NFS related:
NFS - mac OS X related stuff

Reply to: